Search Unity

Question Detecting the edge of a projector via shader.

Discussion in 'Shader Graph' started by mick129, Jul 24, 2022.

  1. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
    Hello, I'm trying to detect the edge of this cone (the angle may change) and I was wondering if there is a simple way to do it?

    upload_2022-7-24_15-4-43.png
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,336
    What kind of projector is this? This is the Shader Graph forum, which usually means you're using it for the URP or HDRP, but neither support perspective decal projections. So this makes me thing you're using the legacy projector component in the built in renderer, in which case you're more likely using a regular vertex fragment shader and not Shader Graph ... so I'm not sure if you posted here in error or if you've somehow gotten Shader Graph to work with the legacy projector.

    If it's the later, you should already have your answer as that's the only way to keep the projector from rendering across the entire surface you're touching.

    Or you're using a top down decal projector and the "cone" is defined by the texture being used as those decals don't have an "angle" to detect?