Search Issue Tracker
By Design
Votes
0
Found in [Package]
14.0.0, 13.1.5, 13.1.2, 12.1.4, 12.0.0, 11.0.0, 7.7.1
Issue ID
1400047
Regression
No
[HDRP] Light intensity resets after 2 frames after changing it in the script
How to reproduce:
1. Open attached Unity project (hdrp-light-intensity-issue)
2. Load OutdoorsScene
3. Select Sun gameObject
4. Notice intensity is set to 0
5. Enter play mode
6. Notice intensity is still 0
7. In the console window, you can see that light intensity resets after a couple of frames
Expected result: Intensity should be set to 1000.
Actual result: Intensity is set to 1000 for a couple of frames, then resets to 0.
Reproduced with: 2022.2.0a3 (HDRP 14.0.0), 2022.2.0a1 (HDRP 13.1.2), 2022.1.0b7 (HDRP 13.1.5), 2022.1.0a2 (HDRP 12.0.0), 2021.2.11f1 (HDRP 12.1.4), 2021.2.0a1 (HDRP 11.0.0), 2019.4.33f1 (HDRP 7.7.1)
Notes:
This doesn't happen with the Built-In render pipeline.
This issue doesn't reproduce in the build.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Warning 'Unable to find player assmebly' is thrown when building some Project Templates
- ArgumentOutOfRangeException when manipulating the Project Settings search bar
- [Linux] Touch freezes in Player when any mouse button is clicked
- UnityEngine.Rendering.Volume.OnEnable() is called twice before OnDisable() creating multiple copies of the same volume when a volume is enabled right after Domain Reload when entering Play Mode
- Hinge Joint transforms are reset when toggling the "useMotor" property
Resolution Note:
This issue is by design. HDRP have its own intensity field that is different from builtin as it rely on physical light unit.
The scripting API to set light is on the HDAdditionalData component: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@7.1/api/UnityEngine.Rendering.HighDefinition.HDAdditionalLightData.html?_ga=2.187700392.1256829761.1644225368-683797712.1641845328#UnityEngine_Rendering_HighDefinition_HDAdditionalLightData_intensity