10 const bool use_light = false;
12 #pragma MSP stage(vertex)
13 layout(location=0) in vec4 vertex;
14 layout(location=1) in vec3 normal;
15 out vec3 world_light_dir[2];
18 vec4 world_vertex = model*vertex;
19 out vec3 world_normal = mat3(model)*normal;
20 gl_Position = vp*world_vertex;
21 for(int i=0; i<2; ++i)
22 world_light_dir[i] = light_dir[i].xyz-world_vertex.xyz*light_dir[i].w;
25 #pragma MSP stage(fragment)
26 layout(location=0) out vec4 frag_color;
29 vec3 color = vec3(0.1);
32 for(int i=0; i<2; ++i)
34 float intensity = max(dot(normalize(world_normal), world_light_dir[i]), 0.0);
38 frag_color = vec4(color, 1.0);
41 /* Expected output: vertex
42 layout(binding=48) uniform Transform
47 layout(location=0) in vec4 vertex;
50 gl_Position = vp*model*vertex;
54 /* Expected output: fragment
55 layout(location=0) out vec4 frag_color;
58 frag_color = vec4(vec3(0.1), 1.0);