Search Unity

Bug ProBuilder bug: selecting translucent faces

Discussion in 'World Building' started by Marscaleb, Jan 24, 2021.

  1. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    I'm using ProBuilder to create collision hulls for my levels; I use it to make simple collision hulls rather than relying on visible mesh geometry or a series of box colliders. I disable the mesh renderer when I'm not editing it.
    But when I am editing it, I use a material with a semi-transparent grid pattern so I can clearly see what the edges of the mesh are, and what's behind it so I can line the edges up properly. The material is just a solid half-transparent color with a fully opaque grid drawn on it.

    But here's the problem: when I try to select faces, Unity CONSTANTLY fails to recognize when I am clicking on a face. I repeatedly winding up clicking "through" my geometry and suddenly find myself in terrain editing mode because it think I clicked terrain. And then I can't go back to editing the geometry without doing some strange song-and-dance of changing my selection mode or finding the mesh in the hierarchy and clicking it there, because if I just try to click the mesh it will wind up failing to recognize the selection and think I'm trying to edit the terrain, so now I've just made some random terrain change instead of selecting my probuilder mesh.
    For crying out loud, I am explicitly in the face-selection mode, it should not be possible for me to select something other than a face, let alone jump into another tool.

    But the real bug here is that I simply can't select faces half the time (when they have a semi-transparent material on them.)
    The only work-around I have is apply a different material with a solid color so I can select faces, make by broad and general edits, and then switch back to my transparent-ish material to make fine-tuning. But this back-and-forth should not be necessary; I'm in a face-editing mode, Unity should be trying to select faces before it selects anything else.
     
  2. Requios

    Requios

    Joined:
    Dec 7, 2016
    Posts:
    2
    I'm having the same issue. I use probuilder to define game areas on terrain, so I need to see through the probuilder mesh so I can decide where to create the areas. The workflow that seemed easiest is to have a grid mesh and merge the faces that become an area, but I cant select faces most of the time. I've found that I can select faces when there's water underneath my cursor (which is a simple plane with transparant material), but I can't when theres terrain underneath.

    I'm on Unity 2021.2.7 with ProBuilder 5.0.4.
     
  3. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    552
    If the shader is not defining a picking pass, it will be using the default pass. When rendering a picking frame, the default pass will try to read the alpha cutoff from the source shader (a property named "_Cutoff"). If not possible, it uses a value of .01 for the cutoff. I suspect that is what is happening here - try increasing slightly the opacity of your texture.
     
  4. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    The problem with that assessment is that the results are inconsistent. At one point I may be clicking the transparent section and it selects, but at another moment I click the transparent section and it doesn't.
    If it were "my transparent is too transparent" wouldn't it consistently work or not work?
     
  5. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    552
    It should, yes. I'd suggest filing a bug report with the material in question so that we can see what is actually happening.
     
  6. Requios

    Requios

    Joined:
    Dec 7, 2016
    Posts:
    2
    My material is a very plain URP lit material. Setting the alpha to 100 does not solve my issues. Setting it to opaque does, but that is not what I want. It also seems to be related to setting the editor view to isometric. In perspective view everything works fine. But perspective is not nice for my use case: I want the terrain underneath to align with the probuilder mesh regardless of the terrain height.

    "I've found that I can select faces when there's water underneath my cursor (which is a simple plane with transparant material), but I can't when theres terrain underneath."
    To clarify: this does not always happen. I can select faces more often when there's water, but it seems to be quite random.

    upload_2022-4-9_19-4-33.png upload_2022-4-9_19-12-47.png