Search Issue Tracker
By Design
Votes
7
Found in
2021.3.2f1
2022.1.1f1
2022.2.0a12
Issue ID
UUM-9590
Regression
No
[URP] ShaderKeywords '_MAIN_LIGHT_SHADOWS' and '_ADDITIONAL_LIGHT_SHADOWS' are always enabled in the Editor
ShaderKeywords '_MAIN_LIGHT_SHADOWS' and '_ADDITIONAL_LIGHT_SHADOWS' are enabled in the Editor when the 'Main Light' and 'Additional Lights' are disabled in the Universal Render Pipeline Asset
Reproduction steps:
1. Open the attached 'URP_EditorKeywordBug' project
2. Open the 'SampleScene'
3. Go to the 'Window -> Analysis -> Frame Debugger' and toggle the 'Enable' button on
4. Select the 'Draw Opaque Objects' draw call
Expected result: '_MAIN_LIGHT_SHADOWS' and '_ADDITIONAL_LIGHT_SHADOWS' ShaderKeywords are disabled
Actual result: ShaderKeywords '_MAIN_LIGHT_SHADOWS' and '_ADDITIONAL_LIGHT_SHADOWS' are present
Reproducible with: 12.1.6 (2021.3.2f1), 13.1.8 (2022.1.1f1), 14.0.2 (2022.2.0a12)
Could not test with: 2019.4.39f1, 2020.3.34f1 (no 'Draw Opaque Objects' draw call)
Note:
- Issue is not reproducible in builds
Comments (2)
-
unity_F74167AD32862B410F49
Jan 18, 2023 09:43
So this means that you can't test what your game looks like in editor with main light shadows disabled, nor any shaders that change when the main light shadow is disabled.
You'd need to make a build everytime, which for larger games is very annoying.
-
pmerilainen
Nov 04, 2022 08:36
This seems to happen also in deployed Android builds using Vulkan
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
- "Browse" button for Xcode in the "Build Profiles" window is too big
- USS styles fail to inherit correctly when contentContainer is overridden in a custom control
- Copying and pasting Animator Transitions leads to unexpected behaviour
- "ShaderGraph" misses a space in the "Project Settings" section
- UI Builder inspector’s checkbox fields can be activated when clicking anywhere in the value field
Resolution Note:
This is by design. To reduce the amount of variants to process when making builds, URP strips out the "off"variant for main and additional light shadows, the behaviour in the editor mimics that.
Work is planned to improve shadows in URP and this behaviour will be reevaluated.