Cubemapping?

Blitz3D Forums/Blitz3D Programming/Cubemapping?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

"Can someone (anyone) please explain what this cubemapping is all about and how it works/how to use it - in words of one syllable for idiots like me(!)"

I'm sorry, but it's imnpossible to describe in one syllable words, but I'll try to make it simple.


Cube maps are used to render reflections.

Imagine you have an object that you want to be reflective. Well you know how a skybox works? Well a cubemap is like a skybox which is surrounding your model and projected onto it.

In other words, if you have a skybox around your character, and a cubemap with the same textures as your skybox, as you rotate around the character with the camera you would appear to see the skybox reflected in the character's body. Cube map reflections stay oriented properly to the world unlike spherical environment maps.

Now imagine that your skybox is animated. Well, your cubemap can be animated too.

Now imagine that you're dynamically creating a skybox in realtime from your current viewpoint as you walk around the world. Top bottom, left right, front back... each of those you render to a texture each frame. Six 90 degree FOV square camera viewports, each 128x128.

If you apply THAT to your model, then your model will appear to relect whatever is around them in the world wherever he goes. It'll look just like the Terminator chrome effect if you use high res maps.

And if you use lower res or blurred maps then you can get an effect which is more like radiosity lighting, where everything near the character affects his color via reflected light.


Another thing to keep in mind is that you do not have to re-render all six views erach frame. You can choose to render only the ones you think need to be updated. So if nobody will ever be able to see your object from below, you may be able to avoid rendering the bottom side of the cube map. Or, you could choose to render the maps every other frame.