Sign in to follow this  
EternityZA

OpenGL GLColor4f clamping

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
[quote name='karwosts' timestamp='1298048874' post='4775962']
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.
[/quote]


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this