Using raytracing is an elegant solution, however it is beyond the abilities of modern graphics cards to render accurate realtime reflections with this method and maintain playable framerates.
Thus we get image based techniques for rendering realtime reflections. There are 3 main techniques for displaying reflections, sphere mapping, dual paraboloid mapping and cube mapping.
Sphere mapping is the simplest method of generating reflections, it is also the easiest to use in the blender game engine as it is natively supported by the material editor.
A sphere mapped Suzanne |
This is where view independent reflections come in!
Two techniques exist to render view independent reflections, the current industry standard method is cube mapping, but there is also a technique named dual paraboloid mapping.
Dual paraboloid mapped Suzanne's |
2 Textures representing the reflection on an upper and lower paraboloid |
Dual paraboloid reflections - Kyle Hayward
The art of texturing using the opengl shading language - Environment Mapping - Jerome Guinot
Finally we have cube mapping, as previously mentioned cube mapping is the most common technique you will see for displaying image based reflections. Compared to dual paraboloid maps, cube maps have less distortion, a more consistent pixel density and are also easier to generate.
Cube mapping |
Cube maps do however require 6 separate images making them the most expensive to render in realtime. Blender has support for cubemaps (via custom GLSL shaders), it does however have a few issues with it's implementation the most notable being the inability to change the cube map with bge.texture (as far as I can tell).
A blender cube map |
===================== File Download ========================
This was quite a broad overview of these techniques, there is plenty more to discover if this interested you.
Again, there will be a post up in the coming weeks continuing on from this.
No comments:
Post a Comment