Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2020.3
2020.3.32f1c1
2021.2
2022.1
2022.2
Issue ID
1413899
Regression
No
A GameObject cannot be selected in the Scene view when the Material contains a '_MainTex' property
Reproduction steps:
1. Open the user's attached project "selection_bug.zip"
2. Try to select "test_main_tex" and "test_base_map" in the Scene view
Expected result: Both GameObjects can be selected
Actual result: "test_base_map" can be selected, "test_main_tex" cannot
Reproducible with: 2019.4.37f1, 2020.3.32f1, 2021.2.18f1, 2022.1.0b14, 2022.2.0a9
Comments (2)
-
sheppardchambers3851839
Mar 30, 2022 06:55
Thanks!
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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
The default selection logic will choose between OpaqueSelection.shader and AlphaBasedSelection.shader based upon the presence of a "_MainTex" uniform. If _MainTex is defined, it will use AlphaBasedSelection.shader which will do a clip based upon the alpha in the texture. The set texture, "sand_rock_cm.png" has 0 for alpha so this will always be a discard.
To fix this the user must add a custom picking pass to their shader. Attached is a modified version of their shader that works. Note: the render states needed to be moved inside the first pass as they caused picking to not work.