Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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:
    200
    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:
    11,840
    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?