Search Unity

Bug [Oculus] Unlit shadergraph shader jitter when Application Spacewarp is enbaled.

Discussion in 'VR' started by wojwen, May 17, 2022.

  1. wojwen

    wojwen

    Joined:
    Feb 13, 2018
    Posts:
    38
    There is a bug with Application SpaceWarp, where unlit shaders created with shadergraph jitter with AppSW. I've set up a project according to instructions from https://developer.oculus.com/documentation/unity/unity-asw/ and used packages from https://github.com/Oculus-VR/Unity-Graphics/tree/2021.2/oculus-app-spacewarp. All shaders work correctly (both built-in URP and lit shadergraph), except the unlit shadergraph shader. This seems to be caused by motion vectors not being calculated correctly. It happens both in 2021.2 and 2021.3. Is there going to be a fix for this?
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    I'm not sure if motion vectors is possible with unlit. The problem might be there. Maybe make a custom lit shader with the same visuals if unlit if possible?
     
  3. wojwen

    wojwen

    Joined:
    Feb 13, 2018
    Posts:
    38
    Why would motion vectors not be possible on this type of shader? Is there a technical reason for this?
    Also I'm using the unlit shader because I'm doing my own lighting calculations.
    Is there an option to use a lit shader without utilizing the unity's built-in lighting? It would be applied on top of my lighting, so the default behavior is not an option.
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    If you use custom shaders maybe edit in motion vector support yourself. The oculus guide has a bit on how to add this
     
  5. wojwen

    wojwen

    Joined:
    Feb 13, 2018
    Posts:
    38
    The issue is that I'm using shadergraph to create my shaders and I'm not aware of any way of adding custom code except editing the generated shader code, which is a bit tedious to do every time I make a change (and tbh the generated code is a bit too complicated for me, I know only the basics).
     
    Last edited: May 18, 2022
  6. NemesisWarlock

    NemesisWarlock

    Joined:
    Jan 21, 2017
    Posts:
    141

    Use Nukadelic's ASW Sample project, and move your assets over to it.

    https://github.com/nukadelic/unity-application-spacewarp

    It's a big job, but the perf boost is worth it. all your shadergraph shaders will move in just fine, and include the motion vectors.
     
    nukadelic likes this.