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;
34 /* Expected output: vertex
35 layout(set=0, binding=24) uniform Transform
40 layout(location=0) in vec4 position;
41 layout(location=1) in vec3 normal;
42 layout(location=2) in vec2 texcoord;
43 layout(location=0) out vec2 _vs_out_texcoord;
44 layout(location=1) out vec3 world_normal;
47 _vs_out_texcoord = texcoord;
48 mat4 _temp = model_matrix;
49 world_normal = mat3(_temp[0].xyz, _temp[1].xyz, _temp[2].xyz)*normal;
50 gl_Position = vp_matrix*model_matrix*position;
54 /* Expected output: fragment
55 layout(set=0, binding=71) uniform sampler2D tex;
56 layout(set=0, binding=65) uniform Lighting
61 layout(location=0) out vec4 frag_color;
62 layout(location=0) in vec2 _vs_out_texcoord;
63 layout(location=1) in vec3 world_normal;
66 frag_color = texture(tex, _vs_out_texcoord);
67 frag_color.rgb *= max(dot(normalize(world_normal), light_dir), 0.0)*light_color;