Performance on RenderTargetTexture vs multiple active cameras

Hello everyone,

I’m in the quest of making a minimap for my game. I’ve realized that there are two main approaches to achieving this. Mainly using a RenderTargetTexture (RTT) or pushing the new camera into the scene’s active cameras and setting the viewport correctly.

Here are two PGs that demonstrate both approaches:

For my project, I have opted for the RTT approach and, while it works as I had expected it, I’ve noticed a considerable performance issue on lower end devices (my GF’s phone :slight_smile:, an UMIDIGI A7 pro). On the other hand, on my phone (Ulefone Armor 6) and on my laptop, the strike on performance isn’t that noticeable (if at all).

So I was wondering if the other approach (an additional active camera) would run smoother on lower-end devices or if, on the other hand, it would be pretty much the same. Basically, is there a performance difference between the two approaches? If so, is it noticeable enough?

Thanks in advance.

I think the best way to know is to test, as you have the two PGs at hand.

I would not expect a big difference between both methods, as on Babylon side the same thing is happening (a clearing + a rendering of the scene). Now, when testing, you should use the same width/height for the RTT than the width/height you set for the viewport when using a 2nd camera. On low end device, even a texture/framebuffer clear can take some time I think.

1 Like

Thanks! I’ll try and see. I was expecting there not to be a big different as well.

If I understand it correctly, both the RTT and the viewport will render at the same rate as the main scene. Do you know if it is possible to reduce the fps on either of those? So that the RTT (or the additional viewport) will update at, say, 20 or 30 times per sec. Whilst the main scene would still render at 60fps.

In the end, it is just a minimap which doesn’t need to update that fast.

I don’t think it is possible to reduce the fps with the additional viewport method, but you can do it with a RTT through the refreshRate property.

2 Likes

Thanks a lot! I think that will solve the issues I’m having in lower end devices as well