Making efficeint voxel engines using "chunks"
- by Wardy
Concept
I'm currently looking in to how voxel engines work with a view to possibly making one myself.
I see a lot of stuff like this ...
https://sites.google.com/site/letsmakeavoxelengine/home/chunks
... which talks about how to go about reducing the draw calls.
What I can't seem to understand is how it actually saves draw call counts on the basis of the logic being something like this ...
Without chunks
foreach voxel in myvoxels
DrawIfVisible()
With Chunks
foreach chunk in mychunks
DrawIfVisible()
which then does ...
foreach voxel in myvoxels
DrawIfVisible()
So surely you saved nothing ?!?!
You still make a draw call for each visible voxel do you not?
A visible voxel needs a draw call in either scenario.
The only real saving I can see is that the logic that evaluates a chunk will be able to determine if a large number of voxels are visible or not effectively saving a bit of "is this chunk visible" cpu time.
But it's the draw calls that interest me ...
The fewer of those, the faster the application.
EDIT:
In case it makes any difference I will probably be using XNA (DX not OpenGL) for my engine so don't consider my choice of example in the link above my choice of technology.
But this question is such that I doubt it would matter.