Creating 3D assets
AnywhereAcademy is often executed on portable devices, so optimizing the application is a necessity. This optimization needs to be also applied on the used 3D assets. In this chapter a short checklist with the most important points are presented. Following these guidelines would allow for a already good optimized asset. In later subchapters a more detailed description with more optimization steps are provided, if a deeper dive into the topic is needed.
In this case less is more. Using models that have simple geometry and shared textures uses less computational resources. These guidelines give the maximum of available resources. So, if you can achieve the needed quality with less, do it. Check out this short video for a quick explanation on topology.
Checklist:
- 10.000 polygons max
- implement good topology using mostly quads, avoiding ngons
- use the least amount of polygons to create the highest level of detail
- name objects logically
- Apply scale and if needed, apply transformation and rotation
- Unwrap objects
- When possible, create for multiple objects one texture atlas, trim sheet or hybrid
- for shared textures a size of 4k is ok
- use at least albedo and normal maps for textures
3D modeling
When a model is finished, export it as a FBX file, with the Y- coordinate pointing up.
Creating the mesh
One of the most important points for optimization is creating a good mesh. Try to create an object using the least amount of polygons, while its distinctive shape is still recognizable. Try to implement details using textures. Create this object by mostly using quads (polygon consisting of 4 vertex points), and avoid ngons (polygon consisting out of more than 4 vertex points). Having an occasional ngon or a triangle leads not to a bad mesh, but try to have them on flat surfaces to avoid shading errors.
Checklist:
- Maximum of 10.000 polygons, the lesser the better
- Use mostly quads, avoid ngons
- delete not visible polygons
- Name objects logically, keep a consistent naming scheme
- Apply scale
- If needed, apply transformation and rotation
UV mapping
UV mapping is the process of unwrapping the 3D model to a 2D plane, allowing the usage of 2D textures to be projected onto the 3D objects. When unwrapping, try to keep a consistent texel density of all the maps (meaning all UV islands should have a relative similar size to each other). But if a specific part needs to be more detailed, a deviation of density is encouraged.
Checklist:
- consistent texel density
- use overlapping UV's when it makes sense
- avoid UV streching
- leave enough space between UV islands
- if possible, use existing or future planned trimsheets/atlases
Texturing
Unity uses PBR textures (physics based rendering), allowing the model to "fake" detail trough lighting. In this case, Albedo, Metallic + Smoothness in alpha channel , Ambient Occlusion, Emission and Normal maps are used. There are multiple online sources for free to use PBR texture, just make sure they are copyright free.
Checklist:
- use at least Albedo and Normal maps
- use other maps for more detail if needed
- make one big texture for multiple or large objects
- create texture atlases, trim sheets or hybrids
- for shared textures 4K or 8K are ok, but try to stay smaller
Using the models in Unity
Import setting
These are the general guidelines, so if needed change the settings for your use case. Leave not used settings to the default option.
When importing 3D Models into Unity, use these settings:
- cameras: Off
- lights: Off
- generate Lightmap UVs: On
- material Import: None
When importing textures, use there settings:
- mipMapping: On
- filter Mode: Trilinear (better for VR)
- max Size: can be as high as 8k depending on your use case and texture bandwidth usage per scene (can be set per platform for optimization)
- use Crunch Compression: On – 100%
Materials
Use as little materials per object as possible. This is usually 1, sometimes 2
- use as little materials per scene as possible thanks to texture atlases
- necessary material variants can still potentially use the same texture atlas
- remove unused materials to prevent project bloat or confusion
- keep material names understandable for others
- full PBR is used
Other tips
- use simple meshes for collision detection and teleport areas
- create prefabs of objects
- have a coherent scene hierarchy and naming scheme
For light baking: use mixed Lighting with 1 real time direction light and all other lights baked, dynamic objects should receive lighting from real time light and probes, static objects should be completely baked
- static objects marked correctly
- contribute GI checked where needed
- shadow casting per object checked
- shadow proxies placed where needed
- lightmap UVs generated in import settings
- lightmap scale per object checked
- light probes placed in important areas
- reflection probes placed at common reflection povs
- bake tested
- dynamic objects visually match static environment
- dark areas checked
- overbright areas checked
- lightmaps imported in desired size after baking
- lightmaps compressed lossless after baking
Optimization checklist:
- static flags enabled wherever needed
- occlusion culling set up
- real Time Lights limited to only the necessary
- shadow caster count checked
- total texture bandwidth use checked
- particle cost checked
- post-processing cost checked