Describe the bug
Changing the Transparency Level (_Tweak_transparency) may also affect the rendered color.
This seems to occur because saturate(x) may not be applied under HDR, which can cause alpha blend factors (SrcAlpha, OneMinusSrcAlpha) to become greater than 1 or negative values.
Is this intended behavior?
|
float Set_Opacity = SATURATE_IF_SDR((_Inverse_Clipping_var + _Tweak_transparency)); |
|
finalRGBA = fixed4(finalColor, Set_Opacity); |
To Reproduce
Steps to reproduce the behavior:
- Ensure HDR is enabled in both the RenderPipelineAsset and the camera.
- Assign a
Toon/Toon material with Clipping set to Transparent Clip to any model.
- Render it overlapping with an opaque object in the scene.
- Change Color or Transparency Level and observe the effect.
*Confirmed in URP.
Expected behavior
Transparency Level (_Tweak_transparency) should only affect transparency.
Screenshots


Describe the bug
Changing the Transparency Level (
_Tweak_transparency) may also affect the rendered color.This seems to occur because
saturate(x)may not be applied under HDR, which can cause alpha blend factors (SrcAlpha,OneMinusSrcAlpha) to become greater than 1 or negative values.Is this intended behavior?
com.unity.toonshader/com.unity.toonshader/Runtime/Shaders/URP/UniversalToonBodyDoubleShadeWithFeather.hlsl
Lines 515 to 516 in 6eb6293
To Reproduce
Steps to reproduce the behavior:
Toon/Toonmaterial with Clipping set toTransparent Clipto any model.*Confirmed in URP.
Expected behavior
Transparency Level (
_Tweak_transparency) should only affect transparency.Screenshots

