Search Issue Tracker
By Design
Votes
0
Found in
2021.3.38f1
2022.3.30f1
6000.0.3f1
Issue ID
UUM-72657
Regression
No
Special Values from SurfaceOutput Struct are stripped when using them in the #if UNITY_PASS_FORWARDBASE directive
How to reproduce:
1. Open the user-attached project “SurfaceShaderBug”
2. Open the “SampleScene” scene
3. Observe the “Cube” GameObejct in the Scene View
Expected results: The “Cube” is black
Actual results: The “Cube” is red
Reproducible with: 2021.3.38f1, 2022.3.30f1, 6000.0.3f1
Reproducible on: Windows 11 Pro
Not reproducible on: No other environment tested
Note: Also reproducible in Player
Workaround:
Using #ifndef UNITY_PASS_FORWARDADD instead solves the issue
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:
Pass type defines are not present in the phase that analyses the surface shader code.
You can use SHADER_TARGET_SURFACE_ANALYSIS:
#if SHADER_TARGET_SURFACE_ANALYSIS || UNITY_PASS_FORWARDADD
...
#endif