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
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
- Crash on MonoBehaviour::CallMethodIfAvailable when performing various actions
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.