Search Unity

Showcase Oculus Application Space Wrap Sample Project [ UPDATE ]

Discussion in 'VR' started by nukadelic, Jan 6, 2022.

  1. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    78
    Just though to drop this one here if anyone having trouble setting up ASW with unity, i cloned the custom urp repository which includes the future and created UPM modules that can be easily included in the manifest json.

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

    Also works in play mode ( with rift mode usb / airlink ) but the FFR and ASW are exclusive to a build apk for the quest since its a oculus future.


    UPDATE : the oculus repository was updated to use urp-v12 , and i have upgraded the sample project to the latest branch running on 2021.2.19f , alpha clipping seems buggy but besides vfx and aws seems to work together , try the build here
     
    Last edited: May 3, 2022
    uz986, fuzzy3d, theinlein and 2 others like this.
  2. theinlein

    theinlein

    Joined:
    May 29, 2021
    Posts:
    4
    This is incredibly helpful. Thanks so much for putting this together! Your next beer is on me.

    I've only one quick question: the cube with the Shader Graph/test_lit material tears for me (the only cube on the highest row). I'm curious if that one tears for you as well.
     
  3. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    78
    Seems like i forgot to add motion vectors to the active main camera , its fixed now

    ( thanks for the beer )
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    Is .NET 4.x required?
    Dont think anything needs it

    And shouldn't android be at v23? That way the signing works correctly.
     
  5. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    78
    .net 4 is just what i use , didn't try to publish it to app lab yet so not too sure if that api level would work, the docs does mention that it is the " Minimum API Level " , ill change that just in case
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    You need both v1 and v2 signing to the apk to upload it, so then API v23 is the one you need as minimum :)

    And for .NET, using the default setting might be better if you don't use any .NET 4.x features
     
  7. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    78
    why default settings might be better ? Isn't .net-4.x is suppose to be faster ?
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    not as far as I know. 4.x has more features, so might even be slower and have worse compatibility on older devices (not 100% sure, checked this about a year ago)
     
  9. wojwen

    wojwen

    Joined:
    Feb 13, 2018
    Posts:
    38
    Hi, I just tried to set up my project based on yours but all the movement is jittery (probably due to some issue with motion vectors). I managed to enable AppSW, I can see that in OVR Metrics Tool. I'm using Unity 2021.3.2f1, but I checked and the same issue happens with 2021.2. Here are my settings:
    upload_2022-5-15_12-50-20.png upload_2022-5-15_12-50-55.png upload_2022-5-15_12-57-59.png upload_2022-5-15_12-58-17.png
    I also have a script like this, which enables motion vectors:
    Code (CSharp):
    1.  
    2.     public class AppSW : MonoBehaviour
    3.     {
    4.         [SerializeField] private Camera mainCamera;
    5.         void Start()
    6.         {
    7.             mainCamera.depthTextureMode = DepthTextureMode.MotionVectors | DepthTextureMode.Depth;
    8.         }
    9.     }
    10.  
    Here is a list of packages I'm using:
    upload_2022-5-15_12-53-59.png
    The custom packages were downloaded from https://github.com/Oculus-VR/Unity-Graphics/tree/2021.2/staging and copied into the Packages directory.

    However, when I build the application all movement is jittery as if the motion vectors were not generated properly. I'm testing using a simple unlit shader created in shadergraph. I'm a bit at loss because I don't know what have I missed.

    EDIT: I figured it out, turns out the unlit shader created with shadergraph just doesn't work. I created an issue on your github page.
     
    Last edited: May 15, 2022
  10. Immersive-Matthew

    Immersive-Matthew

    Joined:
    Mar 24, 2020
    Posts:
    137
    Hello VVad,

    First, thank you so much for the Unity project files. I played around with your sample project in Unity and noticed real time spot lights and point of lights do not seem to light up URP Lit, or Simple Lit shaders. Is this intentional? The real time directional light works, but that seems to be it. If they are not supported, why not? Is this just simply needing to add the motion vector code to the Lit and Simple Lit shaders or is there something more fundamental missing. Thanks so much.
     
  11. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    78
    hey bro idk made the repo so it would be easy to clone and try asw for my own experiments , left the settings as much as possible close to defaults, haven't rly tried spot lights as i have been using only one single directional light form my entire project , maybe try differed rendering path ? (link) if that doesn't work i would leave create an issue on the official repo
     
    Immersive-Matthew likes this.
  12. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    78
    upload_2022-7-17_3-39-30.png

    try this
     
  13. THE_OMNIPRESENT_SIMULATOR

    THE_OMNIPRESENT_SIMULATOR

    Joined:
    Sep 2, 2022
    Posts:
    11
    Saw this thread and that project today! Thanks! Looking forward to producing much more performant Quest apps soon!
     
    DevDunk likes this.
  14. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    david-winterbear and DevDunk like this.
  15. david-winterbear

    david-winterbear

    Joined:
    Oct 30, 2015
    Posts:
    4
    Thank you very much for going through the effort! We have an existing project using URP 12.1.10 and wanted to test out ASW, I wasn't looking forward to manually integrating the necessary changes.
     
  16. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    78
  17. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    The update is based on the master branch of the original repo. The updated packages are embedded in the project instead of being hosted and downloaded by UPM - feel free to fork, upload the packages somewhere and have them used the previous way.
     
    DevDunk likes this.
  18. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    78
    thanks , updated
     
    TerraUnity and DevDunk like this.
  19. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    78
    If you having trouble with dependencies on a freshly cloned project , make sure the editor have your account signed in so the package manager can download the dependencies , if you still can't open then : enter safe mode -> exit safe -> re import all assets .
     
  20. Przemyslaw_Zaworski

    Przemyslaw_Zaworski

    Joined:
    Jun 9, 2017
    Posts:
    328
    I installed build from:

    https://github.com/nukadelic/unity-application-spacewarp/releases/download/apk-103/app-spacewarp.apk

    and I installed the newest OVR Metrics Tool. I have a question: does FPS and ASW FPS should be the same value ?

    upload_2024-1-2_15-34-10.jpeg

    You can see similar values for FPS and ASW FPS. But for example in this tutorial, it seems that ASW value should be twice as FPS:

    https://skarredghost.com/2021/12/12/application-spacewarp-unity-how-to-review/#:~:text=Click the index,perceiving 72 FPS.




    So, my question: does ASW FPS value shows only amount of reconstructed frames per second, or ASW FPS values should shows total amount of frames (rendered + reconstructed).
     
  21. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    78
    The build is pretty old but yea it does the same trick , the fps will always show the application update and simulation frequency - so how many times the Update method will get invoked . When asw is active the frame rate is halved and "asw fps" will always display double of the application frame rate , the basic premise of this method is to run the app logic and rendering at half the normal rate , so asw could interpolate / reconstruct the in between frames - essentially keeping the same frame rate but doubling the display frequency , if you take a look in the GiveMeMoreFPS.cs script then you will notice that the debug stats Hz value is calculated by basically doubling the current frame rate value only when space warp is active
     
    Przemyslaw_Zaworski likes this.
  22. Przemyslaw_Zaworski

    Przemyslaw_Zaworski

    Joined:
    Jun 9, 2017
    Posts:
    328
    OK, so there is something wrong on my device / setup, because framerate and ASW FPS values are almost the same, AWS FPS is not doubled:

    upload_2024-1-4_12-55-2.png
     
  23. korinVR

    korinVR

    Joined:
    Jul 7, 2012
    Posts:
    34
    Looks like I'm in the same boat.

    I have built the 2021.3/oculus-app-spacewarp branch from https://github.com/Oculus-VR/Unity-...acewarp/TestProjects/OculusAppSpaceWarpSimple with Unity 2021.3.33, and the 2022.2/oculus-app-spacewarp branch with Unity 2022.3.16, but both built apps show FPS: 36 / ASW FPS: (around) 36 on OVR Metrics Tool.

    According to the document, ASW FPS should display 72. I don't know if my project is set up incorrectly or if there is a problem with Quest at the moment. Or is this just a problem with incorrect metrics?
     
  24. korinVR

    korinVR

    Joined:
    Jul 7, 2012
    Posts:
    34
    Oh, I just noticed that Assassin's Creed Nexus VR shows FPS: 45 / ASW FPS: 45, so it must be the metrics problem :)
     
  25. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    Sorry for offtopic, but assassin creed only runs at 45fps? I thought that such values were below Meta's requirement for publication.
     
  26. korinVR

    korinVR

    Joined:
    Jul 7, 2012
    Posts:
    34
    I don't think it is a problem because the game is rendered at 90fps smoothly by Application SpaceWarp. It should be a problem of OVR Metrics Tool only.
     
    fuzzy3d likes this.
  27. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    FYI, the metrics changed and ASW FPS only shows frames generated from AppSW, not the total frames. So 45 FPS + 45 ASW FPS = 90 total FPS displayed on device.