Performance of Models

download Performance of Models

of 4

Transcript of Performance of Models

  • 8/2/2019 Performance of Models

    1/4

    I'd like to go over a few things that might get easily overlooked when preparing yourmodels for X export and has an impact on fps performance or gameplay "performance"

    1. Smoothing Groups

    What are smoothing groups for? For smooth stuff of course. Not for edgy stuff obviously,right?Wrong! "For smooth stuff" is only the half of the truth.

    X and most gameengines (as far as i know) don't have a "smoothing group"-system likeMax has. Everything is smoothed in the engine without exception.But how can you get hard edges then, you may ask?

    Thats one of the duties of the exporter from max (or other modelling applications) to thegame format. It physically breaks up all different smoothing groups. If its not connected itcan't be smoothed, simple stuff ^^

    Thats not really that interesting for us. However what is interesting is the fact that splittedobjects will produce more vertices then you originally had. And vertex-count is what countsfor your cpu/gpu.

    Example:A simple square. Games usually convert everything to triangles. So you will get 2 triangles(tris) from the square (quad). If you applied the same smoothing group to both trianglesyou will end up with 4 vertices.

    If you apply a different smoothing group to each one or no smoothing group at allThe game breaks them up. Triangles have 3 points each -> 2*3=6 vertices.

    Same Polygon-count, but different Vertex-count.

    Conclusion: Apply smoothing groups to every single face in your model.

    Sounds really painfull but luckily there is the autosmooth function of max.

    Here's a short Step by Step on how i smooth my hole model:

    - select all faces of your model and hit "clear smoothinggroups"- find everything that is round and should appear smooth in your model

    - apply the smoothing groups manually to these parts

    - go to "select by smoothing group" and select all numbers, hit ok

    - now hit crtl+i (or got to menu->select->invert) to invert the selection

    - set the angle to 2 or something like that

    - hit autosmooth

    Autosmooth works good on everything not rounded, but the rounded stuff you shouldmake yourself because the angle setting usually doesnt work really good there. Too highangle and other parts you don't want smooth are smoothed too. We don't want that.

  • 8/2/2019 Performance of Models

    2/4

    Autosmooth takes care of already applied smoothinggroups, thats why you can just hitautosmooth with already handsmoothed stuff on the model and why you should clear allold (and propably incomplete or wrong) smoothinggroups.

    If your model was not smoothed before the .bob you will end up with should be quite a bit

    smaller then the old version. That's also the reason why (for me) in some cases the .bob(compressed) file was larger after "compressing" then the .bod (uncompressed) file.

    2. Multimaterials, the Material Editor and its booby trap

    (or: "help, i created a monster")

    There are alot of different styles and workflows on how to get your model into theendshape.

    Some people might use multiple objects for the ease of creation (like myself) and attachthem to one object before exporting.

    Sometimes parts are also already textured (e.g. If you take parts from vanilla models) andhave a material assigned to them.

    If you assign it to another object that also has a texture but a different one you will get thisprompt:

    this is the famous deadly booby trap. If you use the wrong option you are dead. Its best toturn around and run away if you see it. Well not really, but almost.

    If you use one of the 2 upper options the multitextures get merged. Sort of. What it doesnttell you is that the multimaterialwill now get bigger and bigger and bigger each time yousee this dialog and hit the wrong button.

    You can't see it in the material editor. Nothing changes for you.

    However if you export all the merged materials will be in the material section of DBOX. Allof them. If you added a cube with a multimaterial of 12 textures to a sphere with a 8-tex.-multimat. You end up with 20 materials in the body. Even if cube and sphere only used onetexture from their multimat (even if its the same texture for both).

    I have seen bodies with up to 14,000 materials (fourteenthousand). I called them "bloated"for obvious reasons.

    Example:

    A model with 1000 polygons resulted in 6786 Materials. Filesize (.bod) bloated: 14MB

    Filesize unbloated: 200KB

    The nasty thing about this bloating is that you may not be able to import them anymoreinto max (2010 64bit in my case) because it crashes because of the overload of textures it

  • 8/2/2019 Performance of Models

    3/4

    wants to load into the material editor. Even the plain text information is too much(prevented the actual texture files from loading into memory) for it.

    So the only chance to rescue your model is to cut all materials except the first out of the.bod via texteditor and import it now. Now Select all faces of your model and give themmaterial ID 1. This is important because if you check around, you can find extremely highmaterial ID's all over the place (matching your huge materialblock of course), you want to

    get rid of all of them.

    Then you have to assign all textures and Material-IDs a new.

    Conclusion: Always use "Do not modify". Or just select everything you want to attach andgive them the same texture as the object you want to attach to. Then you won't get theprompt.

    3. LOD creation:

    LODs, slightly different thematic. Not really a fps-performance thing here but a gameplay-performance so to speak.

    If you reduce your model you will inenvitably lose volume if you use an automatedprocess. That's ok, but the problem is that the last LOD is used as physical collisiondetection (for lasers, missiles, ships and other stuff crashing into it).

    That's easily fixed with the push modifier. Create your lods by your favored method (i useproOptimize) and then apply a push modifer to the last LOD. Hide everything except thelast and your base model and push the last LOD until it covers most of the base modelagain. That's about it. You can handfix some areas if you think its important there.

    For example on large hull sections its better to have the LOD slightly bigger then the base.Because if a laser impacts slightly above the surface you will hardly notice it. If it is slightlybelow the base surface then you can't see the impact effect anymore and that looks oddand is pretty noticeable. If you leave the LOD like it is, it will to 95% be below the actualsurface.

    The slight increase in size won't be noticeable at the distance the last LOD will kick in

  • 8/2/2019 Performance of Models

    4/4

    anyway. You can of course (and should) adjust the last LOD also a little bit by hand to fitthe mainshape better. I create my LODs with Max's ProOptimize Modifier (implementedsince 2010 iirc), with the "retain texture" setting as that seemed to give the best results sofar.

    Thanks for reading, i hope you found it helpfull.Happy modding,

    KJ