Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.