# Render to a RenderTargetTexture from another camera than main camera

**URL:** <https://forum.babylonjs.com/t/render-to-a-rendertargettexture-from-another-camera-than-main-camera/19034>\
**Category:** Questions\
**Created:** [March 9, 2021, 4:16pm UTC](https://forum.babylonjs.com/t/render-to-a-rendertargettexture-from-another-camera-than-main-camera/19034 "2021-03-09T16:16:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gonzague\_D](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gonzague_d/32/14751_2.png) [@Gonzague\_D](https://forum.babylonjs.com/u/Gonzague_D)\
**Post date:** [March 9, 2021, 4:16pm UTC](https://forum.babylonjs.com/t/render-to-a-rendertargettexture-from-another-camera-than-main-camera/19034/1 "2021-03-09T16:16:03Z")

</div>

Hey, im struggling a little bit with render targets, i come from threejs, i d like to know how to achieve that:

render the scene from another point of view to a render target,  
cause when i do use more than one camera i cant find a way to tell render target to only render with some specific camera

do you have an example/playground with that running?

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [March 9, 2021, 4:45pm UTC](https://forum.babylonjs.com/t/render-to-a-rendertargettexture-from-another-camera-than-main-camera/19034/2 "2021-03-09T16:45:15Z")

</div>

As far as I understood your question you may try to use Multiviews - [MultiViews Part 2 | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/cameras/multiViewsPart2)  
Here is the example with 3 cameras - [https://www.babylonjs-playground.com/#SVZL1I#65](https://www.babylonjs-playground.com/#SVZL1I#65)  
Also note that you can attach/detach control of every camera as you like to.

---

<div class="post-metadata">

**Author:** ![Gonzague\_D](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gonzague_d/32/14751_2.png) [@Gonzague\_D](https://forum.babylonjs.com/u/Gonzague_D)\
**Post date:** [March 9, 2021, 5:14pm UTC](https://forum.babylonjs.com/t/render-to-a-rendertargettexture-from-another-camera-than-main-camera/19034/3 "2021-03-09T17:14:45Z")

</div>

no really, if i ask this question its cause i got more complex stuff to do with the texture outputs from the render target, i’m building some kind of painter, the painter is on a 2D orthographic camera facing exactly the painting plane, then once rendered, i must use the rendertarget as a texture for a plane rendered normally from the main camera which is a perspective camera

so my question is really: is there some example where a second camera could be used only for a rendertarget, and the whole scene rendered by a first camera.

---

<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:** [March 9, 2021, 5:26pm UTC](https://forum.babylonjs.com/t/render-to-a-rendertargettexture-from-another-camera-than-main-camera/19034/4 "2021-03-09T17:26:17Z")

</div>

You can set the `activeCamera` property of the render target texture to use a different camera than the main scene camera:

[https://playground.babylonjs.com/#IMNCPH](https://playground.babylonjs.com/#IMNCPH)

---

<div class="post-metadata">

**Author:** ![Gonzague\_D](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gonzague_d/32/14751_2.png) [@Gonzague\_D](https://forum.babylonjs.com/u/Gonzague_D)\
**Post date:** [March 9, 2021, 5:41pm UTC](https://forum.babylonjs.com/t/render-to-a-rendertargettexture-from-another-camera-than-main-camera/19034/5 "2021-03-09T17:41:15Z")

</div>

ok weird then idk why my stuff doesnt work i though i did it the same, thank you i ll try to start back from your example
