Skip to content

How to map meshlet triangle indices into meshlet-local indexes? #711

Answered by zeux
JMS55 asked this question in Q&A
Discussion options

You must be logged in to vote

indices in the example above would be suitable to address LDS directly I believe. The 8-bit indices in meshlet data point to meshlet-local vertex data. https://github.com/zeux/niagara/blob/master/src/shaders/meshlet.mesh.glsl may be helpful as an example.

So in your case the TODO would refer to indices.x et al (and indices would probably use ivec3 although maybe the code above magically deduces component types). Note that you would only want triangle corner data for something like culling; if you are not doing triangle level culling then you probably don't need to index LDS data and can just output corrected index data for rasterization.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@zeux
Comment options

@JMS55
Comment options

@zeux
Comment options

Answer selected by JMS55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants