How to create recursive mirror like rendering with RenderTargetTexture?

I have a plane with a render target texture applied to it. When I view the plane using the camera assigned to the render target texture, the plane is excluded from the render target’s computation. As a result, the image formed is not recursive. How to get the infinite mirror image look

https://playground.babylonjs.com/#QDFHH7#2

current output:

the output should look similar to the images below:


You will have to do as many rendering as bounces.
See How to create recursive reflections? for eg.

2 Likes

You could calculate also the positions and rotations of the mirrored mirrored mirrored… objects yourself at a location beyond your current scene and then project the view of the work camera onto a plane in your scene.

codingwizzard.github.io/CodingCrusader/tickets/backlog/mirrorArt1.html

How to project a camera view onto a plane

1 Like

I tried creating a multiple planes to fake recursion, yet the projection is wrong.

1 Like

That seems interesting! I’ll give it a try and update the status

ChatGPT: To achieve re-reflection (infinite reflection) between the two mirrors, we need Recursive Rendering in Babylon.js. Babylon.js does not natively support this for infinite reflections, but we can achieve a similar effect by artificially adding objects to the renderList of the mirrors and placing these objects according to their reflected position.

Demo

2 Likes

Using a Mirror Texture on multiple planes, I managed to create a recursive mirror effect. While it looks great, I would really appreciate any suggestions for improvement.

Special thanks to -CodingCrusader for the help!

3 Likes

I dont know how to program, maybe that helps?
We had that back in time in UnrealEditor.
Best. Werner

https://beyondunrealwiki.github.io/pages/hall-of-mirrors.html

I have turned the mirrors slightly sideways, but can’t get that interesting bend.

Since the reflections are quite computationally intensive, a shader would probably be a faster alternative:

GLSL Sandbox

2 Likes