RenderTexture.GrabPixels = Low FPS [SOLVED]

Hi guys,

Currently I’m having a issue with a iOS build, using unity latest.
The problem is when building the game on iOS Ipad Air, latest iOS 7.1.2

Camera.Render and Drawing →
Camera.AAResolve → RenderTexture.GrabPixels

Seems to be killing the CPU

Screenshot of Profiler:
http://postimg.org/image/ic4ct5o6l/857a690d/

We assume this is something to do with the Depth of Field effect used, but we used 3rd party to reduce the CPU drain on iOS.

Any ideas how to debug this further or help improve FPS but maintain Depth of Field and current effects?

Thank you

1 Like

or help improve FPS by maintain Depth of Field and current effects
draw NOT to screen but to render target and blit to screen yourself in the end

Alexey, thanks for your reply, I just did some more testing, without changing any code:

iphone 5s - 27fps
iPad Air - 7fps

It seems its a issue with iPads. iPad Air is the most powerful device on the Apple family currently, only thing is different is screen size?

Any further ideas…

Ok so the issue was with our camera, we had for some strange reason;

CLEAR FLAGS: Depth Only

Changing this to solid color fixes performance and we get 60fps
Ah Unity, one little setting makes so much difference.

Hello,

I’m having this same issue, but it’s not as easy for me to solve. I’m using 1 camera to render a background and then another camera to render the foreground and I need to clear the depth buffer between. However when I run my full screen effect I get the slow down you described.

Does anyone know if this is a Unity issue, or an iPad issue?

I could render to a texture instead but that’s going to be a big memory hit. Any other clever workaround ideas?

Hi Simon, were you able to solve this? We have a similar issue.

Hi, I’m having the same problem.
Cameras in the scene with depth only configuration put the frame-rate in Ipad device to 3 fps.

1 Like

Seems to be either “depth only” or “don’t clear” that cause the problem.

But… I just tried keeping “depth only” setting enabled and simply made sure that “Occlusion Culling”, “Allow HDR” and “Allow MSAA” are all off and I’m getting a nice framerate now.

1 Like