Archived

This topic is now archived and is closed to further replies.

Secondary Color

This topic is 5012 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey! I''d like to use the secondary color to add some color after the fragment coloring, so I got the glSecondaryColor functions, set the color but nothing happens. I have lighting enabled, so I guess that OpenGL lighting overwrites the secondary color with (0,0,0,0). Is that true? Do I have to use a vertex program myself which emulates the lighting but does not reset the sec. color or is there some way to make OpenGL lighting not overwrite the sec. color?

Share this post


Link to post
Share on other sites
As far as I know secondary color is to do some kind of pre-computed specular highlights so it probably gets overwritten if GL lighting is enabled (there''s another extension which works with lighting enabled... maybe it''s separate_specular or something).
I''m not really sure but this could have sense.
The VP trick will surely do the job but I wonder how it will behave on the fragment side. I don''t think secondary color will just be added.
Take this with some salt, I haven''t been coding for months right now so those details are not well defined in my mind anymore.

Share this post


Link to post
Share on other sites
Thanks for your reply.
It is true there is a separate_specular_color extension which does exactly do the specular thing with the secondary color. The separate specular color is not modulated by texturing so you can f.e. do white highlights on a blue/green globe.

Meanwhile I''ve managed to write my VP (it does the ATI skycolor thing you might know, see famous sky thread). I use the secondary color to store the inscattered light. The 2ndary color is just added to each fragment AFTER shading and texturing.

Share this post


Link to post
Share on other sites