Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Lighting and texture mapping work pretty well, but why don I see specular highlighting?

0
10 Posted

Lighting and texture mapping work pretty well, but why don I see specular highlighting?

0
10

Your geometry may have a nice white specular highlight when it’s not texture mapped, but when you apply a non-white texture suddenly the highlight goes away even though the geometry is still lit. This is because GL_MODULATE multiplies the primitive’s lighting color components with the texture color components. For example, assume a white specular highlight is being multiplied by a red texture map. The final color is then (1.0*1.0, 1.0*0.0, 1.0*0.0) or (1.0, 0.0, 0.0), which is red. The white specular highlight isn’t visible. OpenGL 1.2 solves this problem by applying specular highlights after texture mapping. This separate specular lighting mode is turned on by: glLightModel (GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPARATE_SPECULAR_COLOR); By default, it’s set to GL_SINGLE_COLOR, which maintains backwards compatibility with OpenGL 1.1 and earlier. If you’re not using OpenGL 1.2, other solutions are available. Many vendors provide proprietary extensions for allowing you to apply the specular h

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123