Created
October 5, 2018 17:55
-
-
Save vojd/cb84f39e0233bbe355b4a7baf159b44e to your computer and use it in GitHub Desktop.
Pass through Geometry shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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