summaryrefslogtreecommitdiff
path: root/advanced_lighting/6.hdr/shaders/normals_debug.geom
blob: bdbc1b3db90755d743b725292dc8d57f3af77d66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#version 330 core
layout(triangles) in;
layout(line_strip, max_vertices=6) out;

in VS_OUT {
	vec4 normal;
} gs_in[];

out vec3 vcolor;

uniform mat4 proj;

void gen_normals(int index)
{
	vcolor = vec3(0.0, 1.0, 0.0);
	gl_Position = proj*(gl_in[index].gl_Position);
	EmitVertex();
	gl_Position = proj*(gl_in[index].gl_Position+0.5*gs_in[index].normal);
	EmitVertex();
	EndPrimitive();
}

void main(void)
{
	gen_normals(0);
	gen_normals(1);
	gen_normals(2);
}