Geometry Shader input vertices order

Posted by NPS on Game Development See other posts from Game Development or by NPS
Published on 2014-02-09T17:32:52Z Indexed on 2014/06/10 3:45 UTC
Read the original article Hit count: 317

Filed under:
|

MSDN specifies (link) that when using triangleadj type of input to the GS, it should provide me with 6 vertices in specific order: 1st vertex of the triangle processed, vertex of an adjacent triangle, 2nd vertex of the triangle processed, another vertex of an adjacent triangle and so on... So if I wanted to create a pass-through shader (i.e. output the same triangle I got on input and nothing else) I should return vertices 0, 2 and 4. Is that correct?

Well, apparently it isn't because I did just that and when I ran my app the vertices were flickering (like changing positions/disappearing/showing again or sth like that). But when I instead output vertices 0, 1 and 2 the app rendered the mesh correctly.

I could provide some code but it seems like the problem is in the input vertices order, not the code itself.

So what order do input vertices to the GS come in?

© Game Development or respective owner

Related posts about hlsl

Related posts about geometry-shader