Skip to content

Instantly share code, notes, and snippets.

@vojd
Created October 5, 2018 17:55
Show Gist options
  • Save vojd/cb84f39e0233bbe355b4a7baf159b44e to your computer and use it in GitHub Desktop.
Save vojd/cb84f39e0233bbe355b4a7baf159b44e to your computer and use it in GitHub Desktop.
Pass through Geometry shader
layout (triangles) in;
layout (triangle_strip, max_vertices = 4) out;
/**
* Simple pass-through Geometry Shader
* Assumes vertices are passed in as GL_TRIANGLES
* Change accordingly. If things doesn't work, make sure max_vertices is set to at least the number of vertices you're spitting out
*/
void main() {
for(int i = 0; i < gl_in.length(); i++)
{
gl_Position = gl_in[i].gl_Position;
EmitVertex();
}
EndPrimitive();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment