Documentation
Reference
NanoGeo reference: scripting API, editor menus, troubleshooting, known limits, tested platforms and the benchmark tools.
Scripting
NanoGeoMesh
errorThresholdPixels, shadowErrorMultiplier, shadowMinLodLevel, castShadows and forceFallback can be changed at runtime. isRenderedByNanoGeo tells you whether NanoGeo draws the object, fallbackReason tells you why not.
NanoGeoManager
enabled- Turns NanoGeo on or off for the whole game.
current- The running instance, or null.
current.statshas the statistics shown in the NanoGeo window. registered- Lists all
NanoGeoMeshcomponents. failureReason- Explains why NanoGeo is not running.
ResetAll()- Restarts NanoGeo.
NanoGeoDebug
SetMode(mode) changes the visualization, freezeCulling freezes culling, available is true in the Editor and Development builds.
NanoGeoOcclusion and NanoGeoSoftwareRaster
Both have enabled and SetEnabled(camera, value).
NanoGeoProfiling
Set recording to true, then read GpuMilliseconds(pass) or TotalGpuMilliseconds. Editor and Development builds only.
Troubleshooting
An object is not drawn by NanoGeo
Select it and read the message in the NanoGeoMesh Inspector, or look at the list in the NanoGeo window. Common reasons are Read/Write turned off on the mesh, a transparent material, a material that is not HDRP Lit, URP Lit or an HDRP Shader Graph, and baked lightmaps.
Every object uses its MeshRenderer
If the Inspector says NanoGeo is turned off, run Tools > NanoGeo > Enable NanoGeo.
An object in a LOD Group says it is replaced by LOD0
That is expected. The LOD0 NanoGeoMesh draws it at every distance.
An object is missing for a moment
After you add NanoGeoMesh or change its material, a new shader variant is compiling. The object appears when it is done.
New prefab copies work, old copies do not
The copies that were already in the scene use baked lightmaps. Set Receive Global Illumination to Light Probes, see Baked lightmaps.
URP Render Graph Compatibility Mode is on
Turn it off in Project Settings > Graphics > Render Graph. NanoGeo keeps drawing either way, but occlusion culling, the software rasterizer and the visualization modes need Render Graph.
Works in the Editor but not in the build
BatchRendererGroup Variants is not set to Keep All, see Installing.
Objects look pink
Run Tools > NanoGeo > Regenerate Shaders, usually needed after updating HDRP or URP.
Shader errors mention a pipeline you do not use
Run Tools > NanoGeo > Regenerate Shaders.
The visualization shows nothing on HDRP
Check that Custom Pass is enabled in the HDRP asset and in the camera frame settings.
A file in Generated “was serialized with a newer version of Unity”
The Generated folder was copied from a newer Unity. Delete the Generated folder; NanoGeo creates everything again. To share NanoGeo, use Tools > NanoGeo > Export Package.
Video memory use is high
Lower the buffer sizes or set a streaming budget, see Making it faster.
Stripes of self shadowing
Increase the shadow bias on the light, or lower Shadow Error Multiplier.
Limits and tested platforms
Limits
Baking runs only in the Windows Editor. Streaming saves video memory only. Ordinary MeshRenderers do not hide NanoGeo objects. Shadows always use the normal GPU rasterizer. URP Shader Graphs are not converted yet.
Tested platforms
The full test suite passes on Unity 6000.0 (HDRP and URP 17.0), 6000.5 (HDRP and URP 17.5) and 6000.6 (HDRP and URP 17.6), on Direct3D 11 and Direct3D 12, on Windows with an NVIDIA RTX 5070. Unity 6000.1 to 6000.4 were not run; the code was checked against their scripting API. Vulkan and Metal shaders compile but were not run on a device, and Linux and macOS were not tested.
Benchmark
The package includes the tools used to measure NanoGeo. They are optional.
Run it
- Run Tools > NanoGeo > Benchmarks > Generate Benchmark Scene (HDRP). It creates a rock with 1.3 million triangles, comparison LODs and scenes in
Generated/Benchmark. This data is large and can be deleted at any time. - Run Tools > NanoGeo > Benchmarks > Build Benchmark Players (Development). The players are written to
Builds/NanoGeonext to the project. - Start each
NanoGeoBenchmark.exe. It flies through 1 to 500 million triangles at 1080p and 1440p, writesNanoGeoBenchmark.csvand quits.
Results
On an RTX 5070 at 1080p with shadows, 500 million source triangles took 1.73 ms of GPU time per frame with NanoGeo, 3.72 ms with GPU Resident Drawer and LOD Groups, and 161.5 ms with plain MeshRenderers. With one rock of 1.3 million triangles the difference was small (1.57 ms against 1.93 ms). The measured numbers are in Samples/Benchmark/Results.
Expect a large gain in scenes with many millions of triangles and a small one in scenes that already have good LODs.
Baking uses meshoptimizer by Arseny Kapoulkine, under the MIT license. It runs in the Editor only and is not part of your game build.