Log in or register to post comments

OnRenderImage + QCAR Slowdown

February 10, 2012 - 2:26am #2

I seem to be having an issue with calls in the profiler to RenderTexture.GrabPixels when using OnRenderImage()

Using OnRenderImage without QCAR on iOS, or with QCAR in the editor doesnt create any GrabPixel calls. I suspect it might be related to how the plugin is drawing the background, but this is my first unity project so I dont understand enough to determine if this is a bug, my mistake, or just an unfortunate collision of calls to the same hardware/software.

In the below image you can see the profiler displaying the QCARFramemarkers example scene - first as it appears in the default package, and the second half with an empty

function OnRenderImage (source : RenderTexture, destination : RenderTexture) {
}

attached to the ARCamera.

http://i.imgur.com/HlgBW.png

I began this thread on the Unity forums:
http://forum.unity3d.com/threads/122815-OnRenderImage-slow-RenderTexture.GrabPixels

Re: OnRenderImage + QCAR Slowdown

February 10, 2012 - 3:00pm #1

I recommend using the new video texture access feature of the 1.5 beta. This will let you render the camera image as a Texture2D in Unity rather than let QCAR render it natively behind the scenes. This approach plays better with the Unity rendering pipeline for certain use cases.

See the new VideoBackgroundAccess sample as a starting point.

- Kim

Log in or register to post comments