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);
23 /* Expected output: vertex
24 layout(location=1) uniform mat4 mvp;
25 layout(location=0, binding=16) uniform sampler2D heightmap;
26 layout(location=0) in vec2 position;
27 layout(location=1) in vec2 texcoord;
28 layout(location=0) out vec2 _vs_out_texcoord;
31 gl_Position = mvp*vec4(position, texture(heightmap, texcoord).r, 1.0);
32 _vs_out_texcoord = texcoord;
33 gl_Position.z = gl_Position.z*2.0-gl_Position.w;
37 /* Expected output: fragment
38 layout(location=0, binding=16) uniform sampler2D heightmap;
39 layout(location=5) uniform vec4 color;
40 layout(location=0) out vec4 frag_color;
41 layout(location=0) in vec2 _vs_out_texcoord;
44 frag_color = color*vec4(texture(heightmap, _vs_out_texcoord).rrr, 1.0);