]> git.tdb.fi Git - libs/gl.git/blob - shaderlib/cubemap_effect.glsl
Add an asynchronous version of Texture2D::sub_image
[libs/gl.git] / shaderlib / cubemap_effect.glsl
1 uniform CubeParams
2 {
3         mat3 faces[6];
4 };
5
6 #pragma MSP stage(vertex)
7 layout(location=0) in vec4 vertex;
8 void main()
9 {
10         gl_Position = vertex;
11 }
12
13 #pragma MSP stage(geometry)
14 layout(triangles) in;
15 layout(triangle_strip, max_vertices=18) out;
16 void main()
17 {
18         for(int i=0; i<6; ++i)
19         {
20                 for(int j=0; j<3; ++j)
21                 {
22                         gl_Layer = i;
23                         gl_Position = gl_in[j].gl_Position;
24                         out vec3 texcoord = faces[i]*vec3(gl_in[j].gl_Position.xy, 1.0);
25                         EmitVertex();
26                 }
27                 EndPrimitive();
28         }
29 }