- Home /
Adjacency information in geometry shaders
Hello,
I'm trying to play around with geometry shaders in Unity and I ran into one question that I can't find an answer to:
is there a way to pass/get adjacency information in a geometry shader in Unity? If there is, then how?
I tried using "triangleadj" (with six vertices) as the input type of the geometry shader program, but it seems that there are still only three vertices (instead of six) that are passed to the shader. So, is there a way to make Unity pass the adjacent vertices to the geometry shader? Or if it doesn't keep them in its internal mesh structure, is it possible to pass them manually?
Any help would be greatly appreciated. Thanks in advance.
hi,
is it still true in Unity 5? seems to be... any solution?
06.2017 unity 5.6. Triangleadj still doesn't work. WTF?
Answer by cmberryau · Jul 22, 2014 at 12:04 PM
Apparently not, Aras made a post in 2013 saying that it is not available currently.
Still, in 2014 it seems to be the case, I cannot get lineadj to work.
Yep, lineadj doesn' work, index 0 and 1 are the same as using line, 2 and 3 are just zero.
Answer by Henning-Hommel · Jul 07, 2015 at 12:12 PM
I ran into the same problem with getting the adjecency information, and reading cmberryau's answer I have little hope of this getting fixed anytime soon. In my opinion this is really sad and narrows down our posiibilities of creating useful geometry shaders in unity by quite a bit.
In addition I have found out that when using the "triangleadj" type the indices of the vertices are not matching the indices declared at the msdn page for the direct3d pipeline. So instead of the vertices 0, 2 and 4 making up the main triangle in Unity they have the indices 0, 1 and 2. I guess this is a direct effect of the missing adjacency information.
Answer by The-White-Guardian · Apr 23, 2021 at 02:51 PM
2021, still not working. Lineadj was introduced as part of shader model 4.0, IE DirectX 10, released in June of 2007. It's been fourteen years.
Another feature that was given a botched implementation, that shows zero signs of ever being looked to, and that we'll now have to somehow implement on our own. At this point I'm regretting choosing Unity. :/