Search Unity

Custom Screen Effect Left Eye Gray when using Single Pass Instancing (SPI) Deferred Rendering

Discussion in 'General Graphics' started by austintsmith13, Jan 17, 2021.

  1. austintsmith13

    austintsmith13

    Joined:
    Dec 27, 2018
    Posts:
    8
    Using Unity 2019.4.16 with the new XR Management Plugin, Built-In Rendering Pipeline (Deferred)

    Hello, I am trying to get a screen effect on the deferred rendering pipeline to color the left eye green and the right eye red.

    Using Multi-Pass rendering this works fine and I am able to create screen effects without issue, but when I switch to SPI (Single Pass Instancing), the left eye is gray and right eye doesn't apply anything to the camera.

    I'm not using the Post Processing Stack V2, instead I am providing the matrices for the left and right eye in a global variable on a CommandBuffer and calling Blit.

    I read the source for the Post Process Stack here and read the docs here for adding instancing macros in my shader. The Post Processing Stack V2 is broken for all effects when SPI is enabled.

    I've posted code snippets of the renderer and shader I'm working on here. (The Instancing Macros are Temporarily Removed in the given snippet)

    I would also like to know why the XR Management Plugin only supports Multi-Pass and Single Pass Instancing and not Single Pass double wide?

    Does anyone know anything about supporting SPI for a custom Post Effect Renderer? I'm looking for a working example that I can learn from or someone who can better explain why SPI is currently not working and how I could implement this myself.

    Thanks.