Search Unity

Mask out Geometry Shader by Comparing it to Vertex Shader using Stencil Buffer

Discussion in 'Shaders' started by lauchsuppe, May 3, 2017.

  1. lauchsuppe

    lauchsuppe

    Joined:
    Dec 6, 2014
    Posts:
    39
    I want to render an object using Unity's surface shader. Then, inside a Pass, I hope to create a rectangle using a geometry shader. Finally, using two stencil operations (before the surface shader & inside the geometry shader pass), I want to mask out certain areas of the rectangle based on the object's position.
    Is this at all possible? I'm able to render both the plane and the object. However, the masking part doesn't work out. If I have the stencil mask inside the geometry pass check against the prior stencil operation, the whole plane is masked out instead of just a particular area.
    EDIT: Everything is working as intended. I'm just an idiot and applied the wrong Stencil Parameters.
     
    Last edited: May 3, 2017