Search Issue Tracker
By Design
Votes
3
Found in
2023.1.0a1
2023.2.0a1
Issue ID
UUM-3277
Regression
No
The Material's shader is not fully set when switching the shader in Player
How to reproduce:
1. Open the attached project "ShaderSystemIssue.zip"
2. Open the "SampleScene" Scene
3. Build And Run (File > Build And Run)
4. When the Player loads press the Button labeled "Button" two times
Expected result: The Material of the "Cube" GameObject switches to "Lit"
Actual result: The Material of the "Cube" GameObject becomes transparent
Reproducible with: 2019.4.38f1, 2020.3.34f1, 2021.3.2f1, 2022.1.0f1, 2022.2.0a12
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
- The Editor is slowed down when a Volume Profile with many Overrides is open in the Inspector window
- Lightmap "View" button is not symmetric and has an empty space
- Unable to abort when asynchronous loading a Scene
- Errors are thrown when clicking "Refresh Virtual Offset Debug"
- 2D Renderer Breaks When Animating Material Property with MaterialPropertyBlock
Resolution Note:
When setting the shader, the customRenderQueue is resetted in the material. So when the user set it back to the previous shader, the visual is different because the customRenderQueue is resetted to use the default one.
What is happening here is the intended behavior according to the [documentation |http://example.com]:
"Note that if a shader on the material is changed, the render queue resets to that of the shader itself."
The recommendation here would be to let the user know that he should also set the customRenderPass when setting the shader if he doesn't want to use the default shader one.