Geometry shader


I’m working on a geometry shader and i’m having problems getting past a runtime error when i use
layout( triangles_adjacency ) in

I’m not seeing the error when i use the following though
layout( triangles ) in

My shader requires the adjacency information so i’m in a bit of a bind.

Any help appreciated.


My complete test shader code is this;


// Input is triangle plus adjacency information
layout( triangles_adjacency ) in;

// Ouput has max 3 vertices
layout( triangle_strip, max_vertices = 3 ) out;

void main() {
// Just pass through to see if anything works
gl_Position = gl_in[0].gl_Position;

gl_Position = gl_in[2].gl_Position;

gl_Position = gl_in[4].gl_Position;



What kind of runtime error are you seeing?

When I tried a simple example with lines_adjacency or triangles_adjacency nothing was drawn, but there were no errors. I think the problem is that the OpenGL draw call needs to use special primitives like GL_LINES_ADJACENCY or GL_TRIANGLES_ADJACENCY, but a quick search through the VTK source doesn’t reveal any adjacency primitives in use.