Nabla icon indicating copy to clipboard operation
Nabla copied to clipboard

Triangle Culling and Index Buffer rebuilding

Open devshgraphicsprogramming opened this issue 4 years ago • 0 comments

Description

If we cull individual triangles, we end up with the problem of instancing not being available anymore (and the pretransform cache).

However we could reorder triangles such that their vertices are processed instance-minor, primitive-major which is the reverse of hardware instancing, which would actually bring about higher cache hits in vertex shader (but probably worse tiler coherency).

Solution proposal

Go through DICE Dragon Age Inquistion, The Forge VisBuffer, DOOM Eternal and Nanite presentations to come up with something more useful for cluster/meshlet culling than plain AABB (cone orientation).

Then add a stage for triangle culling (frustum, subpixel misaligned, backface and cone orientation?, occlusion HiZ) that actually improves performance.

Lets see if we can push 42.6M instances on some modest 6GB GPU.

Additional context

Must be performed AFTER #252

Maybe add an option for a single index buffer draw of deinstanced culled triangles a-la DOOM Eternal. (probably works nicer with occupancy, pipeline bubbles and stuff across all platforms, than even compacted MDI)

Needs programmable pulling of all vertex data though.