Search Issue Tracker
By Design
Votes
1
Found in
2021.3.37f1
2022.3.23f1
2023.2.17f1
6000.0.0b14
Issue ID
UUM-68470
Regression
No
Shader pass overridden by fallback when using "UsePass" directive
Reproduction steps:
1. Open the attached “repro_IN-72668“ project
2. Open the “/Assets/Scenes/SampleScene.unity“
3. Open either the Scene view or Game view
4. Observe the “Sphere“ GameObject
Expected result: The “Sphere“ GameObject appears red
Actual result: The “Sphere“ GameObject doesn’t appear red
Reproducible with: 2021.3.37f1, 2022.3.23f1, 2023.2.17f1, 6000.0.0b14
Reproducible on: Windows 10 (22H2)
Not reproducible on: No other environments tested
Notes:
- Reproducible in Player
- The custom surface shader defines a pass that should render the “Sphere“ GameObject red, or, in other words, return a (1,0,0) value. However, the Editor is also drawing the fallback shader's "Diffuse" pass after the custom shader's pass. This fallback shader pass most likely defines a different color, overriding the red color definition
- Frame Debugger shows that the “Diffuse“ shader’s pass is drawn after the correct surface shader’s pass. This confirms that both the fallback shader and the custom shader is invoked
Comments (2)
-
koko_dl
Apr 12, 2024 07:21
This bug should OBVIOUSLY NOT be marked as 'by design.' And the previous versions of Unity do not have this bug.
I wonder if the resolution note was processed by anyone who has written even a single line of shader code?
A fallback shader should absolutely not be displayed alongside the original shader.
It is called as "fallback", isn't it? -
koko_dl
Apr 03, 2024 09:16
Additional information:
* This bug will not reproducible if we don't use UsePass instead of write a big shader contains all required code
* It is considered as a regression of the fix to UUM-36470:
https://issuetracker.unity3d.com/issues/usepass-doesnt-reference-passes-within-another-shaders-second-subshader
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
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
UsePass adds all passes that match the given name in the given shader, including its fallbacks.