Search Unity

ARFoundation now supports LWRP 4.8.0-preview

Discussion in 'Handheld AR' started by jimmya, Jan 18, 2019.

  1. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    792
    See the former post about ARFoundation working on LWRP 3.3.0 for context.

    TLDR: "lwrp-support" branch on arfoundation-samples repo has been updated to support the latest LWRP 4.8.0-preview.

    The "lwrp-support" branch has a folder called LWRPSupport that has all the files needed. If you want to see a starter project that works with LWRP, open SampleLWRPScene using Unity 2018.3 and build it to your device - it should just work! :)


    To make it work with an existing project, follow these steps:

    1. You must change your whole project to use LWRP. See https://blogs.unity3d.com/2018/02/2...er-pipeline-optimizing-real-time-performance/ (or for TLDR: create a LightweightRenderpipelineAsset and set it to the Renderpipeline parameter in Graphics settings).This might cause some of your existing materials to not work (even if you attempted to upgrade them). Fix these materials by replacing them with new materials that support LWRP. There is a folder called LWRPSupport in the root. This contains all the components needed to support LWRP for ARFoundation background rendering.


    Screen Shot 2019-01-18 at 11.47.34 AM.png

    2. Next, locate your ARCamera game object which lives under the ARSessionOrigin game object, and examine it in the Inspector. Note the ARCameraBackground component. ARFoundation has the concept of a CustomRenderAsset which you can enable on your ARCameraBackground component. Check the “Use Custom Renderer Asset” on the component, which should reveal the “Custom Renderer Asset” parameter. Into this parameter, drag the LWRPBackgroundRendererAsset asset from the LWRPSupport folder.

    Screen Shot 2019-01-18 at 11.48.16 AM.png



    This should setup everything you need to make your app render the scene properly with LWRP. For more information on how this works, you can look at the source files in the LWRPSupport folder. There is some functionality in ARFoundation that was added to change the background renderer from the default behavior to use the CustomRendererAsset specified one.


    3. LWRPSupport folder contains shaders, materials and scripts that support the renderer above. It also contains a LWRPBackgroundRendererAsset that is used to provide the renderer and its settings to ARFoundation. To create one of these assets, select Assets>Create>XR>LWRPBackgroundRendererAsset which should create the asset in your project folder. In order for the background rendering shaders to be included when building your project, it needs to be referenced from somewhere, and this asset also allows you to reference the materials that use those shaders so that they are included.

    Screen Shot 2019-01-18 at 11.47.53 AM.png

    4. If you want to take advantage of the shader graph you will need to make sure to import the same version as the LWRP you're using. To do this open the package manager and click Advanced -> Show preview packages, next locate Shader Graph and select the version number in the upper corner. Under All versions locate 4.8.0-preview and click Install.

    Screen Shot 2019-01-18 at 11.58.02 AM.png

    Please watch the arfoundation-samples project for future examples that include shader graphs. And enjoy making cool new content with ARFoundation and LWRP!
     
    phil_lira, itzik009s and newguy123 like this.
  2. itzik009s

    itzik009s

    Joined:
    Oct 17, 2012
    Posts:
    7
    We are working on AR car project with lwrp using AR foundation…
    We experience some problems with consistency of the appearance when we build it for iOS.. even without AR
     

    Attached Files:

  3. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    792
    You might have better luck with that in one of the threads here: https://forum.unity.com/forums/graphics-experimental-previews.110/
     
  4. Philip-ACN

    Philip-ACN

    Joined:
    Oct 25, 2018
    Posts:
    20
    Sorry to hijack, But I'm having the below trouble with ARFoundation and the LWRP.


    As you can see, initially the camera works, but as soon as we see the AR content, (either the cube or the plane mesh) the background disappears.

    I've followed the above instructions to get the LWRPSupport folder and added the LWRPBackgroundRendererAsset to the camera. (Which fixed an earlier all black screen issue I had been having.)

    I'm using unity 2018.3.2f1, ARFoundation preview 22, ARCore preview 24, ARKit preview 23, and LWRP 4.8.0.
     
  5. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    792
    Make sure you have disabled MSAA on your camera.
     
  6. jayseong

    jayseong

    Joined:
    Aug 21, 2018
    Posts:
    10
    I have an issue that appeared after upgrading our project in using LWRP. Before the upgrade, I was able to access the Camera.main.activeTexture. However, now Camera.main.activeTexture appears to be null.

    To work around this issue, I have attempted assigning a render texture to the camera's target texture, and access the targetTexture instead such as:
    RenderTexture = new RenderTexture(Screen.width, Screen.height, 24, RenderTextureFormat.ARGB32);
    Camera.main.targetTexture = RenderTexture;

    However, it doesn't look like LWRP likes the camera having a targetTexture assigned to the camera.

    The above is all happening in OnPostRender() which is listening for RenderPipeline_beginFrameRendering:

    private void OnEnable()
    {
    RenderPipeline.beginFrameRendering += RenderPipeline_beginFrameRendering;
    }

    private void OnDisable()
    {
    RenderPipeline.beginFrameRendering -= RenderPipeline_beginFrameRendering;
    }

    private void RenderPipeline_beginFrameRendering(Camera[] obj)
    {
    OnPostRender();
    }

    Been stuck on this for a week! Any help is greatly appreciated!!!
     
  7. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    792
    If you are doing anything fancy with customizing the rendering as you appear to be doing, you will need to look at how LWRP works now - it throws out the legacy render pipeline and rejiggers it to do it differently. So you will have to redo your rendering to work within the process of LWRP. If its just a post processing effect you want, you might be able to achieve it via PostFx v2 which should be supported by LWRP: https://blogs.unity3d.com/2018/06/11/postfx-v2-amazing-visuals-upgraded/
     
  8. jayseong

    jayseong

    Joined:
    Aug 21, 2018
    Posts:
    10
    I would like to grab the camera's activeTexture.GetNativeTexturePtr() and pass it to another client so it can render the camera on the client side. Since Camera.activeTexture is null after the LWRP upgrade, how would I go about in accessing the active camera texture?

    Read that the following might work, but its still rendering a black screen for me:

    Code (CSharp):
    1. var rt = RenderTexture.GetTemporary(Screen.width, Screen.height, 24);
    2.                 Texture2D actual = null;
    3.  
    4.                 try
    5.                 {
    6.                     Camera.main.targetTexture = rt;
    7.                     Camera.main.Render();
    8.                     Camera.main.targetTexture = null;
    9.  
    10.                     actual = new Texture2D(Screen.width, Screen.height, TextureFormat.ARGB32, false);
    11.                     RenderTexture.active = rt;
    12.                     actual.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);
    13.                     RenderTexture.active = null;
    14.  
    15.                     actual.Apply();
    16.  
    17.                     // At this stage, the texture "actual" can be read form the CPU and contains what the camera sees.
    18.                     m_androidJavaObjectRenderCallback.Call("onFrameResolved", actual.GetNativeTexturePtr().ToInt32());
    19.                 }
    20.                 finally
    21.                 {
    22.                     RenderTexture.ReleaseTemporary(rt);
    23.                     if (actual != null)
    24.                         UnityEngine.Object.Destroy(actual);
    25.                 }
     
  9. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    792
  10. jayseong

    jayseong

    Joined:
    Aug 21, 2018
    Posts:
    10
    Thanks for the prompt response jimmya. The link looks like a way to "Accessing the Camera Image on the CPU". However, I need to access the camera image on the GPU. I have tried the code in the link and the rendering is very laggy and distortioned, not exactly what I am looking for. I should have mentioned I am trying to access the AR camera image (using the latest ARFoundation XR Preview 22 and ARCore Preview 24).

    Before the LWRP update I was able to access it by simply doing Camera.main.activeTexture.
    After LWRP, Camera.main.activeTexture is always NULL.

    Isn't there a simple way to access the AR camera image using LWRP?
     
    Last edited: Jan 23, 2019
  11. Philip-ACN

    Philip-ACN

    Joined:
    Oct 25, 2018
    Posts:
    20
    You hero!

    I'd buy you a cookie, but i'll just change my facebook profile picture to include a "sending cookies" slogan instead. :)
     
  12. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    381
    This is not possible in LWRP atm. The reason is that, although the camera target texture is available, it's only exposed as an opaque handle, not the actual RenderTexture.

    We plan to move away from CommandBuffer.GetTemporaryRT to an alternative that allow us non opaque handles. Then with that we can expose this to you.
     
  13. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    792
    FWIW, you are copying the texture into the CPU above when you do ReadPixels and Apply.
     
  14. jayseong

    jayseong

    Joined:
    Aug 21, 2018
    Posts:
    10
    I understand that, however although "actual" contains the texture, it is still outputting a black screen. I've try removing the code within "finally" where it destroys "actual" to no avail.

    Must also add that I am looking for a solution where it doesnt need to manually readpixels every frame, rather set it up like a render texture where it assigns the texture to the camera's targetTexture, and then pass a reference of this texture to another client for it to render the Unity camera (or even better, pass the reference to the camera's activeTexture, but apparently this is not possible).

    Thanks phil_lira, it sounds like there is no way to achieve this using LWRP.

    EDIT: It appears the problem lies on LWRP & ARFoundation which forces you to "Use Custom Renderer Asset". If this field is left unchecked, it works as expected. So the issue exists only when using both LWRP in conjunction with ARFoundation.
     
    Last edited: Feb 5, 2019
  15. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    153
    Just updated my project from LWRP 3.3.0 to 4.8.0 and now getting an error:
    LWRPBeforeCameraRender.cs error CS0246: The type or namespace name 'IBeforeRender' could not be found
     
  16. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    792
    That usually means that your Package Cache may need to be cleared out. Go to your <PROJECT_FOLDER>/Library/PackageCache/ folder and delete all the folders there and then restart Unity and load your project.
     
  17. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    166
    If I want to use LWR with just the standard unityarkit plugin, how would I go about this?
     
  18. AB00531937_techm

    AB00531937_techm

    Joined:
    Jan 17, 2018
    Posts:
    1
    Hi All,

    I am getting this error while building in XCode. Can you please help me to resolve this problem.

    Code (CSharp):
    1. Undefined symbols for architecture arm64:
    2.  
    3.   "_UnityARKit_FaceProvider_TryGetFaceMeshIndices", referenced from:
    4.  
    5.       _ARKitFaceSubsystem_UnityARKit_FaceProvider_TryGetFaceMeshIndices_m7A6FE458C958BF11AE24CA3274F463FD49C09BA2 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    6.  
    7.       _ARKitFaceSubsystem_TryGetNativeFaceMeshIndices_m8378B9A3DF4C4ED0CFEA79A47DA170DCB2141785 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    8.  
    9.     (maybe you meant: _ARKitFaceSubsystem_UnityARKit_FaceProvider_TryGetFaceMeshIndices_m7A6FE458C958BF11AE24CA3274F463FD49C09BA2)
    10.  
    11.   "_UnityARKit_FaceProvider_TryGetFaceMeshVertices", referenced from:
    12.  
    13.       _ARKitFaceSubsystem_UnityARKit_FaceProvider_TryGetFaceMeshVertices_mDB45907AF6B2DAC520DDAB919E284C17811C9735 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    14.  
    15.       _ARKitFaceSubsystem_TryGetNativeFaceMeshVertices_m905544AB03379E3DF56E27ABB45416E4D032D866 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    16.  
    17.     (maybe you meant: _ARKitFaceSubsystem_UnityARKit_FaceProvider_TryGetFaceMeshVertices_mDB45907AF6B2DAC520DDAB919E284C17811C9735)
    18.  
    19.   "_UnityARKit_FaceProvider_Stop", referenced from:
    20.  
    21.       _ARKitFaceSubsystem_UnityARKit_FaceProvider_Stop_m954FB8F865E3061633A492C20A8B428BCB36F51B in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    22.  
    23.       _ARKitFaceSubsystem_Stop_m1AAF46F54485390743C94368A40483C989F780A6 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    24.  
    25.     (maybe you meant: _ARKitFaceSubsystem_UnityARKit_FaceProvider_Stop_m954FB8F865E3061633A492C20A8B428BCB36F51B)
    26.  
    27.   "_UnityARKit_FaceProvider_Start", referenced from:
    28.  
    29.       _ARKitFaceSubsystem_UnityARKit_FaceProvider_Start_mC62F8D50FCF282BE1305CB02D2058473A2EB7CBD in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    30.  
    31.       _ARKitFaceSubsystem_Start_mB474E9813C911E7B3464E3256A322DAEC2717D01 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    32.  
    33.     (maybe you meant: _ARKitFaceSubsystem_UnityARKit_FaceProvider_Start_mC62F8D50FCF282BE1305CB02D2058473A2EB7CBD)
    34.  
    35.   "_UnityARKit_FaceProvider_TryGetAllFaces", referenced from:
    36.  
    37.       _ARKitFaceSubsystem_UnityARKit_FaceProvider_TryGetAllFaces_m020D1DDA108F03FE88F5ADB91D71F7BE25DF2C21 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    38.  
    39.       _ARKitFaceSubsystem_TryGetNativeAllFaces_mE0E1C845A424571DE67EABF45FEA4DB941120B4D in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    40.  
    41.     (maybe you meant: _ARKitFaceSubsystem_UnityARKit_FaceProvider_TryGetAllFaces_m020D1DDA108F03FE88F5ADB91D71F7BE25DF2C21)
    42.  
    43.   "_UnityARKit_FaceProvider_TryGetFaceMeshUVs", referenced from:
    44.  
    45.       _ARKitFaceSubsystem_UnityARKit_FaceProvider_TryGetFaceMeshUVs_m98966A83FEE4630DE054B1BFB64ABE0C40EB5DA4 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    46.  
    47.       _ARKitFaceSubsystem_TryGetNativeFaceMeshUVs_m82A19E753759869AECD51161E253A603DF88BED5 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    48.  
    49.     (maybe you meant: _ARKitFaceSubsystem_UnityARKit_FaceProvider_TryGetFaceMeshUVs_m98966A83FEE4630DE054B1BFB64ABE0C40EB5DA4)
    50.  
    51.   "_UnityARKit_FaceProvider_Shutdown", referenced from:
    52.  
    53.       _ARKitFaceSubsystem_UnityARKit_FaceProvider_Shutdown_mC8D639F7AEBDED8A050942382892B17D4740EA9E in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    54.  
    55.       _ARKitFaceSubsystem_Destroy_m745B75DAD42DF40450B3CBA8FB33A87C087ABC86 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    56.  
    57.     (maybe you meant: _ARKitFaceSubsystem_UnityARKit_FaceProvider_Shutdown_mC8D639F7AEBDED8A050942382892B17D4740EA9E)
    58.  
    59.   "_UnityARKit_FaceProvider_SetFaceAnchorCallbacks", referenced from:
    60.  
    61.       _ARKitFaceSubsystem_UnityARKit_FaceProvider_SetFaceAnchorCallbacks_m951AB71674E37F07CF5D28697F4A712F069236CC in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    62.  
    63.     (maybe you meant: _ARKitFaceSubsystem_UnityARKit_FaceProvider_SetFaceAnchorCallbacks_m951AB71674E37F07CF5D28697F4A712F069236CC)
    64.  
    65.   "_UnityARKit_FaceProvider_Initialize", referenced from:
    66.  
    67.       _ARKitFaceSubsystem__ctor_mC6439CD04A82E490E6463EC32FC4AE2317744054 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    68.  
    69.       _ARKitFaceSubsystem_UnityARKit_FaceProvider_Initialize_m6D6491C57F7AB25359EE5D12F1BDACDA1F9B2636 in Bulk_Unity.XR.ARKit.FaceTracking_0.o
    70.  
    71.     (maybe you meant: _ARKitFaceSubsystem_UnityARKit_FaceProvider_Initialize_m6D6491C57F7AB25359EE5D12F1BDACDA1F9B2636)
    72.  
    73. ld: symbol(s) not found for architecture arm64
    74.  
    75. clang: error: linker command failed with exit code 1 (use -v to see invocation)
    76.  
    77.  
     
  19. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    166
    I use SDKs that piggyback off of unityarkit, and have to wait for them to support arfoundation until I can use this fix.

    Thats why I ask, and LWR is too powerful to not be using. Going back to projects that dont support it, is like living in the shader stone age.
     
  20. n1ghtbird

    n1ghtbird

    Joined:
    Nov 6, 2018
    Posts:
    6
    Hi all,
    having a strange problem with rendering shadows in my scene. I have tried adjusting LWRP settings but with no luck. Maybe you might be able to suggest a solution.

    Here is a iOS device screenshot, and editor screenshot as to how it should look.



    It looks almost like the shadows have been inverted.

    The problem persists with and without PostProcessing activated.

    These are the shadow settings in LWRP Asset:
    - Shadow distance 250
    - 4 Cascades
    - Depth Bias 1
    - Normal Bias 1

    I also tried:
    - varying the depth bias.
    - disabling and enabling MSAA in the LWRP settings. (HDR and MSAA are off on the camera)

    There is a single directional light in the scene, and I tried varying light estimation on and off.

    My Setup:
    MacOS
    Unity 2018.3.0f2
    ARFoundation 1.0.0.preview.22
    ARKit XR Plugin 1.0.0-preview.23
    Lightweight RP 4.9.0-preview
     
    Last edited: Feb 6, 2019
  21. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    177
    This is a very common mistake people make, be sure to check your per-platform quality settings (the green ticked box is the default for your platform.
     
  22. n1ghtbird

    n1ghtbird

    Joined:
    Nov 6, 2018
    Posts:
    6
    Thanks for the suggestion @ROBYER1. I have tried changing quality settings to the High, and Very High as default for mobile, but this hasn't made a difference unfortunately. Also tried changing the shadow resolution settings as well but that didn't work either.

    UPDATE: I created a clean LWRP project and imported the ARFoundation Sample with LWRP Support. Using the sample scene I managed resolve this. Thanks for your help.
     
    Last edited: Feb 7, 2019
    ROBYER1 likes this.
  23. real2u

    real2u

    Joined:
    Jun 20, 2018
    Posts:
    13


    Hi there,

    We have this happening on our project and we can´t understand the reason.

    This is our scriptableRP file

    We are not scaling the model, we are only scaling the ARSessionOrigin as taught in other topics.
    This is not related to the camera clipping plane, since we can still see the building. It looks very similar to vanishing realtime shadows, however part of the texture disappear as well and we have changed the shadow distance multiple times.

    Has anyone been using LWRP and found this issue as well?

    This is a VERY big model, maybe that´s the reason? Is there a magic number we can increase to stop this from happening?


    *UPDATE*


    This the SampleLWRPScene from https://forum.unity.com/threads/arfoundation-now-supports-lwrp-4-8-0-preview.615109/

    To replicate the error we set ARSessionOrigin scale to 667,667,667 and the Cube scale to 600,50,300 (to replicate the size of or building). Everything is baked, we can increase shadow distance and nothing happens :(

    *UPDATE2*
    To fix the issue, we just decreased the model size by 10 so this way the smaller size was closer to the camera, since we didn´t need to scale ARSessionOrigin that much.



    Thank you in advance guys
     
    Last edited: Feb 12, 2019
  24. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    153
    I've had the same experience with my model of 400meter by 350meter. Scaling the model is not an option as I will also have particles in there.

    I couldnt solve it so I had to switch back to standard pipeline
     
    real2u likes this.
  25. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    177
    Drats, was hoping that was a quick fix - I'm keeping an eye on the SRP stuff as I'd actually like to use it on a project sometime soon when it's as robust as the standard pipeline
     
  26. mdunk

    mdunk

    Joined:
    Jan 8, 2019
    Posts:
    1
    FWIW we're having what looks like this same problem as well. Wildly guessing, but seems like the geometry somehow gets inverted or otherwise incorrectly projected for shadow generation on IOS - haven't tried android. I *think* we're also seeing a variant of the problem in the vanilla sample off the git. Curious to know if anyone else has run into this.

    Engine vs IOS:
    ar_engine.png ar_device.png
    Test scene:
    placed_cube_2.png placed_cube.png
     
  27. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    166
    arfoundation + lwr is making my camera quality EXTREMELY grainy. In vuforia with lwr it looks perfect, but once i swap it with arfoundation, it looks terrible.

    The 3d models look fine, its just the phone camera

    Any advice? My quality settings are set to max
     
    Last edited: Feb 16, 2019
  28. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    166
    arfoundation and LWR seems to have a very grainy camera feed. I was thinking it was because i didnt have the cameraoptions script attached to anything, so there was no autofocus happening.

    When I add, the camera feed goes black. Most likely due to the LWR support using a special ar camera background texture to make this possible and autofocus not playing nice with it.
     
    Last edited: Feb 16, 2019
    ROBYER1 likes this.
  29. virtualHCIT

    virtualHCIT

    Joined:
    Aug 20, 2018
    Posts:
    13
    How do we get shadows on transparent planes (shadow matte) to work with LWRP and AR Foundation?
     
    Futurristic, Saicopate and arielfel like this.
  30. n1ghtbird

    n1ghtbird

    Joined:
    Nov 6, 2018
    Posts:
    6
    If Im not mistaken this feature has not yet been implemented in the framework, but someone please correct me if I am wrong. Have a look at this discussion and proposed solution:
    https://forum.unity.com/threads/transparent-shader-receive-shadows.325877/
     
    virtualHCIT likes this.
  31. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,320
    Great news! Does this automatically mean support for latest ARCore and ARKit?
    The reason I ask is that in the Feature comparison and roadmap chart,
    while LWRP 3.30 is indicated as being supported in ARFoundation, both ARCore and ARKit are listed as 'in development'.

    Additionally, what would be really useful in troubleshooting is a master list with all the project level changes and differences between a 'regular' ARFoundation project using nonscriptable Render pipeline with Standard Shader and the newer LWRP.
     
    Last edited: Mar 7, 2019
  32. brgishy

    brgishy

    Joined:
    Jul 9, 2013
    Posts:
    19
    Hi @jimmya, thanks so much for the LWRP AR Foundation sample. I've been wanting to add LWRP to my AR project for a while now, so I'm pretty stoked.

    I am running into a bug with it though and I'm not sure how to fix it. I'm curious if anyone else in the forums has run into this bug as well. I've attached a simple unity project that demonstrates the bug (arfoundation-lwrp-multiple-cameras.7z).

    In my project I have a camera that's only job is to render the UI. I set the Culling Mask to UI and the Clear Flags to Depth Only.

    When I open the SimpleAR scene, remove the LWRP Asset from the Graphics settings and then build and run on my device, everything works great. I can see my text at the top of the screen and see the camera feed.

    Non-LWRP Setup.png

    But, When I open the SampleLWRPScene scene, hook up the LWRP Asset file in Graphics settings and make a build. When I run it on my android device I do see my text, but instead of seeing the camera feed I only get a blue screen (the same color as my UI camera's clearing color).

    LWRP Setup.png

    Anyone have any ideas of the best way to fix this?

    Thanks in advance,

    Brian
     

    Attached Files:

  33. phili_maas

    phili_maas

    Joined:
    Dec 11, 2016
    Posts:
    21
    I really hope there is an update coming soon for latest unity, lwrp and arkit/core.
    Arkit tracking and lwrp works in latest 2019 but I also don't get the camera feed and don't know how to fix. Although for people understanding the renderpipline it shouldn't be to hard to adapt the lwrp support branch to the latest lwrp version?!
     
    ROBYER1 and Blarp like this.
  34. xvart

    xvart

    Joined:
    Dec 12, 2010
    Posts:
    21
    @jimmya is there a timeline for non-preview Lightweight RP integration the AR Foundation?
     
    newguy123 and Blarp like this.
  35. jinC_H

    jinC_H

    Joined:
    Aug 29, 2017
    Posts:
    4
    just simple cant create custom render assets!

    Assets>Create>XR>LWRPBackgroundRendererAsse does not exist
     
  36. jinC_H

    jinC_H

    Joined:
    Aug 29, 2017
    Posts:
    4
    just for the record, Assets>Create does exist! the rest are not
     
  37. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    166
    winstonmso and edee1337 like this.
  38. edee1337

    edee1337

    Joined:
    Apr 10, 2013
    Posts:
    14
    Blarp likes this.
  39. fotalik

    fotalik

    Joined:
    Sep 23, 2017
    Posts:
    24
    unnanego and Blarp like this.
  40. winstonmso

    winstonmso

    Joined:
    Apr 2, 2018
    Posts:
    2
    i can't get anything to work on the UNity 2019.1, Ar samples just loads black screen when deployed to Phone. Has anyone here made it work with the latest LWRP?
     
    Blarp likes this.
  41. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    60
    current version is not yet supported, the topic is about the version 4.8.0
     
  42. todds_unity

    todds_unity

    Unity Technologies

    Joined:
    Aug 1, 2018
    Posts:
    38
  43. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    103
    Hi friends,

    Excited for the great work for LWRP on AR Foundation, thanks !

    But I'm at the end of the rope here, maybe someone can help please?!


    How to make transparent planes with shadows? I don't code shaders and I don't see a solution on shader graph, forums or web, this is the closest but incomplete and doesn't work: https://forum.unity.com/threads/lwrp-shadows.652024/


    I moved to LWRP because building with built-in render pipeline for iOS (AR Foundation or UnityARKit plugin) produces JobTempAlloc error still today.

    Apple rejected my app from publishing in December and had to remove shadows. https://github.com/Unity-Technologies/arfoundation-samples/issues/85

    Unfortunate because Joaquim Ante considers the warning not fatal but Apple does :( https://forum.unity.com/threads/help-debugging-internal-jobtempalloc-warning.544412/


    No shadows on planes kills quite a few AR experiences. Thanks a ton for your ideas !

    Happy to upload on git/bitbucket projects of different versions with the error if that helps.

    Cheers, Sergio
    Tested on ARFoundation lwrp branch 2018.3.07 to 2018.3.12f1; Unity ARKit Plugin 2019.1.0b8 and 2019.2.0a9
     
    Last edited: Apr 20, 2019
  44. fotalik

    fotalik

    Joined:
    Sep 23, 2017
    Posts:
    24
    @Tarrag Hi)
    In comments below this video

    And I'm waiting for this, I think this is a problem for few weeks.
    upload_2019-4-22_15-35-46.png
     
    Tarrag and ROBYER1 like this.
  45. jakobskote

    jakobskote

    Joined:
    Feb 15, 2017
    Posts:
    37
    Does anyone know if there's a workaround that allows AR foundation LWRPSupport to work with LWRP 5.7.2?

    I was hoping to be able to use the VFX Graph with AR foundation (imagine the possibilities!) VFX Graph 5.13.0 works with LWRP 5.7.2, and runs surprisingly smooth on mobile, but not with 5.6.1.

    When I update LWRP to 5.7.2 I get these 5 errors on the LWRPSupport scripts:
    Code (CSharp):
    1. Assets/LWRPSupport/LWRPBackgroundRenderPass.cs(4,42): error CS0234: The type or namespace name 'LWRP' does not exist in the namespace 'UnityEngine.Experimental.Rendering' (are you missing an assembly reference?)
    2. Assets/LWRPSupport/LWRPBeforeCameraRender.cs(3,42): error CS0234: The type or namespace name 'LWRP' does not exist in the namespace 'UnityEngine.Experimental.Rendering' (are you missing an assembly reference?)
    3. Assets/LWRPSupport/LWRPBackgroundRenderPass.cs(42,30): error CS0115: 'LWRPBackgroundRenderPass.Execute(ScriptableRenderer, ScriptableRenderContext, ref RenderingData)': no suitable method found to override
    4. Assets/LWRPSupport/LWRPBackgroundRenderPass.cs(8,18): error CS0534: 'LWRPBackgroundRenderPass' does not implement inherited abstract member 'ScriptableRenderPass.Execute(ScriptableRenderContext, ref RenderingData)'
    5. Assets/LWRPSupport/LWRPBeforeCameraRender.cs(7,55): error CS0246: The type or namespace name 'IBeforeRender' could not be found (are you missing a using directive or an assembly reference?
     
  46. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    166
    I'm in same boat.

    Pretty much assumed we won't get it until arf&lwrp reach usability at the highest version again.

    I've been having to edit the manifest for unity to import the 5.6.1 shadergraph & lwrp packages. (since they dont show up in package manager) Kind of annoying
     
    jakobskote likes this.
  47. Tonieh085

    Tonieh085

    Joined:
    Nov 25, 2016
    Posts:
    14
    Same problem here, I have the VFX installed, but the camera renders black and the VFX looks bad.
    The new library for LWRP is UnityEngine.Rendering.LWRP intstead of UnityEngine.Experimental.Rendering. If you change it, it fix some errors, but other functions have issues.

     
    Last edited: Apr 28, 2019
    jakobskote and shifugate like this.
  48. MartinGebske

    MartinGebske

    Joined:
    Jun 18, 2013
    Posts:
    13
    Since LWRP is "production ready" I'm missing the LWRPBackgroundRendererAsset for Android. Well. I kinda know where it's located. (Packages/com.unity.xr.arfoundation/Runtime/AR/ARBackgroundRenderAsset) is this correct? BUT HOW can I assign it (or the correct one) to the AR Camera Background on my AR Camera?!
     
    ROBYER1 likes this.
  49. shawww

    shawww

    Joined:
    Sep 30, 2014
    Posts:
    42
    @MartinGebske Go to Github, search for ARFoundation Samples, switch to the 2.1-preview branch
     
    Tarrag likes this.
  50. jcfalcone89

    jcfalcone89

    Joined:
    Jun 17, 2015
    Posts:
    9
    Any idea when the Support for the LWRP 5.7 will be done? Have being waiting it for a while to finish my game