View Full Version : specular on texture
03-07-2000, 12:56 PM
Before OpenGL1.2, it seems specular highlight does not work on object with texture applied.
Before OpenGL1.2, is there way to get specular highlight on texture without using extension? (separate specular extension does not seem popular) Would someone give me code example?
Thanks in advance.
>Before OpenGL1.2, it seems specular highlight does not work on object with texture applied.
I hope you are not joking. Specular on a textured mesh is very important for "realistic" look. Even Direct3DRM has automatically supported specular on textured mesh for years. Why isn't it supported by "high-end" OpenGL?
you just set a light model option:
Gorg, your method will work only if you have the extension GL_EXT_separate_specular_color available on your graphics card !
Before this extension appeared, the method was the following one :
Define the material with appropriate diffuse and ambient reflectance and zero for the specular reflectance coefficients.
Define and enable lights.
Define and enable texture to be combined with diffuse lighting.
Define modulate texture environment.
Draw lit, textured object into the color buffer.
Define new material with appropriate specular and shininess and zero for diffuse and ambient reflectance.
Disable texturing, enable blending, set the blend function to GL_ONE, GL_ONE.
Draw the specular-lit, non-textured geometry.
This has been taken from : http://reality.sgi.com/blythe/sig99/advanced99/notes/node127.html
With OpenGL, you can do almost everything without extensions ! The only problem is that, in this case, you're likely to draw your object several times (have a look at the "Per-Pixel Lighting with Unextended OpenGL!" technique).
03-08-2000, 05:25 AM
Thnak you, Eric.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.