View Full Version : Adding Chrome to a primmitive
DPalomo
03-12-2000, 09:15 PM
Hi All,
does anyone know how to add chrome/metalic look to a primitive? Some sourcecode would help a lot ;-)
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);
<render object>
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);
<render object>
this should work.
Dolo/\/\ightY
DPalomo
03-12-2000, 11:48 PM
Thank you http://www.opengl.org/discussion_boards/ubb/biggrin.gif,
Daniel.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.