projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update helpers/location to 'frosted' ui
[carveJwlIkooP6JGAAIwe30JlM.git]
/
shaders
/
scene_depth.fs
diff --git
a/shaders/scene_depth.fs
b/shaders/scene_depth.fs
index a2b7642c2df612c6285a630d360254793c1aa303..d805441c70a0a1fb0d0776d0376e4104048282ed 100644
(file)
--- a/
shaders/scene_depth.fs
+++ b/
shaders/scene_depth.fs
@@
-4,12
+4,7
@@
uniform vec3 uCamera;
uniform vec3 uBoard0;
uniform vec3 uBoard1;
uniform vec3 uBoard0;
uniform vec3 uBoard1;
-in vec2 aUv;
-in vec4 aNorm;
-in vec3 aCo;
-in vec3 aWorldCo;
-flat in ivec4 aLights;
-
+#include "light_clearskies_stddef.glsl"
#include "common_scene.glsl"
// Water blending
#include "common_scene.glsl"
// Water blending
@@
-22,6
+17,8
@@
float water_depth( vec3 pos, vec3 halfview )
float d = dot( pnorm, halfview );
float t = dot((pnorm*pdist - pos), pnorm) / d;
float d = dot( pnorm, halfview );
float t = dot((pnorm*pdist - pos), pnorm) / d;
+
+ // TODO: Make g_water_fog a material param
return t * g_water_fog;
}
return t * g_water_fog;
}
@@
-29,5
+26,5
@@
void main()
{
vec3 halfview = normalize( uCamera - aWorldCo );
float depth = water_depth( aWorldCo, halfview );
{
vec3 halfview = normalize( uCamera - aWorldCo );
float depth = water_depth( aWorldCo, halfview );
- FragColor = vec4(
aWorldCo.y, 0.0, 0.0,depth
);
+ FragColor = vec4(
depth, 0.0, 0.0, 0.0
);
}
}