Good stuff, that is exactly what I need. Is this ability common in graphics card or are there many cards that doesn't support it?

Without this capability it basically just blends it to white? What I want to do is to make it flash (growing linearly from original color to white then back again)... so if this GL_EXT_secondary_color does not exist, how wold I do it then? (or should I just count on this existing on most cards)

I've not actually come across a machine without this extension yet. But the fallback is simply to use additive blending instead of alpha blending when rendering the sprite which makes it a lot brighter if there's any background image there already but otherwise has no effect on black backgrounds.

Ooo, now theres a nice idea. For sprites you should easily be able to fudge the normals so they're pointing straight at the camera, then the specular colour would just be added on top. So even cards without the secondary extension would be able to blend towards a colour rather than just white.

Hmm.. I believe that extension is part of the way the separate specular colour is calculated. Without it the specular light component is simply blended with the diffuse component giving, er, remarkably unspecular highlights. But this is also the reason why it is present on every card I've ever seen.

I might be reading the specs wrong, but I thought the EXT_separate_specular_color extension introduced a second colour for use with specular lighting, and EXT_secondary_color came later to allow it to be used even if lighting was disabled. Unfortunately I can't see when the specular lighting calculation was actually fixed to be additive.

I suppose anything with proper additive specular behaviour is probably also going to have the secondary colour extension, making a specular hack slightly pointless.

I've not actually come across a machine without this extension yet. But the fallback is simply to use additive blending instead of alpha blending when rendering the sprite which makes it a lot brighter if there's any background image there already but otherwise has no effect on black backgrounds.

Sounds good that most cards have it... I think I'll just use the extension and don't worry about those without... they can live without the flash...

It's just to get a little more visual feedback when someone gets hit, so it's not crucial to the game itself.

To better explain what I was meaning by using two texture have a look to the first demo there http://research.microsoft.com/~hoppe/ named "Continuous flash" download it and execute use the right scrollbar to determine luminosity.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org