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
- [WebGL][Android] Corrupt header when connecting via IP
- Editor and Android Player hangs/freezes when repeatedly Loading/Unloading AssetBundle in Vulkan
- Selecting a Material for HDRP Decal Projector in the Inspector window spams errors in the Console
- Expanded Asset Preview Box moves/hides when creating new Asset in Project window
- Player crashes on Meta Quest with "/apex/com.android/runtime/lib64/bionic/libc.so" when using OpenXR Plugin in a specific project
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.