1 const int n_lights = 0;
7 uniform LightParams lights[n_lights];
9 uniform mat4 model_matrix;
10 uniform mat4 vp_matrix;
12 #pragma MSP stage(vertex)
13 layout(location=0) in vec4 position;
14 layout(location=1) in vec3 normal;
17 out vec3 world_normal = mat3(model_matrix)*normal;
18 gl_Position = vp_matrix*model_matrix*position;
21 #pragma MSP stage(fragment)
22 layout(location=0) out vec4 frag_color;
26 for(int i=0; i<n_lights; ++i)
27 color += max(dot(normalize(world_normal), lights[i].direction), 0.0)*lights[i].color;
28 frag_color = vec4(color, 1.0);
31 /* Expected output: vertex
32 uniform mat4 model_matrix;
33 uniform mat4 vp_matrix;
34 layout(location=0) in vec4 position;
37 gl_Position = vp_matrix*model_matrix*position;
41 /* Expected output: fragment
43 layout(location=0) out vec4 frag_color;
46 frag_color = vec4(ambient, 1.0);