stuff
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / water.vs
1 #include "vertex_standard.glsl"
2
3 uniform mat4 uPv;
4 uniform mat4x3 uMdl;
5 uniform vec4 uDepthBounds;
6
7 out vec4 aUv;
8 out vec3 aCo;
9 out float aDepth;
10
11 void main()
12 {
13 vec3 world_pos = uMdl * vec4( a_co, 1.0 );
14 gl_Position = uPv * vec4(world_pos,1.0);
15
16 vec2 depth_coords = (world_pos.xz-uDepthBounds.xy)*uDepthBounds.zw;
17 aUv = vec4(world_pos.xz*0.01,depth_coords);
18 aCo = world_pos;
19
20 aDepth = gl_Position.z;
21 }