Skip to content

Transparency Level may unexpectedly affect rendered color under HDR #864

Description

@shino-a

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:

  1. Ensure HDR is enabled in both the RenderPipelineAsset and the camera.
  2. Assign a Toon/Toon material with Clipping set to Transparent Clip to any model.
  3. Render it overlapping with an opaque object in the scene.
  4. Change Color or Transparency Level and observe the effect.

*Confirmed in URP.

Expected behavior
Transparency Level (_Tweak_transparency) should only affect transparency.

Screenshots
_Tweak_transparency:0_Tweak_transparency:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions