Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Stencil buffer for VFX Graph

Discussion in 'Visual Effect Graph' started by David_548219, May 14, 2023.

  1. David_548219

    David_548219

    Joined:
    Jan 30, 2018
    Posts:
    3
    Hello!

    I am using 3d object as a stencil mask via custom shader. Is it possible to use stencil buffer to mask particles? If not is there any way to achieve desired outcome using different techniques?

    Use case is the following: I have a space ship (with interior), when inside I want to mask particles out, so they are not visible when in front of interior geometry, but still visible through transparent surfaces (i.e. when behind transparent geometry). I managed to achieve this with regular objects, but that requires the use of custom shader, which is not possible with vfx graph (Shader graph does not cut it, since it lacks stencil nodes).

    I am using VFX Graph 12.1.7 with HDRP 12.1.7, Unity version is 2021.3.8f1.