Search Issue Tracker

By Design

Votes

9

Found in

6000.0.60f1

6000.2.8f1

6000.3.0b6

6000.4.0a3

Issue ID

UUM-125282

Regression

No

Shadows disappear and come back after couple frames when using OnDemand Shadows and OnDemand Reflection

-

How to reproduce:
1. Open the attached project “IN-117681”
2. Open the “garage test stripped 1” scene
3. Enter Play mode
4. Observe the Game view

Expected result: The shadows are generated and are clearly visible
Actual result: The shadows are visible for couple frames and then disappear. After couple frames they come back and disappear again, which creates a cycle

Reproducible with: 6000.0.0f1, 6000.0.60f1 (f02d6f9f9009), 6000.2.8f1, 6000.3.0b6 (211490bb75a6), 6000.4.0a3
Could not test with: 2023.1.0a1, 2023.3.0a2 (Package and rendering pipeline issues)

Reproducible on: Windows 11
Not reproducible on: No other environments tested

  1. Resolution Note:

    This is one of the downsides of having a single shadow cache for each light type between multiple cameras.

    In this case it is caused because of reflection probes being treated as a camera in HDRP which means it will draw the shadows if it has been requested and updates before starting the main rendering. This means that the camera settings used to draw the shadows comes from the reflection probe. The reflection probe in the reproduction scene was set to not draw some of the objects causing the shadows to be missing when drawing to the main camera. And when the reflection probe doesn't update in the same frame as the shadows would it use the main camera settings for rendering shadows drawing shadows from all visible objects. This would cause the reflection probe to have shadows without the objects.

    To fix this I would make sure which of the two results you want to be correct, the main camera or the reflection. And then make sure that the shadows are only demanded in the correct frame when the reflection probes are or aren't being updated.

    This issue would also appear if you have multiple cameras with different settings. The reported issue is just more noticeable because of the flicker swapping between which camera or reflection probes draws the shadows.

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.