1 #pragma MSP stage(vertex)
3 uniform sampler2D heightmap;
4 layout(location=0) in vec2 position;
5 layout(location=1) in vec2 texcoord;
8 gl_Position = mvp*vec4(position, texture(heightmap, texcoord).r, 1.0);
12 #pragma MSP stage(fragment)
13 layout(location=0) uniform sampler2D heightmap;
18 frag_color = color*vec4(texture(heightmap, texcoord).rrr, 1.0);
21 /* Expected output: vertex
22 layout(location=1) uniform mat4 mvp;
23 layout(location=0, binding=16) uniform sampler2D heightmap;
24 layout(location=0) in vec2 position;
25 layout(location=1) in vec2 texcoord;
26 layout(location=0) out vec2 _vs_out_texcoord;
29 gl_Position = mvp*vec4(position, texture(heightmap, texcoord).r, 1.0);
30 _vs_out_texcoord = texcoord;
34 /* Expected output: fragment
35 layout(location=0, binding=16) uniform sampler2D heightmap;
36 layout(location=5) uniform vec4 color;
37 layout(location=0) out vec4 frag_color;
38 layout(location=0) in vec2 _vs_out_texcoord;
41 frag_color = color*vec4(texture(heightmap, _vs_out_texcoord).rrr, 1.0);