Search Unity

Stencil Buffer in Single Pass Instanced

Discussion in 'AR/VR (XR) Discussion' started by themdubs, Jan 9, 2020.

  1. themdubs

    themdubs

    Joined:
    Jan 12, 2014
    Posts:
    26
    I've been trying to use a stencil buffer to achieve a cutout effect on certain objects. I'm using a command buffer to add a blit prior to the image effects since the stencil is cleared out by then. Currently I'm having an issue where the rendering in my left eye is what I expect. However in my right eye not only are there apparent gaps in the stencil that change with my viewing angle, the actual color that I'm using to fill the stencil is a duller shade.

    The only thing I find potentially suspect is the unity_CameraWorldClipPlanes[4] variable, is it possible this changes per eye? All my other maths are related to the objects local and world position so I wouldn't figure it to be related to that.
     
    WonkeeKim likes this.