LWRP + ARFoundation workaround for 2019.1

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:

{
  "dependencies": {
    "com.unity.render-pipelines.lightweight": "5.6.1",
    "com.unity.shadergraph": "5.6.1",
    "com.unity.xr.arfoundation": "1.1.0-preview.6"
  }
}

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

Edit (2019-08-29):

AR Foundation 3.0.0-preview now supports LWRP and URP.

https://forum.unity.com/threads/con…-0-0-preview-to-work-with-lwrp-or-urp.736583/

8 Likes

OMG THX

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.

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?

I’m seeing much higher CPU usage in 2019.1 + LWRP compared to 2018.3 without LWRP on an iPhone X

Which version of LWRP is compatible with the VFXGraph?

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

1 Like

That’s what I thought:( So no fancy particle effects in AR…

Hi @todds_unity …
How can I download LWRP Version 5.6.1 in 2019.1.1 ?!


there’s nothing about that version!

Edit your manifest.json directly.

2 Likes

wow… I really appreciate your reply @oleyb .
clean and simple :slight_smile:

1 Like

Awesome, I’m glad it worked out for you. :slight_smile:

1 Like

Looks like the https://github.com/Unity-Technologies/arfoundation-samples/tree/lwrp-2019.1 branch for 1.1.0 preview 6 has gone missing.
I can only see the 2019-with-2.1 branch as an option now?

Any update on this?? It clearly is broken and we can’t use the latest…

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.

2 Likes

AR camera goes blank after upgrading project to LWRP 5.7.2 and using ar foundation 2.2.0
any solution ?

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.

1 Like

I didnt find custom render asset anywhere
do you have in your project ?

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.

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.