Search Issue Tracker
By Design
Votes
0
Found in
2022.3.62f1
6000.0.48f1
6000.1.3f1
6000.2.0b1
Issue ID
UUM-105170
Regression
No
Unexpected Material change/transparency when switching between ShaderGraph and material at runtime in HDRP
Reproduction steps:
1. Open the attached “IN-101574.zip” project
2. Open the “OutdoorsScene”
3. Enter Play mode
4. Observe the Quad material in the Game view
5. Press “T” on the keyboard
6. Repeat the 4th and 5th steps
7. Observe the Quad material
Expected result: The material remains white/not transparent
Actual result: The material turns transparent/gray
Reproducible with: 2022.1.0a1, 2022.3.62f1, 6000.0.48f1, 6000.1.3f1, 6000.2.0b1
Reproducible on: Windows 10 (User reported), Windows 11
Not reproducible on: no other environment tested
Notes:
- Pressing “T” switches between “Material 1” and “Shader 1” referenced on the “LoadObjectRuntime” GameObject, and switching back from “Shader 1” to “Material 1” produces the problematic behavior
- Could not reproduce with URP, only reproducible with HDRP
- Also reproducible in the Player
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
- DownloadHandlerScript.CompleteContent is called twice when building for WebGL
- Scene view has Y coordinates of the Screen Position node flipped when some of the URP features are disabled
- Volumetric fog shader variants are missing from build when "Strict Shader Variant Matching" is disabled
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
- Files in the target folder are deleted without a proper warning when building an iOS project
Resolution Note:
It seems like you are not setting up your dynamically created materials correctly. When you change the underlying shader, you are creating a new material instance that does not have the same properties. The properties cannot be copied because it is not the same underlying shader. You need to setup all the material properties again if you change the underlying shader.