Search Unity

Bug XR BuiltIn Custom Shadergraph only Renders in Left Eye 2021.3.33 SPI

Discussion in 'VR' started by mrphilipjoel, Dec 17, 2023.

  1. mrphilipjoel


    Jul 6, 2019
    I've been working on this for weeks. I've found many similar forum posts, but no solutions.

    It seems custom ShaderGraphs just don't work with Single Pass Instancing.

    Documentation states

    ShaderGraph automatically adds the macros required to support single-pass stereo rendering.

    This just seems to not be the case. Or, maybe more is required for it work work, than these macros.

    Steps to Reproduce:

    1. Create a new XR Project in Unity 2021.3.30

    2. In XR Plugin Management, set Stereo Rendering Mode to Single Pass

    3. Put an XR Origin in a scene.

    4. Create a cube.

    5. Create a new Lit Built In ShaderGraph Shader

    6. Create a new material.

    7. Set the shader for the ShaderGraph Shader created in step 5.

    8. Hit play

    9. In game View, Show both Eyes, instead of just the Left Eye, and you'll see the cube only rendered in the left eye.
    CBHM likes this.
  2. Kellojo


    Apr 8, 2017
    I had a similar issue with shader graphs using the built-in pipeline and Single-pass instanced rendering (which is also used by VR Chat). The shader graph shaders were only rendered for the left eye. The right eye didn't render them at all.

    What worked for me is the ShaderGraph package by z3y:

    You'll need to do the following:
    1. Add the package using the package manager (Add package from git url ->
    2. Open your shader graph and change the target in the graph settings from Built-in to Built-in z3y (see attached screenshot)
    3. Remove the old Built-in target
    4. Repeat for each shader you're having an issue with

    Give it a try and the shaders should now work.

    Attached Files: