more setup for scene controller, replace old weather stuff with it. fix vignette when entering/exitings water. added a water enter effect

This commit is contained in:
Xonk
2025-03-27 19:09:58 -04:00
parent e5d90521dd
commit f0611c681e
22 changed files with 229 additions and 269 deletions

View File

@ -11,6 +11,7 @@
#endif
uniform float exitWater;
uniform float enterWater;
// uniform float exitPowderSnow;
uniform int isEyeInWater;
@ -32,7 +33,6 @@ uniform int isEyeInWater;
// uniform bool is_on_ground;
// uniform bool isSpectator;
void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
// detect when health is zero
@ -74,6 +74,12 @@ void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
// apply distortion effects for exiting water and under water
distortmask = max(distortmask, waterDrops);
}
if(enterWater > 0.0){
vec2 zoomTC = 0.5 + (texcoord - 0.5) * (1.0 - (1.0-sqrt(1.0-enterWater)));
float waterSplash = texture2D(noisetex, zoomTC * vec2(aspectRatio,1.0)).r * (1.0-enterWater);
distortmask = max(distortmask, waterSplash);
}
#endif
//////////////////////// APPLY DISTORTION /////////////////////
@ -86,6 +92,7 @@ void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
if(exitWater > 0.01) color = distortedColor;
#endif
//////////////////////// APPLY COLOR EFFECTS /////////////////////
#if defined LOW_HEALTH_EFFECT || defined DAMAGE_TAKEN_EFFECT
vec3 distortedColorLuma = vec3(1.0, 0.0, 0.0) * dot(distortedColor, vec3(0.21, 0.72, 0.07));