# camera.outputRenderTarget doesn't work

**URL:** <https://forum.babylonjs.com/t/camera-outputrendertarget-doesnt-work/35937>\
**Category:** Questions\
**Tags:** camera\
**Created:** [November 23, 2022, 7:12am UTC](https://forum.babylonjs.com/t/camera-outputrendertarget-doesnt-work/35937 "2022-11-23T07:12:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecojust](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ecojust/32/12884_2.png) [@ecojust](https://forum.babylonjs.com/u/ecojust)\
**Post date:** [November 23, 2022, 7:12am UTC](https://forum.babylonjs.com/t/camera-outputrendertarget-doesnt-work/35937/1 "2022-11-23T07:12:39Z")

</div>

> **[Babylon.js Playground](https://playground.babylonjs.com/#L92PHY%23258)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/9/495db7445541982d930fc39a47627d9e22d8267a.png)

it seems that pipcamera doesn’t render to rtt ???

---

<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:** [November 23, 2022, 9:59am UTC](https://forum.babylonjs.com/t/camera-outputrendertarget-doesnt-work/35937/2 "2022-11-23T09:59:46Z")

</div>

You must not call `rtt.render`. The scene will be rendered automatically in the RTT because it is attached to the `pipCamera` output:

> **[Babylon.js Playground](https://playground.babylonjs.com/#L92PHY%23259)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Note that I have commented the line 73 as you probably want the plane to be fully visible in the RTT.

---

<div class="post-metadata">

**Author:** ![ecojust](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ecojust/32/12884_2.png) [@ecojust](https://forum.babylonjs.com/u/ecojust)\
**Post date:** [November 23, 2022, 1:04pm UTC](https://forum.babylonjs.com/t/camera-outputrendertarget-doesnt-work/35937/3 "2022-11-23T13:04:52Z")

</div>

> **[Babylon.js Playground](https://playground.babylonjs.com/#L92PHY%23263)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

I’m sorry to bother you again.  
I seem to have a new problem.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/8/789584c3254d422fbcbef5780b56293b5197a259.jpeg) ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/1/91628e822077386f915f37259b306d659f029219.jpeg)

At certain angles, the plane will disappear

---

<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:** [November 23, 2022, 6:32pm UTC](https://forum.babylonjs.com/t/camera-outputrendertarget-doesnt-work/35937/4 "2022-11-23T18:32:12Z")

</div>

You have some errors in the console:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/d/cd50afdaf9faa83a1a3687148f7a81355b34cbc7.png)

That’s because you can’t use a texture as an input and an output in the same pass: that’s what happens to the RTT when it is used as a diffuse texture for the miniMap and the miniMap is rendered into the RTT texture.

So, you need a third camera to render the scene from the top to the RTT and use the pipCamera to render the minimap plane. As I did not fully understand what you did in your PG, I reworked a bit the PG:

> **[Babylon.js Playground](https://playground.babylonjs.com/#L92PHY%23270)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

The pipCamera is now an ortho camera that does not move and which only renders the minimap plane and I used a simple standard material for the minimap plane.

---

<div class="post-metadata">

**Author:** ![ecojust](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ecojust/32/12884_2.png) [@ecojust](https://forum.babylonjs.com/u/ecojust)\
**Post date:** [November 24, 2022, 2:21pm UTC](https://forum.babylonjs.com/t/camera-outputrendertarget-doesnt-work/35937/5 "2022-11-24T14:21:55Z")

</div>

> [@Evgeni\_Popov](#):
>
> As I did not fully understand what you did in your PG

In fact,I have always wanted to make a custom minimap that is more beautiful.

I tried using viewports for both cameras;  
I’ve tried exporting the scene as image, working with the dom to handle the styles；  
In the end, I think a shader would be a great choice.

Now, with your help, I think I’ve done what I wanted，thank you very much !

If I have time in the future, I think I will continue to optimize this minimap to make it look even more cool

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/0/600b5a4e3d13c688146dca54c6aaf95f0be09823.jpeg)

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/a/7aa9c9b6e619170e2462ec76061e2ca7345311ac.jpeg)

> **[Babylon.js Playground](https://playground.babylonjs.com/#L92PHY%23276)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes
