mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
25 lines
536 B
Text
25 lines
536 B
Text
|
#version 330 core
|
||
|
layout (triangles) in;
|
||
|
layout (line_strip, max_vertices = 6) out;
|
||
|
|
||
|
in VS_OUT {
|
||
|
vec3 normal;
|
||
|
} gs_in[];
|
||
|
|
||
|
uniform float normalsLength;
|
||
|
|
||
|
void GenerateLine(int index)
|
||
|
{
|
||
|
gl_Position = gl_in[index].gl_Position;
|
||
|
EmitVertex();
|
||
|
gl_Position = gl_in[index].gl_Position + vec4(gs_in[index].normal, 0.0) * normalsLength;
|
||
|
EmitVertex();
|
||
|
EndPrimitive();
|
||
|
}
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
GenerateLine(0); // first vertex normal
|
||
|
GenerateLine(1); // second vertex normal
|
||
|
GenerateLine(2); // third vertex normal
|
||
|
}
|