I wondering if we can use other geometry input than point and triangle.
In my case, I try to implementate a technic that I read in order to extrude vertices depending on the silhouette. It has to use GL_TRIANGLES_ADJACENCY, in order to determine the normal of adjacent faces. I tried with several different semantics but it has been a failed each time.
If anyone could give me a clue, I thank you in advance.
I searched a lot on internet, but it seems that there are not a lot of informations about geometry shaders used on unity.
Here is my last try (Shader warning in ‘Custom/Billboard’: Program ‘VS_Main’, unrecognized identifier ‘triangles_adjacency’ (compiling for d3d11) at line 35):
Thank you for your fast answer, it’s very interesting, because since I started to program shaders on unity, I’ve always believed that the #CG shaders in unity was based more on CgFX than HLSL, although in all cases, it’s still very different from the two.
I’ll try what you suggested tonight and I’ll let you updated about the result
I investigate tonight about what RC-1290 wrote, but I’m deceipt because after debbugging, the triangleadj seems to feed data only in the vertices 0, 1 and 2. The other vertices are just 0; therefore, it doesn’t send adjacency information.
Here is my shader code to verify what I say, and I attached a screen shot of the result (vertices 0, 2 and 4 should be the main triangle of the triangleadj):
Thanks RC-1290. I’ll investigate for a way to build myself the data, it’s a bit sad because it’ll take a bit of process while it shouldn’t because it could be taken in charge by the pipeline. However, it shouldn’t be so difficult to build my own data by using a script C#.
I guess that it’ll be one of improvements for the next versions, but in the mean time, the Geometry Shaders aren’t yet assumed as a default feature on all graphic cards and all different supports as cell phones, therefore, I guess that it’s not a priority.
Yeah, I believe they’re still looking for a way to make these ‘new’ features work on both DirectX and OpenGL using the same shader, because most solutions really only handle DX9-level stuff. Aras recently posted another blog post about this.