Untitled
Loading...
Searching...
No Matches
point_light_shadows.geom
Go to the documentation of this file.
1
2#version 330 core
3layout (triangles) in;
4layout (triangle_strip, max_vertices=18) out;
5
6
7
8uniform mat4 vp[6];
9uniform uint uLayerOffset;
10
11out vec3 FragWorldPos;
12flat out uint vMat;
13out vec2 vUV;
14in VS_OUT
15{
16 uint Mat;
17 vec2 UV;
18
19} gs_in[];
20
21void main()
22{
23
24 for (int i = 0; i < 6; ++i)
25 {
26 gl_Layer = int(uLayerOffset) + i;
27 for (int j = 0; j < 3; ++j)
28 {
29 vec4 pos = gl_in[j].gl_Position;
30 gl_Position = vp[i] * pos;
31 FragWorldPos = pos.xyz;
32 vUV = gs_in[0].UV;
33 vMat = gs_in[0].Mat;
34 EmitVertex();
35
36 }
37
38 EndPrimitive();
39 }
40
41
42}
43
44