X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fwater.vs;h=c8ac51bcefa266db568a8c12b23ad7895c2bdf1a;hb=dfee9022b3513fddec36f7ea70867ee5961a44da;hp=3d6372c57f76f4000bf8fc8811e68160f06d71a4;hpb=afa80c76d03f5e983092e9d7be33a9102a7ab25e;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/water.vs b/shaders/water.vs index 3d6372c..c8ac51b 100644 --- a/shaders/water.vs +++ b/shaders/water.vs @@ -6,6 +6,7 @@ uniform vec4 uDepthBounds; out vec4 aUv; out vec3 aCo; +out float aDepth; void main() { @@ -13,6 +14,8 @@ void main() gl_Position = uPv * vec4(world_pos,1.0); vec2 depth_coords = (world_pos.xz-uDepthBounds.xy)*uDepthBounds.zw; - aUv = vec4(world_pos.xz*0.1,depth_coords); + aUv = vec4(world_pos.xz*0.01,depth_coords); aCo = world_pos; + + aDepth = gl_Position.z; }