]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/nested_member_access.glsl
Normalize vertex normal and tangent vectors in vertex shader
[libs/gl.git] / tests / glsl / nested_member_access.glsl
1 uniform Lighting
2 {
3         vec3 light_color[4];
4 };
5 uniform Params
6 {
7         int light_index;
8 };
9
10 #pragma MSP stage(vertex)
11 layout(location=0) in vec4 position;
12 void main()
13 {
14         gl_Position = position;
15 }
16
17 #pragma MSP stage(fragment)
18 layout(location=0) out vec4 frag_color;
19 void main()
20 {
21         frag_color = vec4(light_color[light_index], 1.0);
22 }
23
24 /* Expected output: vertex
25 layout(location=0) in vec4 position;
26 void main()
27 {
28         gl_Position = position;
29 }
30 */
31
32 /* Expected output: fragment
33 layout(binding=5) uniform Lighting
34 {
35         vec3 light_color[4];
36 };
37 layout(binding=80) uniform Params
38 {
39         int light_index;
40 };
41 layout(location=0) out vec4 frag_color;
42 void main()
43 {
44         frag_color = vec4(light_color[light_index], 1.0);
45 }
46 */