State of the art Culling and Batching techniques in rendering

让人想犯罪 __ 提交于 2019-12-03 00:16:01

There's lots of information about frustum and occlusion culling on the internet. Most of it comes from game developers. Here's a list of some articles that will get you started:

My (pretty fast) renderer works similar to this:

  1. Collection: Send all props, which you want to render, to the renderer.
  2. Frustum culling: The renderer culls the invisible props from the list using multiple threads in parallel.
  3. Occlusion culling: Now you could do occlusion culling on the CPU (I haven't implemented it yet, because I don't need it now). Detailed information on how to do it efficiently can be found in the Killzone and Crysis slides. One solution would be to read back the depth buffer of the previous frame from the GPU and then rasterize the bounding boxes of the objects on top of it to check if the object is visible.
  4. Splitting: Since you now know which objects actually have to be rendered, because they are visible, you have to split them by mesh, because each mesh has a different material or texture (otherwise they would be combined into a single mesh).
  5. Batching: Now you have a list of meshes to render. You can sort them:
    • by depth (this can be done on the prop level instead of the mesh level), to save fillrate (I don't recommend doing this if your fragment shaders are very simple).
    • by mesh (because there might be multiple instances of the same mesh and it would make it easy to add instancing).
    • by texture, because texture switches are very costly.
  6. Rendering: Iterate through your partitioned meshes and render them.

And as "Full Frontal Nudity" already said: There's no perfect solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!