Search Issue Tracker

By Design



Found in



Issue ID




Shadows are not rendered when Mesh Renderer Cast Shadows parameter is set to On or Shadows Only



How to reproduce:
1. Open the attached project
2. Go to the Inspector window -> Mesh Renderer -> Cast Shadows
3. Set Cast Shadows parameter to Two sided, Shadows Only and then back to on
4. Inspect the Scene view. The left side uses RuntimeColoredBarrels.shader, the right side uses RuntimeColoredBarrelsInverted.shader

Expected: The barrel has shadows on the left side of the scene view
Actual: Shadows are not rendered

Reproducible with: 2018.3.0a1, 2018.3.0b8, 2019.1.0a6
Not reproducible with: 2018.1.9f2, 2018.2.14f1

Note: If the direction vector that is used to calculate the vertex position to face the right way is inverted we get the correct result. (line 485)

- The bug reproduces with Realtime and Mixed lighting and doesn't repro with Baked lighting;
- The bug reproduces for both dynamic and static shadow casters/receivers;
- Reproducible in both editor and Standalone player;
- Reproducible with Standard shader;
- Reproducible in the new scene with the custom shader (Impostors/Custom/Colored Barrels); not reproducible in the new scene with Standard shader.

  1. Resolution Note (2018.3.X):

    Before Unity 2018.3.0a1 _WorldSpaceLightPos0 shader variable was incorrect (ie inverted) for directional lights in the shadow pass. The code below was relying on that broken behavior and thus need to be updated now that the bug sa been fixed Unity side.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.