Adding Chrome to a primmitive

Hi All,

does anyone know how to add chrome/metalic look to a primitive? Some sourcecode would help a lot :wink:

Thanx,

Daniel

a way to achieve this is to make a second rendering pass.

in the first, you draw your object.
in the second you blend the chroming.

your object must have normals (or something resembling)
try this:

glDepthFunc(GL_LEQUAL);

glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);

glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_ONE,GL_ONE);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
glBindTexture(GL_TEXTURE_2D,texid_chrome);

this should work.

Dolo//\ightY

Thank you ,

Daniel.