I am trying to implement dynamic environment mapping in my OpengGL rendering engine for the purpose of showing reflections. I am following the tutorial found here. This tutorial (and many others that I have seen) focus' on static environment mapping where you already have a cubemap made from texture data.
From what I gather, to perform dynamic environment mapping you would perform the following steps:
create a single cubemap texture that we can reuse
for each mesh:
render the scene 6 times (or once using geometry shader) to fill faces of cube map from the perspective of mesh
sample cubemap to render reflections on mesh
or perhaps it should be:
for each mesh:
create a cubemap texture for mesh
render the scene 6 times (or once using geometry shader) to fill faces of cube map from the perspective of mesh
for each mesh:
sample cubemap to render reflections on mesh (using this meshes cubemap)
My question is whether this is the right general idea? In particular do you need to render your scene to a cubemap for each mesh that you want to have dynamic reflections on? If so this would seem to be exceedingly expensive for any scene with more than a few meshes receiving dynamic reflections. The only examples/tutorials that I have seen involve only one mesh that uses dynamic environment mapping.