post from paolom, in the “suggestion from the next opengl release” topic:
A specular map should be a texture map, with its data used as an intensity of the specular color in a specific point. Combining this with the separate specular color, would allow for polygons where there is a texture map, and a specular map that is used for calculating the factor of added specular color. So I could have 1 simple quad representing, for ex., the front side of a building: I’d use a single texture for representing wall, windows and the doors. By using a specular map I’ll mark brick zones with dark grey, and the window zones with bright white, to have a glass-like material with high specularity.
i think you can do it now with a 2-pass algo:
-draw the object with only ambient and diffuse components, with the diffuse texture applied
-enable blending, set blending function to screen blending GL_ONE,GL_ONE
-render the object with only specular component and gloss texture applied
texture environment must be GL_MODULATE
it’s very interesting, i’ll give it a try this night
sounds interesting, please post your results. Are images possible on this board ?
done! gloss map works.
i’ve applied it to the hull of a spaceship… it can render roughness/rust impression very good.
That seems very interesting, but there’s one thing I don’t understand : I understand all the blending stuff/passes etc., but what I don’t know is how to get your specular map ? Is it an extension of OpenGL or do you generate it yourself, and if yes, how ??
the specular map is like any other texture.
you can manually draw it, or let some algorithm create it.
i mean, it not depend on opengl.
for instance, i made the specular map as a grayscale noise pattern in photoshop.
before i called it “gloss map” but this 2-pass scheme don’t renders a real gloss map: afaik the gloss map should modulate the shininess of an object (the size of the highlight), not the amount of the specular highlight shape.
in other words, this specular map behaves like a mask for the specular highlight, but it can render many kinds of effects.
currently i’m testing it to see if a credit card hologram effect can be achieved…
…this UBB code is cool