PDA

View Full Version : Spheremapping + specular highlights problem !



jackmack
02-14-2005, 09:54 AM
Hi !

I try to get a chrome/metalic look to my primitives.

For testing this I use the teapot with spheremapping and a light source with specular light (1.0, 1.0, 1.0, 1.0).

I know the problem occurs with modulate (multiply) current drawing color by the texture image color.

Also I fixed this limitation by drawing the scene twice - once without texturing to get specular highlights and once with the textures to get the final scene.

This works great on my GeForce2 Ultra, but on S3 Graphics Savage/IX 1014 (8MB) there are problems.

The teapot has highlights but some triangles are black. It seams like normals are switched.

I know the Savage chip is very slow and low-cost. But this is why I use spheremapping to get also on such cards chrome/metalic look. Technics like BRDF sure do not work on such cards.

I tried also SuperBibles chap8/specular example. This has the same problem.

Here my snipped code:
...
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);

drawTeapot(); // first draw

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, m_textureList[0]);

drawTeapot(); // second draw
...

Thanks for all answers

Bye :(

jackmack
02-15-2005, 05:40 AM
I solved myself ! Alpha-Channel was disabled ;)