- Frustum culling is done by three out of the box (as long as each mesh has it’s own separate geometry.)
- Merging geometries prevents frustum culling, so merge only geometries that are most of the time smaller than the size of the viewport (ex. do not merge terrain into a single, giant mesh.)
- Take a look at LOD.
- Take a look at InstancedMeshes (if a lot of meshes in the scene use the same geometry + material combination, group them together into an InstacedMesh. That way you can still have plenty of these meshes on the screen, but they all cost just a single draw call.)
- For raycasting - consider building a spatial index (ie. “regions” / bigger groups in 3D space), and only raycast against the meshes within the closest spatial regions.
- Simply don’t render stuff that is too far away to be visible / readable to the user.
2 Likes