Get AR Scene Camera output to Texture / Material + to Camera

Include the following details (edit as applicable):

  • Issue category: ARDK Camera
  • Device type & OS version: iOS /
  • Host machine & OS version: Mac M1, Ventura
  • Issue Environment : Unity Remote / Unity Mock / On Device
  • Xcode version:
  • ARDK version: 2.3.0
  • Unity version: 2022.1.23f1

Description of the issue:

Hi y’all,

in the AR Scene Camera → AR Rendering Manager, you have the option to either Render Target Camera or Texture. I want to render to camera and at the same time send the image to a texture/material to set it as an canvas image texture to another camera that does other AR Calculations.

I already set everything up but can’t do both renders at the same time.
Also read the Android plugin thread about ARKitFrameRenderer.cs but that explanation did not really help me (Still new to Unity).

Grateful for any advice! Thanks a bunch in advance.

Hey @Tobias_Reidl
I had the same issue a while ago. I solved it by “blitting” the graphics from a camera view to a render texture. This way you can keep an up to date copy of your AR view and use it at multiple places at once. Unity - Scripting API: Graphics.Blit

With ARDK i ended up setting the AR Randering manager to camera and copying the camera texture this way to use it on a second screen (which we use at live events so people can see themselves in an AR environment).

Is your project running URP? Because in there you can’t use the standard Graphics.Blit() function, instead you’d have to use a rendererfeature to get it working, i did this last month using this as a starting point: GitHub - Cyanilux/URP_BlitRenderFeature: Blit Render Feature for Universal RP's Forward Renderer. Set specific source/destination via camera source, ID string or RenderTexture asset. Also options for _InverseView matrix and _CameraNormalsTexture generation. (if that’s not clear i can show you how i implemented it)

2 Likes

Thank you mate, still not got it working. Maybe the other package I use got some issues…

Hello Tobias Reidal,
Has this issue been solved after updating to the latest ARDK or is there further assistance required?

Hi mate sorry for the late answer, yes I used the Graphics.Blitt for the GPU texture and it worked :slight_smile: