13 uniform mat4 model_matrix;
14 uniform sampler2DShadow shadow_map;
16 #pragma MSP stage(vertex)
17 layout(location=0) in vec4 position;
20 out vec4 world_position = model_matrix*position;
21 gl_Position = viewproj_matrix*world_position;
24 #pragma MSP stage(fragment)
25 layout(location=0) out vec4 frag_out;
28 vec3 shadow_coord = (shadow_matrix*world_position).xyz;
29 if(shadow_coord.x>=0 && shadow_coord.x<=1 && shadow_coord.y>=0 && shadow_coord.y<=1)
30 return texture(shadow_map, shadow_coord);
36 frag_out = vec4(color.rgb*get_shadow(), color.a);
39 /* Expected output: vertex
40 layout(binding=72) uniform Camera
44 layout(location=0) uniform mat4 model_matrix;
45 layout(location=0) in vec4 position;
46 layout(location=0) out vec4 world_position;
49 world_position = model_matrix*position;
50 gl_Position = viewproj_matrix*world_position;
54 /* Expected output: fragment
55 layout(binding=71) uniform Shadow
59 layout(binding=77) uniform Surface
63 layout(location=4, binding=73) uniform sampler2DShadow shadow_map;
64 layout(location=0) out vec4 frag_out;
65 layout(location=0) in vec4 world_position;
68 vec3 shadow_coord = (shadow_matrix*world_position).xyz;
69 if(shadow_coord.x>=0.0&&shadow_coord.x<=1.0&&shadow_coord.y>=0.0&&shadow_coord.y<=1.0)
70 return texture(shadow_map, shadow_coord);
76 frag_out = vec4(color.rgb*get_shadow(), color.a);