24 lines
452 B
GLSL
24 lines
452 B
GLSL
#version 100
|
|
|
|
attribute vec2 position;
|
|
attribute float height;
|
|
attribute vec4 material;
|
|
|
|
varying vec2 f_uv;
|
|
varying vec4 f_material;
|
|
varying float f_height;
|
|
|
|
uniform mat4 view;
|
|
uniform mat4 projection;
|
|
uniform vec3 chunk_position;
|
|
|
|
void main ()
|
|
{
|
|
f_uv = position.xy / 4.0;
|
|
f_material = material;
|
|
f_height = height;
|
|
|
|
vec4 pos = vec4 (position.x, height, position.y, 1.0);
|
|
gl_Position = projection * view * (pos + vec4(chunk_position, 0.0));
|
|
}
|