Jump to content
  • Advertisement
Sign in to follow this  
EternityZA

OpenGL GLColor4f clamping

This topic is 2694 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

Hi.

I have written a 2D opengl game a while ago using shaders. I added a optional fixed function rendering mode to it so it could run on older pc's but i have 1 problem.

Theres alot of flickering sprites in the game that i light up by sending colour values above (1,1,1) to my shaders. so for example if a textures pixel value was 0.5,0.5,0.5 and i passed thorugh 2.0,2.0,2.0 the result would be 1,1,1.

But if i use the fixed function pipeline everything i send through seems to get clamped. so if i GLColor4f(2,2,2) and the textures pixel value was 0.5,0.5,0.5 the end result would stil be 0.5,0.5,0.5 since the 2,2,2 that i passed thorugh got clamped to 1,1,1.

Is there any way around this?

Thnx in Advance!



Share this post


Link to post
Share on other sites
Advertisement
No I don't think you can disable the color clamping, you'll have to come up with some other technique to do your flickering.

Share this post


Link to post
Share on other sites

No I don't think you can disable the color clamping, you'll have to come up with some other technique to do your flickering.



Thnx. I can find another way. just wanted to know thats its not possible first.

Share this post


Link to post
Share on other sites
You can use a 4x modulate and scale your colors down by 0.25, that seems to be the only way I can think of, but it will work. I reckon that you can rely on everything having GL_ARB_texture_env_combine available these days.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!