URP 7.2.1 Camera Stack decrease performance on Android

The game running smoothly on a cheap-low Android device. After migrating to URP 7.2.1 with all minimum setting in Unity 2019.3.0f6, performance decrease down to 30FPS (no vsync, no setTargetFrameRate).
The Profiler and Frame Debugger Show an expected result on Editor but everything go crazy on Android device.

There are no such things like post-processing, the game screen just has two cameras using camera stack (FPS) game with specific layers renderer.

After several builds of testing, the issue may come from Camera stacking features. There are few things below will give the details:

  1. The FPS and total MS time:
    See picture 1 and 2, you can see the FPS dropdown to 40 and the MS add extra 10ms when use stack camera compare to no stack camera

    Picture1. Stacked camera with base camera render the map, overlay camera render only weapon layer.


Picture2. No stack camera even the overlay camera only has 5 drawcalls, all unlit.

  1. The profiler said stacked camera given double times for rendering and calculation: Picture 3. No stack camera only takes about 5-6ms


Picture 4. The stack camera takes it 2 times! About 10-11ms

  1. The URP Asset settings are really basic and minimum, no post-processing or luxury calculation added. See attached image named URP Setting
  2. The WeaponRenderer and MapRenderer are specific for the layer mask
  3. The camera setting is basically default and minimum

Then please help me figure out why Camera renderer like double times even Frame Debugger didn’t say that?

3 Likes

By default Application.targetFrameRate is 30 for mobile. So with VSync disabled, that’s what you should get if you don’t set target frame rate manually.

1 Like

Let me add clarify here, the targetFrameRate already set for 60, and without VSync. The game still runs at 60FPS when using Built-in Render
The key here that why SRP Batcher does a good job but the performance decrease on Android? It does not make sense.

Here is my configuration for camera stacking:

2 Likes

Bump this thread for update information!

Ah, then I misunderstood your problem.
Can you please make a bug report so that we can investigate?
Thanks!

When using camera stacking, the pipeline will create a working render texture that will be shared for all cameras. So essentially it will never render directly to framebuffer and will require a final blit pass to resolve to framebuffer. There are some optimizations improved planned to camera stacking in this sense. Opening a bug report is the way to go here, we will prioritize it.

In your case however, if you just need to use camera stacking to render the gun with a different projection, I strongly recommend rendering it by injecting a RenderObjects feature and overriding camera instead.

This will be more efficient as you will only do culling once per-camera and we have an example of how to do it here:

I already try but look like the gun still touch and go through the wall even I set the render queue higher.
5542039--570283--RendererObject.PNG.jpg

About the camera stack, bug case is 1224525

1 Like

Bump this thread to update bug case 1224525

>In your case however, if you just need to use camera stacking to render the gun with a different projection, I strongly recommend rendering it by injecting a RenderObjects feature and overriding camera instead.
At now RenderFeatures is useless for FPS Weapon rendering because it’s only allow to setup fov, but not a near/far plane.

Just for Render on top is ok, but FPS it’s not simple like that. I’m facing with ZoomIn/Out issue and moreover

>I’m facing with ZoomIn/Out issue and moreover
This because you can’t change fov from script? Actually you can

    public RenderObjects renderObjPass;
    renderObjPass.settings.cameraSettings.cameraFieldOfView = fov;

No, it’s about zoomIn/out need different config for scope. Which lead into:5548291--571165--Error.PNG

If I fix this, the gun never on top of the environment.

For easy understanding, I have a DepthMask which attached to the scope object, a part of a gun to render the environment and clear the scope mesh.
When changing the GunOpaques to BeforeRenderingPostProcessing queue the problem can be solved but the gun clipping the environment due to it should be BeforeRenderOpaques.

Rework on the scope or detach LensClipping which using for the attached DepthMask can solve the problem, but extra works are required and that’s not what I expected for the team.

Update information about it just because I don’t want to spam on the thread creation, following the demo and set it up, a little extra work needs to be done with DepthMask shader but the key here that both URP 7.1.8 and 7.2.1 still given bad performance vs built-in, see the picture below:
5555704--572392--URP-721-Vulkan.jpg
Picture 1. URP 7.2.1 with RendererObject to render GunTransparent and GunOpaques.

The gun uses URP unlit shader and batched into one SRPBatch but adds extra 6 ms for both URP 7.1.8 and 7.2.1. Both using Vulkan with Graphics Job and Multithread Rendering enable. Remember picture 2. on the #1 post, render the everything except the gun given 60 FPS with 16.5~ ms
5555704--572395--NoStacked .jpg
Picture 2. URP 7.2.1 render everything except the gun.

And also there are lots of differences between 7.2.1 and 7.1.8 as you can see below :
5555704--572398--URP-721-Vulkan-Profiler.png
Picture 3. URP 7.2.1 profiler
5555704--572407--URP-718-Vulkan-Profiler.PNG
Picture 4. URP 7.1.8 profiler

As you see, the URP 7.2.1 does some extra work like RenderCameraStack() cost extra 1.2ms even no camera stacked and only Base camera on the screen and RenderCamera has given more than ~3.3ms which is crazy on mobile! Both caused by add RenderObject.

I’m looking for stable URP for our project which at least given equal performance versus built-in, or fallback is needed just because our game is live production and we hope next update will release with URP.

1 Like

Bump this thread to update information about RenderObject.

2 Likes

I have the same issue. Is there any plan to fix the camera stacking performance issue?

1 Like

still nothing on this???

God damn, Epic’s please buy this small indie studio

1 Like

Did this performance issue on Android ever get resolved?

Any news about this?

@phil_lira This is a big issue, is there any news?