infinite mirror effect

Any shader experts that can tell me whether its possible to create an ‘infinite mirror’ effect in Unity using shaders?

Any tutorials I should check out?

You could, but it would take an infinite time to render.

I assume you’re talking about two opposing mirrors. You could handle that with mirroring camera’s, but that would lead to a large amount of draw calls. So I would advice to solve it in a model that has all the mirrored parts in it. So you get something like bdbdbdbd dbdbdbdb. And in the middle there would be the main room with b in it. This allows everything to be drawn with as few as possible draw calls. And it even allows you to (manually) optimize the reflections that are further away.

To get it in the mirrors you can just let the mirror geometry mark the stencil buffer and then only render the mirrored geometry where the stencil buffer is marked. Usually with some “fog”, so infinite actually becomes a finite number.

Hello jvo3dc. I have similar ambitions as the previous user to achieve this effect. Something very close to this video

is what I’d like to achieve in Unity. Making matters slightly more complicated, I’d like to get away with rendering it within a VR headset using a PC as the main gpu output. The closest video I’ve found to this being implemented within Unity is here

but I’ve run ashore looking for a tutorial which even begins to tackle the subject.Needless to say, I found you and you seem to know what you’re talking about. Can you give a few more pointers or am I looking at a world of pain?
If this is to be achievable in VR, I would want the user to have simple 3DOF viewing ability.

Sorry to revive a dead post, but I’m wondering if anyone has pursued this?

The approach that jvo3dc described is the best way to stay performant. Model the insides and use a shader or rendertexture to show it where you want it. See any number of “making portals in Unity” tutorials, but make the twin camera look at a fake repeated geometry instead of trying to calculate multiple bounces.

Just adding to this thread because it’s the top Google result for hall of mirrors effect and I had to figure this out myself, you can get the effect very easily with realtime raytracing. All you need to do is enabled raytraced screen space reflections and increase the bounce count. It’s not infinite, but if you tint the mirror material the limited reflections aren’t noticeable.