Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question I'm trying to make a stencil buffer that only renders the Alpha cutout of a 3D object or Sprite.

Discussion in 'Shaders' started by Blasawebo, May 23, 2024.

  1. Blasawebo

    Blasawebo

    Joined:
    Jan 2, 2015
    Posts:
    60
    I'm new to URP, so I checked a URP outline effect for my game:
    https://gist.github.com/ScottJDaley/6cddf0c8995ed61cac7088e22c983de1#file-info-md

    which gives this result:
    Screenshot 2024-05-23 15.47.13.png

    I was able to convert multiple effects from the old format to URP, so I'm trying to make an outline, from what I checked in the Frame Debugger, the stencil buffer detects the full object in render, so I'm trying to see if it can detect the alpha of an object and the render only visible parts:

    Screenshot 2024-05-23 16.32.03.png

    Any help will be welcome.
     
  2. Blasawebo

    Blasawebo

    Joined:
    Jan 2, 2015
    Posts:
    60
    Okay after working some things out on the I fixed the Stencil buffer, but the outline is still giving me problems Screenshot 2024-05-23 18.53.12.png Screenshot 2024-05-23 18.54.09.png