Search Issue Tracker
By Design
Votes
0
Found in [Package]
2021.2.0a9
2021.2.0b11
2022.1
Issue ID
1366095
Regression
Yes
Custom Function Node with Type > File mode does not use function from within the referenced file
Steps to reproduce:
1. Create a new HDRP project
2. Right-click in Project > Assets then click Import Package > Custom Package... then select attached "SwitchColorOnDefine.unitypackage", then click Import
3. Enter Play Mode
Expected result: both spheres are green
Actual result: one sphere is red and another one is green
Reproducible with: 12.0.0 (2021.2.0a9, 2021.2.0b12, 2022.1.0a10), 13.0.0 (2022.1.0a11)
Not reproducible with: 10.6.0 (2020.3.19f1), 10.7.0 (2020.3.19f1), 11.0.0 (2021.1.21f1), 12.0.0 (2021.2.0a8)
Couldn't test with: 2019.4.31f1 - due to package importing errors
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
- GPU utilization increases by 20% on Meta Quest headsets when Render Graph is enabled on 6000.0.16f1 and higher
- Value on Slider (Int) control in UI Builder displays as default when saving UI Document
- Color mismatch in UI Builders Library panel when the Editors theme is set to Light Mode
- [Android ] "AndroidJNI.ToBooleanArray" returns a random non-zero value instead of "IntPtr.Zero" when the method argument is null
- Non-HDR color picker opens when selecting material color with HDR enabled
Resolution Note:
So the file type is still used with a custom function node. However, this workaround for adding in a define will not work since the include file for the SwitchColorOnDefine happens earlier than the vertex function actually #define's the ONCOLOR. A long term fix for this would potentially be allowing users to decide where exactly includes are placed in custom function nodes, which is something we have in mind. A short term fix would be to move the define function done in the custom function node to a file rather (rather than the string custom function it is now) so that the include pastes in the define before the switchoncolor function checks the #ifdef (I have verified that this makes the ball render green). Since this is not actually a bug though, closing.