projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add motion vectors to all shaders
[carveJwlIkooP6JGAAIwe30JlM.git]
/
shaders
/
water.fs
diff --git
a/shaders/water.fs
b/shaders/water.fs
index 938c6d1e04d04493226bdaa895d8bdf8a3990322..eced89aef82cb4e6eedc85f305bda45374a11202 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;
@@
-19,6
+17,7
@@
in vec3 aCo;
in vec3 aWorldCo;
#include "common_world.glsl"
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 )
vec4 water_surf( vec3 halfview, vec3 vnorm, float depthvalue,
vec4 beneath, vec4 above )
@@
-43,6
+42,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;
@@
-74,5
+75,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 );
}
}