Search Unity

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
     
    luc4sh0rta and kai303 like 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).
     
    luc4sh0rta and great04 like this.
  3. luc4sh0rta

    luc4sh0rta

    Joined:
    Sep 5, 2022
    Posts:
    1
    Working on a project where i'm aiming to do the same thing masking a vfx graph particle system with the stencil buffer. Did either of you find a solution?