projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
run to skate animation
[carveJwlIkooP6JGAAIwe30JlM.git]
/
shaders
/
water.fs
diff --git
a/shaders/water.fs
b/shaders/water.fs
index 0be43893cb803fea710a7c86a7f689f5b4c7163c..68fc66da863796327914985805df75c1ea1eac89 100644
(file)
--- a/
shaders/water.fs
+++ b/
shaders/water.fs
@@
-1,5
+1,3
@@
-out vec4 FragColor;
-
uniform sampler2D uTexMain;
uniform sampler2D uTexDudv;
uniform sampler2D uTexBack;
uniform sampler2D uTexMain;
uniform sampler2D uTexDudv;
uniform sampler2D uTexBack;
@@
-8,20
+6,25
@@
uniform vec2 uInvRes;
uniform float uTime;
uniform vec3 uCamera;
uniform float uSurfaceY;
uniform float uTime;
uniform vec3 uCamera;
uniform float uSurfaceY;
+uniform vec3 uBoard0;
+uniform vec3 uBoard1;
+
+uniform vec3 uShoreColour;
+uniform vec3 uOceanColour;
in vec4 aColour;
in vec2 aUv;
in vec3 aNorm;
in vec3 aCo;
in vec4 aColour;
in vec2 aUv;
in vec3 aNorm;
in vec3 aCo;
+in vec3 aWorldCo;
#include "common_world.glsl"
#include "common_world.glsl"
+#include "motion_vectors_fs.glsl"
vec4 water_surf( vec3 halfview, vec3 vnorm, float depthvalue,
vec4 beneath, vec4 above )
{
vec4 water_surf( vec3 halfview, vec3 vnorm, float depthvalue,
vec4 beneath, vec4 above )
{
- vec3 colour_shore = vec3( 0.21, 0.6, 0.8 );
- vec3 colour_ocean = vec3( 0.01, 0.1, 0.2 );
- vec3 surface_tint = mix(colour_shore, colour_ocean, depthvalue);
+ vec3 surface_tint = mix(uShoreColour, uOceanColour, depthvalue);
float ffresnel = pow(1.0-dot( vnorm, halfview ),5.0);
float ffresnel = pow(1.0-dot( vnorm, halfview ),5.0);
@@
-41,6
+44,8
@@
vec4 water_surf( vec3 halfview, vec3 vnorm, float depthvalue,
void main()
{
void main()
{
+ compute_motion_vectors();
+
// Create texture coords
vec2 ssuv = gl_FragCoord.xy*uInvRes;
// Create texture coords
vec2 ssuv = gl_FragCoord.xy*uInvRes;
@@
-72,5
+77,5
@@
void main()
// Composite
vec4 vsurface = water_surf( halfview, surfnorm, depthvalue, beneath, above );
vsurface.a -= fdist;
// Composite
vec4 vsurface = water_surf( halfview, surfnorm, depthvalue, beneath, above );
vsurface.a -= fdist;
-
FragColo
r = mix( vsurface, vec4(1.0,1.0,1.0,0.5), fband );
+
oColou
r = mix( vsurface, vec4(1.0,1.0,1.0,0.5), fband );
}
}