paysages3d/src/render/opengl/shaders/water.vert

12 lines
340 B
GLSL
Raw Normal View History

2013-12-21 23:41:19 +00:00
attribute highp vec4 vertex;
uniform highp mat4 viewMatrix;
uniform float waterHeight;
uniform vec3 cameraLocation;
varying vec3 unprojected;
void main(void)
{
unprojected = vec3(cameraLocation.x + vertex.x * 500.0, vertex.y + waterHeight, cameraLocation.z + vertex.z * 500.0);
gl_Position = viewMatrix * vec4(unprojected, 1.0);
}