Search Unity

Bug QUEST 2 Render issues left eye when using grass (compute)shader.

Discussion in 'VR' started by BruceKristelijn, Jan 27, 2023.

  1. BruceKristelijn

    BruceKristelijn

    Joined:
    Apr 28, 2017
    Posts:
    107
    Hi all. I am using a grass solution created by MinionsArt in my VR game for Quest 2 and added the work to make it work with singlepass rendering. However when I build my game and load it on the Quest 2 the moment the grass is enabled on the build the left eye seems to start glitching when I move my head around. The image seems to jitter a bit (this does not show up on a recording).

    I have added a zip with the source code used and a image I created in photoshop to show the effect while moving around.

    I hope someone is able to help me find a possible solution so I can have beautiful grass! I am using 2021.3.17f but also tried .16f. I also tried enabling / disabled all graphics and it is really the grass creating my issue.

    Project settings:
    Render pipeline: URP Version 12.1.8

    URP Settings:
    Depth texture: Enabled
    Opaque texture: Disabled
    Terrain holes: Disabled

    Quality:
    HDR: Enabled
    MSAA: 4x
    Render scale 1
    Upscaling filter: Automatic

    Lighting:
    All lighting (Main and additional) is disabled.

    Shadows:

    Max distance: 0
    Working unit: percent
    Cascade count: 1
    Last border: 20
    Depth bias: 1
    Normal bias: 1
    Soft shadows: Enabled (Dynamic shadows are not really used)

    URP Forward renderer settings:
    Opaque layer mask: Everything
    Transparent layer mask: Everything

    Rendering path: Forward
    Depth priming mode: Disabled
    Depth texture mode: After opaque

    Native render pass: Disabled
    Transparent receive shadows: Disabled
    Post processing: Disabled
    Overrides stencil: Disable

    Quality settings:
    VSync count: Dont sync
    Teture quality: Full res
    Anisotropic texture: Disabled
    Texture streaming: Disabled

    Particle raycast budget: 64
    Billboard face camera position: Disabled
    Shadowmask mode: Shadowmask
    Buffer size: 16

    XR Plug-in management settings:
    Render mode: Singlepass instanced / Multi-view
    Depth submission mode: None
    Low overhead & phase sync: Enabled


    OVR Manager settings:
    Use recommended MSAA Level: Enabled
    Monoscopic: Disabled
    Min render scale: 0.7
    Max render scale: 1

    Build player settings:
    Color space: Linear
    Auto graphics api: Disabled
    Graphics api's: OpenGLES3
    Multithreaded rendering: Enabled
    static batching: Enabled
    Compute skinning: Enabled
    Graphic jobs: Disabled
    Texture compression format: ASTC
    Normal map encoding: XYZ
    Lightmap encoding: High quality
    Virtual texturing: Disabled
    Scripting backend: IL2CPP
    Shader precision model: Use platform package
    Keep loaded shader alive: Disabled
     

    Attached Files:

    Last edited: Feb 6, 2023
  2. BruceKristelijn

    BruceKristelijn

    Joined:
    Apr 28, 2017
    Posts:
    107
    I did not have a any luck yet fining a solution, turning the instance count to 1 on DrawProceduralIndirect did nothing to resolve my issue.
     
  3. BruceKristelijn

    BruceKristelijn

    Joined:
    Apr 28, 2017
    Posts:
    107
    Anyone who might be able to help us with this?
     
  4. nilagard

    nilagard

    Joined:
    Jan 13, 2017
    Posts:
    77
    Might have the answer, but I am running on limited knowledge of your VR build settings. This issue appears when the shader is not properly supported by Unity XR with their either URP or HDRP as shaders are rendered differently using VR. Getting around this requires extended coding knowledge and you have to know what you are doing when developing this.
    I can only refer back to this post without knowing what your settings are : https://github.com/ColinLeung-NiloCat/UnityURPUnlitScreenSpaceDecalShader/issues/13
    There might be some more good explanations there to why your problem is appearing.
    Best of luck!
     
  5. BruceKristelijn

    BruceKristelijn

    Joined:
    Apr 28, 2017
    Posts:
    107
    Thank you so much for answering! Good note that my settings might influence behavior so let me share these here as well (I will also update the original post).

    Render pipeline: URP Version 12.1.8

    URP Settings:
    Depth texture: Enabled
    Opaque texture: Disabled
    Terrain holes: Disabled

    Quality:
    HDR: Enabled
    MSAA: 4x
    Render scale 1
    Upscaling filter: Automatic

    Lighting:
    All lighting (Main and additional) is disabled.

    Shadows:

    Max distance: 0
    Working unit: percent
    Cascade count: 1
    Last border: 20
    Depth bias: 1
    Normal bias: 1
    Soft shadows: Enabled (Dynamic shadows are not really used)

    URP Forward renderer settings:
    Opaque layer mask: Everything
    Transparent layer mask: Everything

    Rendering path: Forward
    Depth priming mode: Disabled
    Depth texture mode: After opaque

    Native render pass: Disabled
    Transparent receive shadows: Disabled
    Post processing: Disabled
    Overrides stencil: Disable

    Quality settings:
    VSync count: Dont sync
    Teture quality: Full res
    Anisotropic texture: Disabled
    Texture streaming: Disabled

    Particle raycast budget: 64
    Billboard face camera position: Disabled
    Shadowmask mode: Shadowmask
    Buffer size: 16

    XR Plug-in management settings:
    Render mode: Singlepass instanced / Multi-view
    Depth submission mode: None
    Low overhead & phase sync: Enabled


    OVR Manager settings:
    Use recommended MSAA Level: Enabled
    Monoscopic: Disabled
    Min render scale: 0.7
    Max render scale: 1

    Build player settings:
    Color space: Linear
    Auto graphics api: Disabled
    Graphics api's: OpenGLES3
    Multithreaded rendering: Enabled
    static batching: Enabled
    Compute skinning: Enabled
    Graphic jobs: Disabled
    Texture compression format: ASTC
    Normal map encoding: XYZ
    Lightmap encoding: High quality
    Virtual texturing: Disabled
    Scripting backend: IL2CPP
    Shader precision model: Use platform package
    Keep loaded shader alive: Disabled
     
  6. nilagard

    nilagard

    Joined:
    Jan 13, 2017
    Posts:
    77
    After some thought I find it weird that it cannot show up on a recording, which means it only shows in the headset.. Or? There's different ways to record Quest image output, either show both eyes, 1 eye or directly from the computer. All in all I think the shader is just not properly coded to support VR/ your headset. If you are trying to use a shader made by someone outside of Unity I would contact them and ask for support to make it work with your project.
     
  7. BruceKristelijn

    BruceKristelijn

    Joined:
    Apr 28, 2017
    Posts:
    107
    I tried contacting to no avail and tried converting the shader myself. It seems to only happen on the quest 2 native build version indeed. I will try to record the left eye natively and hope to capture it that way.
     
  8. nilagard

    nilagard

    Joined:
    Jan 13, 2017
    Posts:
    77
    Study their solution/logic and read up on how shaders are implemented for the Quest2 and you might just fix your problem. Sounds like a pain in the *** but I don't think this is anything else than just some fiddling about and you'll make it work. if not, make your own shader that will work for you!
     
  9. BruceKristelijn

    BruceKristelijn

    Joined:
    Apr 28, 2017
    Posts:
    107
    I will do that, I hoped adding the single pass support would be enough hahaha
     
  10. BruceKristelijn

    BruceKristelijn

    Joined:
    Apr 28, 2017
    Posts:
    107
    I have found a solution for the issue with the compute shader by upping the instance count to two, but now a weird screen tear effect is present with the object on.