Interior dynamic reflections

I am trying to show dynamic reflections on the interior (back) side of a glass cube:

Dynamic cube maps work well to show exterior reflections, even when close. This is because cube cameras are configured to look towards the outside which corresponds to what would be ‘seen’ by the exterior face. But this does not work for interior faces. This exampel shows only the backside of a cube:

which has spinning meshes on the inside. The reflections are as if the faces are on the outside, eg. the texture is sampled from the now incorrect/opposite side of the cubemap.

I tried a few things including positioning the 6 cubemap cameras so they look towards the inside of the cube but with very limited success. I think there is a principal problem. Perhaps a custom cube camera (derived from cube camera or camera) with an orthographic camera for each side could work but would be limited to close distances and cuboid interiors, it seems.

One solution would be to use Reflectors rather than a cubemap and blend those with the back faces of the cube but that would not cover the rounded edges.

Perhaps it would also work to make an inside-out cube, so that the interior side is actually the front side. Not sure. It may suffice to invert the vertex ordering of triangles. But I did not see a method to change from counter-clockwise to clockwise. I also tried normalScale = -1. But normalScale may only work with a normal map.

Finally, a custom shader would work and there are examples but it would be great to find another solution.

Any feedback or hints very welcome.

secret trick, you can have negative thickness :wink: physical already uses buffers to capture the scene for refraction, -thickness just makes it look inwards. this (and cube cameras) will never be 100% accurate, or even close to that, but you can get away with it if you stage it right.

1 Like

Thanks, a cool trick which I would never have tried, especially because the negative thickness has to be around the distance to the objects. I think this should work well enough to get that effect.