Skip to content

Commit

Permalink
fix: fix effect shader for ADDBLEND && VC && !TEXTURE (#544)
Browse files Browse the repository at this point in the history
* fix: fixed wrong look for effect shader with ADDBLEND && VC && !TEXTURE.

* style: 🎨 apply clang-format changes

---------

Co-authored-by: Ilya Perapechka <i_perapechka@wargaming.net>
Co-authored-by: Jonahex <Jonahex@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 19, 2024
1 parent 963da84 commit 9bf49c1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions package/Shaders/Effect.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -633,12 +633,16 @@ PS_OUTPUT main(PS_INPUT input)

float4 baseTexColor = float4(1, 1, 1, 1);
float4 baseColor = float4(1, 1, 1, 1);
# if defined(TEXTURE) || (defined(ADDBLEND) && defined(VC))
baseTexColor = TexBaseSampler.Sample(SampBaseSampler, input.TexCoord0.xy);
baseColor *= baseTexColor;
if (PixelShaderDescriptor & _IgnoreTexAlpha || PixelShaderDescriptor & _GrayscaleToAlpha)
baseColor.w = 1;
# if !defined(TEXTURE)
[branch] if (PixelShaderDescriptor & _GrayscaleToColor || PixelShaderDescriptor & _GrayscaleToAlpha)
# endif
{
baseTexColor = TexBaseSampler.Sample(SampBaseSampler, input.TexCoord0.xy);
baseColor *= baseTexColor;
if (PixelShaderDescriptor & _IgnoreTexAlpha || PixelShaderDescriptor & _GrayscaleToAlpha) {
baseColor.w = 1;
}
}

# if defined(MEMBRANE)
float4 baseColorMul = float4(1, 1, 1, 1);
Expand Down Expand Up @@ -780,4 +784,4 @@ PS_OUTPUT main(PS_INPUT input)

return psout;
}
#endif
#endif

0 comments on commit 9bf49c1

Please sign in to comment.