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. Dismiss Notice

Archiving a stencil buffer with Visual Effect/VFX graph

Discussion in 'Shaders' started by studioaboveandbelow, Jul 24, 2020.

  1. studioaboveandbelow

    studioaboveandbelow

    Joined:
    Feb 19, 2020
    Posts:
    3
    Hi

    I'm trying to use a 3d object as a stencil/mask (with a stencil mask shader script in URP).
    I can get this working with two 3d objects, say one is the mask the other is visible from the different perspectives.

    I would like to now block/mask particles from the VFX in the Visual effect, I've had a look around and can't find any advice/guidance on doing this.

    Could I get some guidance to how I can do this ?

    Thanks
     
    kai303 likes this.
  2. Ofenkatze

    Ofenkatze

    Joined:
    Aug 14, 2013
    Posts:
    15
    Three years later, same problem. You didn't happen to find a solution?
    Theoretically, how you would achieve this is: make a shadergraph with the approriate stencil setting, then pipe this shadergraph into the output of your VFX graph.
    Problem is: up to now, shadergraph does not support stencil buffers, and you can't edit the generated code manually (well, you can but it doesn't reflect in the VFX graph).