Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.12f1
2022.1.23f1
2022.2.0b15
2023.1.0a19
2023.2.0a1
Issue ID
UUM-20075
Regression
No
Material.HasTexture/HasProperty returns true for non-existent property after calling setTexture
How to reproduce:
1. Open the user-attached project “ShaderPropertyBug”
2. Enter the Play Mode
3. Observe the Console
Expected result: There is no error message because Material.GetTexture shouldn’t be called since Material.HasTexture is false
Actual result: There is an error message because Material.GetTexture is called
Reproduced with: 2021.3.12f1, 2022.1.23f1, 2022.2.0b15, 2023.1.0a19
Couldn’t test with: 2020.3.41f1 (Material.HasTexture can’t be called)
Reproduced on: Windows 11 Pro
Note: Also reproduced in 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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Resolution Note:
After discussing with the team, we decided to postpone any significant behavior change to the existing interface. As mentionned by Juho Oravainen , material setters/getters should work independently from the shader assigned. We should then have a different set of functions to check if the shader assigned to the material has properties and what is set to it.
Right now the documentation is describing the current state of things. Set is setting both, material and shader. Has is looking at the shader and get is getting from the shader except for textures which get it from the material. I tried to change the existing behavior of the texture getter but I ran into failing tests on the graphic side which hint me that it might be a more important breaking change than I thought in first place.
We are looking forward to refactor this in a version post 2023.x.