Skip to content

Commit

Permalink
fix: character lighting flickering (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
doodlum authored Nov 10, 2024
1 parent d80f0a5 commit 220e084
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions package/Shaders/Lighting.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -2241,9 +2241,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace

# if !defined(LANDSCAPE)
if (PixelShaderDescriptor & LightingFlags::CharacterLight) {
float charLightMul =
saturate(dot(viewDirection, modelNormal.xyz)) * CharacterLightParams.x +
CharacterLightParams.y * saturate(dot(float2(0.164398998, -0.986393988), modelNormal.yz));
float charLightMul = saturate(dot(worldSpaceViewDirection, worldSpaceNormal.xyz)) * CharacterLightParams.x + CharacterLightParams.y * saturate(dot(float2(0.164398998, -0.986393988), worldSpaceNormal.yz));
float charLightColor = min(CharacterLightParams.w, max(0, CharacterLightParams.z * TexCharacterLightProjNoiseSampler.Sample(SampCharacterLightProjNoiseSampler, baseShadowUV).x));
# if defined(TRUE_PBR)
charLightColor = Color::GammaToLinear(charLightColor).x / Color::LightPreMult;
Expand Down

0 comments on commit 220e084

Please sign in to comment.