3dexperiments/assets/shaders/water.vs

19 lines
449 B
Plaintext
Raw Normal View History

precision mediump float;
attribute vec2 aVertexPosition;
uniform mat4 uModelMatrix;
uniform mat4 uViewMatrix;
uniform mat4 uProjectionMatrix;
varying vec4 clipSpace;
varying vec2 uv;
const float tiling = 6.0;
void main() {
clipSpace = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(aVertexPosition.x, 0.0, aVertexPosition.y, 1.0);
gl_Position = clipSpace;
uv = vec2(aVertexPosition.x/2.0+0.5,aVertexPosition.y/2.0+0.5) * tiling;
}