X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fwater.fs;h=68fc66da863796327914985805df75c1ea1eac89;hb=b1557496a922904b7abcd47d5a59a6da44d70fe8;hp=938c6d1e04d04493226bdaa895d8bdf8a3990322;hpb=1f0e3292c021e8263716e5f4544a1efcedf3f03d;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/water.fs b/shaders/water.fs index 938c6d1..68fc66d 100644 --- a/shaders/water.fs +++ b/shaders/water.fs @@ -1,5 +1,3 @@ -out vec4 FragColor; - uniform sampler2D uTexMain; uniform sampler2D uTexDudv; uniform sampler2D uTexBack; @@ -8,6 +6,8 @@ uniform vec2 uInvRes; uniform float uTime; uniform vec3 uCamera; uniform float uSurfaceY; +uniform vec3 uBoard0; +uniform vec3 uBoard1; uniform vec3 uShoreColour; uniform vec3 uOceanColour; @@ -19,6 +19,7 @@ in vec3 aCo; in vec3 aWorldCo; #include "common_world.glsl" +#include "motion_vectors_fs.glsl" vec4 water_surf( vec3 halfview, vec3 vnorm, float depthvalue, vec4 beneath, vec4 above ) @@ -43,6 +44,8 @@ vec4 water_surf( vec3 halfview, vec3 vnorm, float depthvalue, void main() { + compute_motion_vectors(); + // Create texture coords vec2 ssuv = gl_FragCoord.xy*uInvRes; @@ -74,5 +77,5 @@ void main() // Composite vec4 vsurface = water_surf( halfview, surfnorm, depthvalue, beneath, above ); vsurface.a -= fdist; - FragColor = mix( vsurface, vec4(1.0,1.0,1.0,0.5), fband ); + oColour = mix( vsurface, vec4(1.0,1.0,1.0,0.5), fband ); }