google-ar / arcore-unity-sdk

ARCore SDK for Unity
https://developers.google.com/ar
Other
1.4k stars 402 forks source link

Lightweight Render Pipeline (LWRP) AR background stays black #131

Open gitunit opened 6 years ago

gitunit commented 6 years ago

in unity 2018.1b one can use the lightweight render pipeline. i was able to port the background shader, however it stayed black and only feature points were visualized. would be awesome if we had a working background shader that is compatible with the lightweight render pipeline.

pablisho commented 6 years ago

Thanks for the feature request. We'll be looking into 2018.1 support for next releases.

iBicha commented 6 years ago

@gitunit There is a quick way to support the lightweight render pipeline. These changes works for me. In LightweightPipeline.cs#L513 replace

if (m_CurrCamera.clearFlags == CameraClearFlags.Skybox)
    context.DrawSkybox(m_CurrCamera);

with

if (m_CurrCamera.clearFlags == CameraClearFlags.Skybox)
    context.DrawSkybox(m_CurrCamera);
else if (m_CurrCamera.clearFlags == CameraClearFlags.Depth && m_CurrCamera.commandBufferCount > 0)
{
    var commands = m_CurrCamera.GetCommandBuffers(CameraEvent.BeforeForwardOpaque);
    foreach (var cmd in commands)
    {
        context.ExecuteCommandBuffer(cmd);
    }
}

Let me know if this works for you.

Edit: for deferred rendering path, the event would be CameraEvent.BeforeGBuffer, so maybe check commands with both events.

gitunit commented 6 years ago

@iBicha it works. thx for the quick fix. edit: though now all foreground objects are transparent.

ice-github commented 5 years ago

In LightweightPipeline.cs#L513 replace

the link isn't available now. Does anyone know the revision of the code?

FejZa commented 5 years ago

Any news on this?

gakabes commented 5 years ago

Any update on this? I switched from ARFoundation to ARCore for augmented images, but the lack of LWRP support is a bummer.

michaelybecker commented 5 years ago

+1. I know Unity wants to funnel handheld mobile devs towards ARFoundation but ARCore currently has far superior remoting tools and having a clear pathway to using it w/LWRP would be extremely helpful.

uffeflarup commented 5 years ago

Same question here: Is there any news on supporting LWRP when using ARCore?

Thanks a lot in advance.