Voxel terrain generation optimization

Chunking is used as optimization in voxel terrain generation to not render hidden part of the terrain by dividing the terrain into chunk and make it a single mesh.

Instanced rendering is used in polygon rendering to reduce binding and unbinding before every draw call for the same entity,but with different properties/transformation.

To achieve both it’s purpose,isn’t it better to combine both method of optimization(instancing and culling)??

This post another question,what’s the difference between culling and chunking???

I also heard that culling can sometimes destroy performance instead of improving it because it may take longer time than rendering the object itself.Is it true??
If so,what should I do??

No. You don’t need instancing to reduce binding between chunks. Just put all your chunks in the same buffer object, and make all your textures available to any of your chunks. Then there’s no binding between chunks; you just have a series of draw calls. Or just one multi-draw call.

Culling of what? “Culling” is an overloaded term in graphics that can refer to many different things, so you’ll have to clarify exactly what you’re talking about. The same goes for your “can sometimes destroy performance” notion.

I mean like I have three choice to optimize my terrain generation:
1)Not sending unseen blocks in the game to be rendered.(frustum culling,backface culling,occlusion culling)
2)Making a few block as one mesh/chunk(chunking)
3)implement batch/instanced rendering to render entity by entity.For example,I want to render a human at the leftmost side of the screen,followed by a animal,then a human again,then a animal,but instead I render both human first,then only render both animal.(instancing)
Which one should I use??
Or should I combine 1 and 3??

If I understand what you mean, then yes. You should apply both. The art is in balancing these to obtain the best performance.

And just to clarify, by instancing, you’re just talking about one specific form of batching. So this is really a “batching” vs. “culling” question.

Take either one to the extreme, and you often end up with poor results (**). For the most accurate culling, do no batching. Then you can cull every triangle separately, but throughput is low. For the best batching, just render the entire world in a single draw call (no matter whether it’s in-frustum or not, no matter whether it’s occluded or not). Your GPU is busy now, but much of the work is totally discarded, leaving net “useful” throughput relatively low here too.

The optimum performance often lies in the middle. Prefer batching in ways that don’t completely thwart sensible culling, and culling in ways that don’t thwart reasonable batching. Tune batch sizes based on observed performance.

** NOTE: I’m talking here about non-trivial scenes where you can’t just pass the entire world of objects down the pipeline every frame and obtain reasonable performance.

Yes. Tune the balance between batching vs. culling based on observed performance. It’s an optimization problem where you’re trying find a local minimum.

Always keep in mind though that with other batching vs. culling tech approaches, you might be able to find a local minimum that’s even lower than the one you’d found before. Example: CPU culling vs. GPU culling. So shake things up a bit every once in a while to see if you can do better. Rinse/repeat until fast enough. And then stop.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.