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
- Editor crashes on StoredGraphicsBuffer::GetGfxBufferID when VFX Graph property is modified during Play Mode and Application.targetFrameRate is used to limit FPS
- Crash on NVAPI_Thunk when changing Player resolution while HDR display is used and Direct3D12 is set as the graphics API
- Only one out of multiple cameras is shown in the Play Mode while HDR display is used and Direct3D12 is set as the graphics API
- The "Paste Component as New" option is incorrectly displayed as active despite the action being prohibited
- "TLS Allocator ALLOC_TEMP_TLS" errors are thrown when unsuccessfully importing an FBX file
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.