# Performance on RenderTargetTexture vs multiple active cameras

**URL:** <https://forum.babylonjs.com/t/performance-on-rendertargettexture-vs-multiple-active-cameras/22568>\
**Category:** Questions\
**Created:** [July 23, 2021, 6:24am UTC](https://forum.babylonjs.com/t/performance-on-rendertargettexture-vs-multiple-active-cameras/22568 "2021-07-23T06:24:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![padronhosnai](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/padronhosnai/32/16700_2.png) [@padronhosnai](https://forum.babylonjs.com/u/padronhosnai)\
**Post date:** [July 23, 2021, 6:24am UTC](https://forum.babylonjs.com/t/performance-on-rendertargettexture-vs-multiple-active-cameras/22568/1 "2021-07-23T06:24:48Z")

</div>

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:

- RTT [https://www.babylonjs-playground.com/#1WROZH#163](https://www.babylonjs-playground.com/#1WROZH#163)
- Additional active camera [https://www.babylonjs-playground.com/#XCPP9Y#387](https://www.babylonjs-playground.com/#XCPP9Y#387)

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 🙂, 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.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [July 23, 2021, 8:29am UTC](https://forum.babylonjs.com/t/performance-on-rendertargettexture-vs-multiple-active-cameras/22568/2 "2021-07-23T08:29:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![padronhosnai](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/padronhosnai/32/16700_2.png) [@padronhosnai](https://forum.babylonjs.com/u/padronhosnai)\
**Post date:** [July 23, 2021, 9:49am UTC](https://forum.babylonjs.com/t/performance-on-rendertargettexture-vs-multiple-active-cameras/22568/3 "2021-07-23T09:49:13Z")

</div>

> [@Evgeni\_Popov](#):
>
> g, you sh

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.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [July 23, 2021, 10:07am UTC](https://forum.babylonjs.com/t/performance-on-rendertargettexture-vs-multiple-active-cameras/22568/4 "2021-07-23T10:07:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![padronhosnai](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/padronhosnai/32/16700_2.png) [@padronhosnai](https://forum.babylonjs.com/u/padronhosnai)\
**Post date:** [July 23, 2021, 10:13am UTC](https://forum.babylonjs.com/t/performance-on-rendertargettexture-vs-multiple-active-cameras/22568/5 "2021-07-23T10:13:29Z")

</div>

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