How do you get the EasyAR camera to work with Universal Render Pipeline on Unity

+1 vote
asked Jul 6, 2021 by taitex (240 points)
I'm using the latest EasyAR Sense 4.3. It will not provide a camera image with the Universal Render Pipeline. It does work with the old Standard renderer. But in need to use URP in my project.

1 Answer

0 votes
answered Jul 17, 2021 by kenn (18,750 points)
selected Jul 25, 2021 by taitex
 
Best answer
URP will be supported built-in starting from version 4.4.

You can also make it happen in older versions if you are familiar with SRP. Create a ScriptableRendererFeature and setup a BeforeRenderingOpaques render pass, draw a mesh like what is done in CameraImageRenderer by reusing its material, then add this render feature to your Forward Renderer asset.
commented Jul 19, 2021 by realvi (140 points)
Do you have an estimated release date for 4.4?

Also, will it's built-in support use a custom renderer?
commented Jul 19, 2021 by kenn (18,750 points)
4.4 is scheduled this quarter.

A custom render pass will be used. If this is what you mean.
commented Jul 25, 2021 by taitex (240 points)
I looked at lots of sample code for ScriptableRenderFeature and your CameraImageRender. I could not get it working such that EasyAR would draw the camera image into it. Can you provide the ScriptableRenderFeature class you've already written that does this?
Spend days on this already. We would prefer to make progress using EasyAR now. Since you already have this working we could move forward and not have to wait until the next release. It is holding up development and some in the group would like to switch to a different AR package as a result.
Can you help?
commented Jul 25, 2021 by kenn (18,750 points)

We are making a plugin for all possible conditions so there are some related changes in a few other places, which is also the reason I did not paste code here in the first answer. 

You can reference the render features of Unity's AR Foundation, it is quite similar. And also, a brute force way could be like this, it loops all cameras, so use with caution,
foreach (var cb in renderingData.cameraData.camera.GetCommandBuffers(CameraEvent.BeforeForwardOpaque)) { context.ExecuteCommandBuffer(cb); }
commented Nov 8, 2021 by kenn (18,750 points)
Update: version 4.4 has released with URP support.
commented Nov 12, 2021 by D3m0n92 (210 points)
CustomRenderPass for EasyAR is not present in 4.4...

PS: My mystake, i use 4.3.
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...