Not signed in
Copyright © 2026 Unity Technologies
This case is by design. In case where the material inspector opens 3 cameras(Game View, Scene View and Preview) and 2 directional light(Direction Light in hierachy, internal light created by Preview camera) exist, and the culprit script(LinkDirectionalToCustomNightSky) updates a material property(_Moonlight_Forward_Direction) to main light direction every frame whether the editor plays or not because ExecuteAlways attribute is set. But for getting direction the user relies on the render pipeline main light getter API that actually returns the major directional light for the current rendering process(for Game View and Scene View -> Direction Light in hierarchy, but for Preview camera -> internal light) rather than the one in hierachy. And preview rendering is not refreshed every frame, so some frames have direction of the scene directional light, but others have hidden preview directional light's. The issue can be worked around by using propery API, in this case RenderSettings.sun. The user can create a tag component like MyMainLight, and retrieve it by APIs like GetComponent() or FindObjectByType().
Cancelling this port, as the issue will be addressed in the 6000.0.x port
Cancelling this 2023.2 tech release issue since the support for this release has come to end of life. Cancelling this 2023.2 port case does not affect any LTS or Unity 6 Beta/Preview that remain open.
This case is by design. In case where the material inspector opens 3 cameras(Game View, Scene View and Preview) and 2 directional light(Direction Light in hierachy, internal light created by Preview camera) exist, and the culprit script(LinkDirectionalToCustomNightSky) updates a material property(_Moonlight_Forward_Direction) to main light direction every frame whether the editor plays or not because ExecuteAlways attribute is set. But for getting direction the user relies on the render pipeline main light getter API that actually returns the major directional light for the current rendering process(for Game View and Scene View -> Direction Light in hierarchy, but for Preview camera -> internal light) rather than the one in hierachy. And preview rendering is not refreshed every frame, so some frames have direction of the scene directional light, but others have hidden preview directional light's. The issue can be worked around by using propery API, in this case RenderSettings.sun. The user can create a tag component like MyMainLight, and retrieve it by APIs like GetComponent() or FindObjectByType().
Reproduction steps:
1. Open the attached “Repro“ project
2. Open the “Assets/Scenes/“ Scene
3. Select the “Fullscreen Effect Samples Showcase” GameObject in the Hierarchy
4. Change the Fullscreen Effect to “Custom Night Sky“ in the Inspector
5. Select the “Assets/Samples/High Definition RP/14.0.10/Fullscreen Samples/CustomRenderTargets/NightSky_Material.mat“ Material in the Project window
6. Observe the Game View and the Inspector’s Preview window
Expected result: Game View doesn’t flicker, Material is clearly displayed in the Preview window
Actual result: Game View flickers, visual glitches are seen in the Preview window
Reproducible with: 2022.3.19f1, 2023.2.8f1, 2023.3.0b4
Couldn’t test with: 2021.3.34f1 (couldn’t downgrade)
Reproducible on: M1 MacOS 14.2
Not reproducible on: No other environment tested
Sign in to see your voted issues