I have a custom procedural terrain generator, and I’m debating with myself what would be the best approach to scatter rocks around the terrain.
The requirements:
- Object count: 100K +
- Colliders are needed
- Control rotation on all axis (so the terrain system trees prototypes are not an option)
- With LODs
- No need for light probes or light baking
- Cast and receive shadows
Option 1:
I thought about instantiating prefabs with the colliders and a script that holds the information, and then using a manager to use GPU instancing with Graphics.DrawProcedural
, with a compute shader to handle the camera culling, and in it also decide which object(rock) should have an active collider, and which LOD to choose.
The objects will not have a mesh renderer or a mesh filter, but just a reference to the object different LODs
Option 2:
Instantiating the object and use StaticBatchingUtility
, handling the activation of the colliders, the same way like option 1, letting unity handle the culling and LODs
Does anyone knows of any pitfalls I might encounter with this options?
Any other option that might be better ?
An asset store tool that can make handle this ?