Documentation
Optimize and build
Make NanoGeo faster with shadow, occlusion culling, software rasterizer and video memory settings, then build your Unity game.
Making it faster
Shadows
Shadows are often the largest cost, because a directional light draws several cascades. Raise Shadow Error Multiplier, use Shadow Min Lod Level on objects that do not need detailed shadows, or on HDRP let static lights update their shadows on demand (cached shadows).
Occlusion culling
Cameras skip NanoGeo parts that are hidden behind other NanoGeo objects. It checks twice per frame, so nothing pops in when the camera turns quickly. Only NanoGeo objects hide other objects; ordinary MeshRenderers do not. In scripts: NanoGeoOcclusion.enabled, or NanoGeoOcclusion.SetEnabled(camera, false) for one camera.
Software rasterizer
On Full devices, very small parts are drawn by a compute shader, which is faster for tiny triangles. The result looks the same. In scripts: NanoGeoSoftwareRaster.enabled and NanoGeoSoftwareRaster.SetEnabled(camera, value). Tools > NanoGeo > Benchmarks > Raster Modes (Main Camera) shows what it brings in your scene.
Video memory
The global settings are in Runtime/Resources/RoamMoon.NanoGeo/NanoGeoRuntimeResources.asset. The buffer sizes there are generous and use several hundred megabytes. You can lower them; if they get too small, the NanoGeo window shows a warning.
For very large worlds, set Streaming Budget MB, for example to 256. Then only the simple levels always stay in video memory and finer detail is loaded when the camera comes close. Streaming saves video memory only, not normal memory. Changes to these settings take effect the next time NanoGeo starts, for example when you press Play.
Building your game
Steps
- Make sure BatchRendererGroup Variants is set to Keep All (see Installing).
- Build as usual.
The baked data, materials and shaders are included automatically because your scenes reference them. The baking library is used by the Editor only and is not part of the build.
Baking uses meshoptimizer by Arseny Kapoulkine, under the MIT license. It runs in the Editor only and is not part of your game build.