back normal fix

This commit is contained in:
NULL511 2024-06-15 00:56:13 -04:00
parent dc17ff6651
commit 30426d535d

View File

@ -518,6 +518,8 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
WavePixelData wave = physics_wavePixel(physics_localPosition.xz, waviness, physics_iterationsNormal, physics_gameTime); WavePixelData wave = physics_wavePixel(physics_localPosition.xz, waviness, physics_iterationsNormal, physics_gameTime);
vec3 NormalTex = wave.normal; vec3 NormalTex = wave.normal;
if (isEyeInWater == 1 && !gl_FrontFacing) NormalTex = -NormalTex;
// tangent space normals for refraction // tangent space normals for refraction
TangentNormal = NormalTex.xy*0.5+0.5; TangentNormal = NormalTex.xy*0.5+0.5;