I am creating a game for which I want to render a kind of shiny black metallic surface with some refection property in it. I know that there would be something related to masks involved with it. But somehow I am not able to get started on it.

So could someone give me insight in the matter or give a link to a good tutorial?


1 Answer 1


Reflection can actually be fairly tricky because you need information about the surrounding scene before you can render a reflective object. The more accurate you want the reflection to be, the harder it is to implement.

For example, if you just want to reflect the surrounding environment (skybox) you can use environment mapping. Spherical or cube mapping are common (the latter is probably the most common as the cube textures required are much easier to produce; any tool that creates a sky box can be used). These techniques are simple, fast, and can be used on arbitrary geometry. However they will not provide local reflections (that is, reflection of other objects in the scene).

Planar reflective surfaces are another option. These can be done in a variety of fashions -- simply flipping geometry, rendering to a texture and flipping that, stencil buffer techniques, et cetera. This technique is often used to render water, but metallic surfaces can be done just as easily -- in fact easier, since you generally won't bother with the distortion effects also involved in creating water. This technique is also relatively fast, but only works on planar surfaces, as the name implies.

A third option is dynamic cube mapping. This is akin to a combination of parts of both previous techniques -- using a cubic environment map, so arbitrary geometry can be used as the reflective surface, but updating that cube map every frame with the contents of the rest of the scene. Obviously doing so is more expensive. You can find some discussion on this technique here, and a demo here.

Obviously, plugging any of these terms into Google will yield a plethora of results as well, which you should check out for more information.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .