stk-code_catmod/data/shaders/normal_visualizer.geom

22 lines
459 B
Plaintext
Raw Normal View History

layout(triangles) in;
layout(line_strip, max_vertices = 6) out;
in vec3 nor[];
void main()
{
for(int i=0; i < gl_in.length(); i++)
{
vec4 pos = gl_in[i].gl_Position;
gl_Position = pos;
EmitVertex();
vec3 normal = nor[i];
2014-08-09 15:19:26 -04:00
pos = inverse(ProjectionMatrix) * pos;
pos /= pos.w;
gl_Position = ProjectionMatrix * (pos + .2 * vec4(normal, 0.));
EmitVertex();
EndPrimitive();
}
}