13 #pragma MSP stage(vertex)
14 layout(location=0) in vec4 position;
15 layout(location=1) in vec3 normal;
16 layout(location=2) in vec2 texcoord;
20 out vec3 world_normal = mat3(model_matrix)*normal;
21 gl_Position = vp_matrix*model_matrix*position;
24 #pragma MSP stage(fragment)
25 layout(location=0) out vec4 frag_color;
28 frag_color = texture(tex, texcoord);
29 frag_color.rgb *= max(dot(normalize(world_normal), light_dir), 0.0)*light_color;
32 /* Expected output: vertex
33 layout(binding=48) uniform Transform
38 layout(location=0) in vec4 position;
39 layout(location=1) in vec3 normal;
40 layout(location=2) in vec2 texcoord;
41 layout(location=0) out vec2 _vs_out_texcoord;
42 layout(location=1) out vec3 world_normal;
45 _vs_out_texcoord = texcoord;
46 mat4 _temp = model_matrix;
47 world_normal = mat3(_temp[0].xyz, _temp[1].xyz, _temp[2].xyz)*normal;
48 gl_Position = vp_matrix*model_matrix*position;
52 /* Expected output: fragment
53 layout(location=0, binding=71) uniform sampler2D tex;
54 layout(binding=5) uniform Lighting
59 layout(location=0) out vec4 frag_color;
60 layout(location=0) in vec2 _vs_out_texcoord;
61 layout(location=1) in vec3 world_normal;
64 frag_color = texture(tex, _vs_out_texcoord);
65 frag_color.rgb *= max(dot(normalize(world_normal), light_dir), 0.0)*light_color;