From 9bf49c1bd971f531223dc85be4e69a57e826a45d Mon Sep 17 00:00:00 2001 From: Ilya Perapechka <50655277+Jonahex@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:48:38 +0300 Subject: [PATCH] fix: fix effect shader for ADDBLEND && VC && !TEXTURE (#544) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: fixed wrong look for effect shader with ADDBLEND && VC && !TEXTURE. * style: 🎨 apply clang-format changes --------- Co-authored-by: Ilya Perapechka Co-authored-by: Jonahex --- package/Shaders/Effect.hlsl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/package/Shaders/Effect.hlsl b/package/Shaders/Effect.hlsl index 1aa291a3c..94f74687a 100644 --- a/package/Shaders/Effect.hlsl +++ b/package/Shaders/Effect.hlsl @@ -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); @@ -780,4 +784,4 @@ PS_OUTPUT main(PS_INPUT input) return psout; } -#endif +#endif \ No newline at end of file