Art Assets – best practice guide

September 2, 2011 in Rants & Raves

Unity supports textured 3D models from a variety of programs or sources. This short guide has been put together by games artists with developers at Unity, to help you create assets that work better and more efficiently in your Unity project. This will be incorporated into the documentation in due course

Scale & Units

  • Set your system and project units  for your software to work consistently with Unity e.g. Metric.
    • Working to scale can be important for both lighting and physics simulation;
    • Be aware for example; Max system unit default is inches and Maya is centimetres.
    • Unity has different scaling for FBX and 3D application files on import, check FBX import scale setting in Inspector.
    • If in doubt export a metre cube with your scene to match in Unity.
  • Animation frame rate defaults can be different in packages, is a good idea to set consistently across your pipeline – e.g. 30fps for example.

Files & Objects

  • Name objects in your scene sensibly and uniquely – this can help you locate and troubleshoot specific meshes in your project:
  • Avoid special characters *()?”£$n  etc.
  • Use simple but descriptive names for both objects and files (allow for duplication later).
  • Keep your hierarchies as simple as you can.
  • With big projects in your 3D application, consider having a working file outside your Unity project directory – this can often avert time consuming updates and importing unnecessary data.

Sensibly named objects help you find stuff quickly

Mesh

  • Build with an efficient topology – use polygons only where you need them.
  • Optimise your geometry if it has too many polygons – many character models will need to be intelligently optimised or even rebuilt by an artist esp if sourced/built from:
    • 3D capture data
    • Poser
    • Zbrush
    • Other hi density Nurbs/Patch models designed for render
  • Evenly spaced polygons in buildings, landscape and architecture where you can afford them, will help spread lighting and avoid awkward kinks.
  • Avoid really long thin triangles

Stairway to framerate heaven

The method you use to construct objects can have a massive affect on the number of polygons, especially when not optimised. Observe the same shape mesh : 156 triangles (right) vs 726 (left). 726 may not sound like a great deal of polygons, but if this is used 40 times in a level, you will really start to see the savings. A good rule of thumb is often to start simple and add detail where needed. It’s always easier to add polygon than take them away.

Textures

Textures are more efficient and don’t need rescaling at build time if authored to specific texture sizes – e.g a power of two – up to 4096×4096 pixels, e.g. 512×512 or 256×1024 etc.  (2048×2048 is the highest on many graphics cards/platforms) there is lots of expertise online for creating good textures, but some of these guidelines can help you get the most efficient results from your project:

  • Working with a Hi-res source file outside your unity project can be good working practice (such as a PSD or Gimp file – you can always downsize from source but not the other way round).
  • Use the texture resolution output you require in your scene (e.g. save a copy – such as a 256×256 optimised PNG or a TGA file for example) you can make a judgement based on where the texture will be seen and where it is mapped.
  • Store your output texture files together in your Unity project for example: \Assets\textures
  • Make sure your 3D working file is referring to the same textures for consistency when you save/export.
  • Make use of the available space in your texture, but be aware of different materials requiring different parts of the same texture can end up using loading that texture multiple times.
  • For alpha (cutout) and elements that may require different shaders, separate the  textures. E.g. the single texture below (left) has been replaced by 3 smaller textures below (right)

1 texture (left) vs 3 textures (right)

  • Make use of tiling textures (which seamlessly repeat) then you can use better resolution repeating over space.
  • Remove easily noticeable repeating elements from your bitmap, and be careful with contrast – if you want to add details use decals and objects to break up the repeats.

Tiling textures ftw

  • Unity takes care of compression for the output platform, so unless your source is already a JPG of the correct resolution it’s better to use a lossless format for your textures.
  • When creating a texture page from photographs, reduce the page to individual modular sections that can repeat, e.g. you don’t need 12 of the same windows using up texture space. That way you can have more pixel detail for that one window.
Window Tax

Do you need ALL those windows?

Materials

  • Organise and name the materials in your scene – this way you can find and edit your materials in Unity more easily when they’ve imported
  • You can choose to create materials in Unity from either:
    • <modelname>-< material name> or:
    • <texture name> – make sure you are aware of which you want.
  • Settings for materials in your native package will not all be imported to unity:
    • Diffuse Colour, Diffuse texture and Names are usually supported
    • Shader model, specular, normal, other secondary textures and substance material settings will not be recognised/imported (coming in 3.5)

Import/Export

Unity can use two types of files: Saved 3D application files and Exported 3D formats – which you decide to use can be quite important:

Saved application files

Unity can import, through conversion:  Max, Maya, Blender, Cinema4D, Modo, Lightwave & cheetah3D files, e.g. .MAX, .MB, .MA etc.

http://unity3d.com/support/documentation/Manual/HOWTO-importObject.html

Advantages:

  • Quick iteration process (save and Unity updates)
  • Simple initially

Disadvantages:

  • A licensed copy of that software must be installed on all machines using the Unity project
  • Files can become bloated with unnecessary data
  • Big files can slow Unity updates
  • Less Validation – harder to troubleshoot problems

Exported 3D formats

Unity can also read FBX, OBJ, 3DS, DAE & DXF files – for a general export guide you can refer here:

http://unity3d.com/support/documentation/Manual/HOWTO-exportFBX.html

Advantages:

  • Only export the data you need
  • Verify your data (re-import into 3D package) before Unity
  • Generally smaller files
  • Encourages modular approach

Disadvantages:

  • Can be slower pipeline or prototyping and iterations
  • Easier to lose track of versions between source(working file) and game data (exported FBX)

Characters & Animation

Coming soon!

Comments (26)

Subscribe to comments
  1. Deicoon

    September 27, 2011 at 3:46 pm / 

    Should also add in there:
    To avoid lines showing up along the sides of your grass, make sure you have a good 5-7 pixel alpha buffer around all 4 edges to accommodate Unity’s automatically generated, mip-mapped texture atlas.

    By default, the Unity editor displays 2 bones per vertex weighting on skinned objects.

    Another downside of saving .3ds files straight into unity is if you update plugins in 3ds max, when you open the project it will hide the user prompt to update the file and appear to be unresponsive. To fix it you have to force quit unity, open the file and save it in an updated format. This can be labor intensive if you have many files.

  2. Olly Nicholson

    September 26, 2011 at 10:39 pm / 

    Possibly could have been worded differently, if you added a few small textures into the space available in another, like your own t-page, to save space – you can end up loading that big texture in many separate times throughout your game when you only needed to load a small one. It’s swings and roundabouts really but In other words it’s can be good practice to design your bitmap data for a given object/building to fit wholly into one texture.

  3. Seon

    September 22, 2011 at 8:21 am / 

    “Make use of the available space in your texture, but be aware of different materials requiring different parts of the same texture can end up using loading that texture multiple times.”

    That’s just not true. Only one copy of the Texture is loaded into VRAM and then is referenced by whatever materials are using it.

  4. Emad

    September 15, 2011 at 2:12 am / 

    Great Article, Thank you … :)

  5. Balance Scales

    September 12, 2011 at 10:59 pm / 

    Excellent for 3d designers…keep it coming, please.

  6. Pixelstudio

    September 9, 2011 at 5:14 am / 

    Quick win top when using animation from 3dsmax and physics, remove the mesh colliders from the objects that are animated!!!! huge speed increase

  7. Jeedee

    September 8, 2011 at 11:13 pm / 

    Can’t wait for the animations part… it is our most growing pain

  8. erica

    September 8, 2011 at 9:06 am / 

    Just wanted to encourage future posts of this kind. It’s always good to get advice from the people who know the tool best :)

  9. brad_ict

    September 8, 2011 at 4:34 am / 

    TGA requires manual creation of an alpha channel and doesn’t create an alpha channel from layer transparency when saving out of Photoshop, however PNG auto creates alpha and has worked very well for us.

  10. Adam Mechtley

    September 7, 2011 at 10:59 pm / 

    Hi. This statement is misleading: “A licensed copy of that software must be installed on all machines using the Unity project.” This is only true if you are not using UAS.

  11. Olly Nicholson

    September 6, 2011 at 9:57 am / 

    …as it says, it’s just an example – if you have a library of textures already in your project, or you use substances it can encourage re-use of textures. Links can get broken from the source if your project moves, but everyone has different requirements, so whatever works for you :-)

  12. PolishRenegade

    September 6, 2011 at 7:45 am / 

    “Store your output texture files together in your Unity project for example: \Assets\textures”

    I often find the contrary to be more practical… for one simple reason: If you use saved application files, the texture path will break when the texture is moved. It can be a real pain to relink those with hundreds of textures. It makes it a lot easier to transfer re-usable assets from one project to another too. Keeping it with the 3d asset in the same folder allows for seamless moving of all assets. (Using 3ds Max) Only exception is the management of reusable textures, however our structure takes care of that too because 95% of 3d assets that share one texture share one “category” folder thus allowing us to place multiple 3d assets within the same folder without breaking the folder organization logic.

    Or is there something I’m missing?

  13. Geppetto

    September 6, 2011 at 12:57 am / 

    This is really good stuff. Would definitely love to see more of these “professional tips” type of articles. Really handy.

  14. brad_ict

    September 5, 2011 at 6:25 pm / 

    Is this suppose to link to something legible? http://unity3d.com/support/documentation/Images/manual/HOWTO-exportFBX-0.jpg

    * it was before the documentation got processed, oops! will be fixed when 3.5 rolls around, will post a link here too – Olly

  15. Jan Oonk

    September 5, 2011 at 9:34 am / 

    Better late than never :) This is the nr 1 frustration of my students: importing assets into Unity.
    Great article thanks!

    In addition to above: In the book “Beginning 3D Game Development with Unity” by Sue Blackman see also gives some tips&best practices for creating/importing your own assets in chapter 7 page 310+

  16. brad_ict

    September 4, 2011 at 8:55 pm / 

    Also, keep your Maya units in Meters but export the FBX in Centimeters (because of the default .01 Unity scale factor) to get a 1:1 relationship between Maya and Unity.

  17. brad_ict

    September 4, 2011 at 8:53 pm / 

    Another tip (that maybe you guys are fixing(ed)?) is that after re-export the FBX isn’t fully updated when it’s part of a prefab (new meshes, names of nodes, etc. don’t get updated) basically just the vertex positions are changed. You have to delete the FBX from the prefab and re-drag it into the prefab to fully update the FBX. We’ve adopted a workflow where we nest an FBX underneath a prefab instead of making them one and the same.

  18. Jay

    September 3, 2011 at 10:22 pm / 

    Thanks for this post, very helpful information

  19. Aureus

    September 3, 2011 at 7:07 am / 

    @Paradoks

    Thank you!

  20. Phil

    September 3, 2011 at 5:59 am / 

    Bear in mind you can’t repeat textures “inset” in a tpage (atlas), without subdividing geometry… you have to work out the best trade-off between higher resolution geometry and more textures/drawcalls.

  21. Paradoks

    September 3, 2011 at 5:40 am / 

    @Aureus

    Here you can begin you search:
    http://en.wikipedia.org/wiki/Texture_atlas

    The technique is called texture atlas.

  22. Aureus

    September 2, 2011 at 7:30 pm / 

    Very interesting!

    Where I can find a detailled tutoria of this?
    http://blogs.unity3d.com/wp-content/uploads/2011/09/BuildingWrongRight1.png

  23. Paradoks

    September 2, 2011 at 4:22 pm / 

    Very interesting.
    Looking forward to read the character and animation part.

    Thx

  24. Martin Schultz

    September 2, 2011 at 3:36 pm / 

    Great stuff. More please of “good practices examples” with Unity please!

  25. Jordan

    September 2, 2011 at 2:02 pm / 

    Great article, keep them coming!!

  26. Richard Fine

    September 2, 2011 at 12:48 pm / 

    Great article! I’d love to see more of this kind of thing.

Comments are closed.