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

Shader System

-

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

  1. 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.

Comments (2)

  1. sheppardchambers3851839

    Mar 30, 2022 06:55

    Thanks!

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.