Skip to content

Commit

Permalink
feat: ripple effect now supports water parallax
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRiverwoodModder committed Oct 6, 2024
1 parent 66a0a97 commit a2d6666
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion package/Shaders/Water.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,11 @@ float3 GetWaterNormal(PS_INPUT input, float distanceFactor, float normalsDepthFa
if (finalNormal.z > 0 && wetnessEffectsSettings.Raining > 0.0f && wetnessEffectsSettings.EnableRaindropFx &&
(rainDropDistance < maxRainDropDistance) && wetnessOcclusion > 0.05) {
float rippleStrengthModifier = (wetnessOcclusion * wetnessOcclusion) * distanceFadeout;
raindropInfo = WetnessEffects::GetRainDrops(input.WPosition + CameraPosAdjust[a_eyeIndex], wetnessEffectsSettings.Time, finalNormal, rippleStrengthModifier);
float3 rippleWPosition = input.WPosition + finalNormal * 16;
# if defined(WATER_PARALLAX)
rippleWPosition.xy += parallaxOffset;
# endif
raindropInfo = WetnessEffects::GetRainDrops(rippleWPosition + CameraPosAdjust[a_eyeIndex], wetnessEffectsSettings.Time, finalNormal, rippleStrengthModifier);
}

float3 rippleNormal = normalize(raindropInfo.xyz);
Expand Down

0 comments on commit a2d6666

Please sign in to comment.