Search Unity

LWRP + ARFoundation workaround for 2019.1

Discussion in 'Handheld AR' started by todds_unity, Apr 19, 2019.

  1. todds_unity

    todds_unity

    Unity Technologies

    Joined:
    Aug 1, 2018
    Posts:
    38
    We have a workaround for LWRP+ARFoundation on 2019.1. Version 5.6.1 of both LWRP and ShaderGraph will work with ARFoundation on 2019.1.

    Switching LWRP and Shader both to 5.6.1 versions will enable LWRP and ARFoundation to work together.


    In the arfoundation-samples repository, I have created a new branch lwrp-2019.1 that has this implemented.
    https://github.com/Unity-Technologies/arfoundation-samples/tree/lwrp-2019.1


    For your own projects, reference these versions of the following packages:

    Code (JavaScript):
    1. {
    2.   "dependencies": {
    3.     "com.unity.render-pipelines.lightweight": "5.6.1",
    4.     "com.unity.shadergraph": "5.6.1",
    5.     "com.unity.xr.arfoundation": "1.1.0-preview.6"
    6.   }
    7. }
    We are working to resolve some issues with the verified 5.7.2 version of LWRP and ARFoundation. We will update as soon as we have a working solution.

    Todd
     
  2. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    166
    OMG THX
     
  3. mhazani

    mhazani

    Joined:
    Jun 18, 2014
    Posts:
    11
    Thanks, that's fantastically helpful.
    1. Would you happen to know if the VFX Graph is also compatible, and if so, which version?
    2. So in terms of the path of least resistance, the template to start a new project with would be 3D, right? LWRP introduces 5.7.2 and I heard mixed things about downgrading packages... The initial LWRP scene seems not to work out of the box.
     
  4. Christopher-Anderson-GISP

    Christopher-Anderson-GISP

    Joined:
    Mar 5, 2015
    Posts:
    7
    Finally got it working using the Lightweight RP (Preview) template in 2019.1.0f2. In order to get it to work using the LWRP and Shader Graph 5.6.1 I had to turn on Face Tracking even though I'm not using it. Apparently when it was unchecked it wasn't being properly stripped out when building the xCode project.

    Another issue was the frame rate. I used the LWRP sample scene and just removed the camera and replaced it with the AR Foundation camera (AR Session, AR Session Origin, and adding in the LWRP camera data, etc). The frame rate I was getting was only 17; far below the 30fps that I was targeting, and the CPU usage stayed at ~122%. The iPad model I'm testing on is MP2F2LL/A which only has an A9 chip so I'm not sure if that's the issue or if the Lightweight RP (Preview) template's sample scene is just too much for an AR experience.

    Anyone else seeing this? Are there other project settings that need to be adjusted to improve frame rate and CPU usage?
     
  5. edee1337

    edee1337

    Joined:
    Apr 10, 2013
    Posts:
    14
    I'm seeing much higher CPU usage in 2019.1 + LWRP compared to 2018.3 without LWRP on an iPhone X
     
  6. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,322
    Which version of LWRP is compatible with the VFXGraph?
     
  7. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    166
    If you are using ARFoundation, none, because we are stuck at 5.6.1.

    VFX graph is going to be a game changer just as shadergraph is. Looking forward to it
     
    aalmada likes this.
  8. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,322
    That's what I thought:( So no fancy particle effects in AR.....
     
  9. Amin-

    Amin-

    Joined:
    Sep 27, 2017
    Posts:
    24
    Hi @todds_unity ...
    How can I download LWRP Version 5.6.1 in 2019.1.1 ?!
    Snap35.jpg
    there's nothing about that version!
     
  10. oleyb

    oleyb

    Joined:
    Nov 8, 2012
    Posts:
    15
    Edit your manifest.json directly.
     
    Blarp and Amin- like this.
  11. Amin-

    Amin-

    Joined:
    Sep 27, 2017
    Posts:
    24
    wow... I really appreciate your reply @oleyb.
    clean and simple :)
     
    Blarp likes this.
  12. oleyb

    oleyb

    Joined:
    Nov 8, 2012
    Posts:
    15
    Awesome, I'm glad it worked out for you. :)
     
    Amin- likes this.
  13. Bystander333

    Bystander333

    Joined:
    Jan 11, 2018
    Posts:
    3
  14. dlee7284

    dlee7284

    Joined:
    Mar 28, 2018
    Posts:
    2
    Any update on this?? It clearly is broken and we can't use the latest...
     
  15. steego

    steego

    Joined:
    Jul 15, 2010
    Posts:
    903
    I have a project here https://github.com/StigOlavsen/LightweightARFoundation that has a workaround for using AR Foundation with LWRP 5.13. I've been told it doesn't work on Android (haven't had the chance to test/fix), only on iOS, but it is probably an easy fix if you are adventurous.
     
    BobbyVR and Blarp like this.
  16. agpatel0007

    agpatel0007

    Joined:
    Aug 21, 2014
    Posts:
    2
    AR camera goes blank after upgrading project to LWRP 5.7.2 and using ar foundation 2.2.0
    any solution ?
     
  17. dlee7284

    dlee7284

    Joined:
    Mar 28, 2018
    Posts:
    2
    This is what I experienced as well. Apparently, the way to fix it is to assign Custom Render Asset in ARCamera. The render asset is provided in LWRPSupport branch in the ARFoundationSample but the codebase is not compatible with the latest LWRP. ARFoundation team needs to fix it so it is compatible with the latest LWRP. I don't plan to use workaround with older version. Not a suitable solution.
     
    createtheimaginable likes this.
  18. agpatel0007

    agpatel0007

    Joined:
    Aug 21, 2014
    Posts:
    2
    I didnt find custom render asset anywhere
    do you have in your project ?
     
  19. rirfan

    rirfan

    Joined:
    Mar 16, 2018
    Posts:
    1

    Thanks @steego for the project. I am new to unity and shaders (still learning). I tried your project on Android, tracking and planes are working but camera background is pink. I tried to replace the shader with the one that provided in LWRP Support folder, and changing some properties, but not worked. If you give some pointers for fixing the ARCoreBackgroundLWRP.shader, It will be helpful for me a lot.
     
    Last edited: Aug 8, 2019
  20. steego

    steego

    Joined:
    Jul 15, 2010
    Posts:
    903
    Sorry I don't have much time to look into it right now. The shader requires GLES 3, and the GL_OES_EGL_image_external_essl3 extension, but this should be the same as Unitys project for the old LWRP.

    I suspect it might be due to not getting camera permissions, or that the camera isn't started somehow, but I can't say for sure without debugging it myself.
     
  21. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    64
    How about 2019.2?
     
  22. SilverSc0ut

    SilverSc0ut

    Joined:
    Apr 12, 2018
    Posts:
    1
    I started to look into it, i haven't found the solution yet since it seems all the links to the git repositories for LWRP and ARFoundation are broken now
     
  23. YashwanthCBI

    YashwanthCBI

    Joined:
    Jul 23, 2019
    Posts:
    5