In the Using a cubemap to create reflective materials recipe, we showed how you can create a material that reflects its environment. The only caveat was that other meshes rendered in the scene didn't show up in the reflection; only the cubemap was shown. In this recipe, we will show you how you can create a dynamic cubemap that also reflects other meshes in the scene.
To get ready for this recipe, you need to follow the steps explained in the Getting ready section for the Using a cubemap to create reflective materials recipe. For this recipe, we provide a separate example that you can display by opening 04.11-use-reflections-dynamically.html
in your browser.
If you look closely at the central sphere in the preceding, you can see that it not only reflects the environment, but also reflects the cylinder, and if you rotate the scene, you can also see the cube reflection.