Search Unity

Resolved Culling decals by surface normal

Discussion in 'High Definition Render Pipeline' started by TheJezrien, Dec 2, 2022.

  1. TheJezrien

    TheJezrien

    Joined:
    Jun 10, 2021
    Posts:
    4
    I've seen a couple of threads related to this issue, but I can't find a clear solution.

    We're using decals to project character markers on the ground, but the decal projector paints these artifacts on vertical surfaces.

    upload_2022-12-2_12-0-11.png

    I thought I could modify our decal shadergraph to cut its emission when the normal isn't straight up, but as far as I'm aware, the decal shader can't access the normals of the surface it's projecting on. The Normal Vector node just gets the normals of the Decal Projector itself (i.e. its Up vector).

    Does anyone know a solution for this? Am I missing something?
     
  2. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    146
    Hm, the decal projector here works exactly as it is supposed to. I'd suggest you draw this kind of marker in a different way. You could just use a Quad with the same texture on it, right?
     
  3. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    437
  4. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,442
    The Decal Projector has three setup modes in the Inspector, and one of them lets you crop the decal rectangle. In your case, just crop that edge of the decal until it is just hitting the floor.
     
  5. TheJezrien

    TheJezrien

    Joined:
    Jun 10, 2021
    Posts:
    4