Documentation
Get started
Requirements, installation and your first object: set up NanoGeo, the virtualized geometry system for Unity 6 with HDRP or URP.
Overview
What NanoGeo does
Normally, a mesh with a few million triangles is too heavy for a game, so you make several cheaper copies of it (LODs) and swap between them by distance. NanoGeo takes that job off your hands. You put your high detail mesh in the scene as it is, and NanoGeo makes sure the GPU only spends time on what you can actually see.
It works in two steps. First comes a one time step called baking: NanoGeo cuts the mesh into small pieces of up to 128 triangles and prepares simpler versions of each piece. Then, while the game runs, the GPU picks the simplest version of every piece that still looks identical on screen, skips pieces that are off screen or hidden behind other NanoGeo objects, and draws the rest.
So the cost depends on how much of the screen an object covers, not on how many triangles it has.
It stays out of your way
Your objects stay normal GameObjects with a MeshFilter, a MeshRenderer and your own materials. Lighting, shadows, decals, SSAO, motion vectors and post processing keep working.
If NanoGeo cannot draw an object for some reason, that object simply keeps using its MeshRenderer, and the Inspector tells you why. Nothing breaks.
Requirements
Unity and render pipeline
You need Unity 6 (6000.0.84f1 or newer) with HDRP 17 or URP 17. The Built-in Render Pipeline is not supported.
On URP, leave Render Graph turned on, which it is by default. In Unity 6000.0 to 6000.2 you can still switch on Compatibility Mode, which disables Render Graph. NanoGeo will still draw everything then, but occlusion culling, the software rasterizer and the visualization modes stop working, and the NanoGeo window shows a warning. From Unity 6000.3 Render Graph is always on, so this never comes up.
Graphics cards
What NanoGeo can do depends on the graphics card, and every card falls into one of three groups:
- Full
- Direct3D 12 or Vulkan on a recent GPU. Everything works.
- Hardware only
- Direct3D 11 and Metal. Everything works except the software rasterizer, which is a speed up for very small triangles.
- Fallback
- The device cannot run NanoGeo at all. Every object is simply drawn by its MeshRenderer, as if NanoGeo was not there.
A tip: new projects made with Unity 6000.0 use Direct3D 11 by default, while projects from 6000.1 on use Direct3D 12. If you want to be in the Full group, check Project Settings > Player > Other Settings > Graphics APIs for Windows.
Baking
Baking only runs in the Windows Editor (64 bit). That is not a limit for your game: builds for other platforms can use data baked on Windows.
The mesh also needs Read/Write enabled in its import settings, so the Editor can read it while baking. You do not have to do this by hand, because NanoGeo can turn it on for you (see Many objects at once).
Desktop
Desktop is where NanoGeo runs best. On a Windows PC with a recent GPU and Direct3D 12 or Vulkan, you are in the Full group: everything works, including occlusion culling, the software rasterizer and the visualization modes.
It is also the platform we test on: Windows with Direct3D 11 and Direct3D 12 (see Limits and tested platforms).
Phones and tablets
Use URP, since HDRP does not run on mobile, with Vulkan on Android and Metal on iOS. Mobile devices always count as Hardware only, so the software rasterizer is off, and NanoGeo uses smaller GPU buffers to save memory.
Android devices that only have OpenGL ES fall back. So does a GPU that can read fewer than 8 storage buffers in a vertex shader, or use fewer than 16 in a compute shader. If that happens, the Console tells you why.
VR
NanoGeo works with Unity’s XR system. On PC VR (for example OpenXR with Direct3D 11, Direct3D 12 or Vulkan) it supports Single Pass Instanced and Multi Pass, on both URP and HDRP. On Meta Quest and other Android headsets, use URP with Vulkan. Single Pass there uses multiview, which NanoGeo supports too.
For the headset camera, both eyes share one culling pass and one level of detail choice. Occlusion culling, the software rasterizer and the visualization modes are turned off for that camera, while other cameras keep them. A Quest has a phone class GPU, so always check the frame rate on the device.
Installing
Import the package
- Import the package into your project. Everything lives in
Assets/RoamMoon/NanoGeoForUnity, so do not move files out of that folder. - Wait for Unity to finish importing. During this, NanoGeo creates its settings and makes NanoGeo versions of the HDRP and URP Lit shaders for the pipeline versions you have installed.
- Open Window > Analysis > NanoGeo Visualization. If you see a warning about BatchRendererGroup Variants, press Fix. Your game builds need this setting. NanoGeo never changes it unless you press the button.
HDRP and URP
On HDRP, Custom Pass has to be enabled in the HDRP asset and in the camera frame settings. It is on by default, so you usually do not need to touch anything. On URP there is nothing to change.
If you update HDRP or URP later, run Tools > NanoGeo > Regenerate Shaders once, so NanoGeo rebuilds its shaders for the new version.
Your first object
Add the component
- Select an object that has a MeshFilter and a MeshRenderer. Its material should be HDRP Lit, URP Lit or an HDRP Shader Graph. If the object is part of a LOD Group, select the LOD0 object.
- Click Add Component and add
NanoGeoMesh. - Wait a few seconds while the mesh is baked. A mesh with one million triangles takes about four seconds on a fast desktop CPU.
- When the Inspector says “Rendered by NanoGeo”, you are done.
Materials and going back
Your material and MeshRenderer stay on the object. NanoGeo makes its own copy of the material and keeps it up to date. If you edit the material and a NanoGeo object does not show the change yet, turn the object off and on again, or press Play.
To draw an object with its MeshRenderer again, tick Force Fallback on the component, or remove the component.
Baking uses meshoptimizer by Arseny Kapoulkine, under the MIT license. It runs in the Editor only and is not part of your game build.