Advertisement

Rendering Voxel terrain

Started by December 31, 2021 02:40 AM
1 comment, last by hplus0603 2 years, 10 months ago

I have terrain, it's generated in small patches so I am confused how I am suppose to manage it, note this is independent project, so I don't have requirements

Should I Merge them into one big buffer?

1- Add concat the vertex buffer to the end of the main buffer and fix the corresponding index buffer

2- Merge the Vertex buffer into the main buffer and recalculate the index buffer

I think this will be useful if I need to calculate it one time them save to file then render that file

3- Render each patch separately

The reason to use fewer, larger, buffers, is to reduce the number of “draw calls” issued to the GPU. The reason for this is that each “draw call” has overhead for error checking and shader setup in the API.

If you are not CPU limited on processing too many “draw calls” then there's no real gain in merging multiple terrain chunks together. Similarly, if you use a fully indirect API, such as D3D12 with render lists, then the number of “draw calls” could be essentially one, even though you have many chunks to draw.

So, set a budget for how many draw calls you can afford per subsystem (totally random example: 500 for terrain, 2000 for objects and foliage, 500 for player avatars, 2000 for GUI, 2000 for VFX) and then design your buffer management to fit within that budget.

enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement