make rgb image brighter

Started by
1 comment, last by BlueSpud 9 years, 10 months ago

Hi

after adding some gl stuff my images are darker. I do stuff alike glEnable this and that in another function. How to revert them or

make my images brighter? What could make my images darker?

Thanks

Advertisement

Way too little information. "I enable some stuff" doesn't suffice to make any reasonably qualified statement.

What you can check, as a shot in the dark, and as one possible reason why your renderings may look "too dark" is whether you're using gamma correctly. The wording "too dark" does not quite describe the effect of gamma correctly, but it's what one might call it at first glance.

To get correct lighting, you need to transform srgb to linear when reading textures (since cameras and most paint programs assume srgb) and transform linear to srgb writing to the framebuffer. Both can be done in hardware via glEnable or manually in a shader. Note that doing the gamma dance incorrectly, you can also get a "too bright" image.

Of course many other things are possible, nobody will be able to tell without information. You might for example have enabled blending, and objects appear darker in front of a black background. Or, something different.

This seems to help, but I still need to figure as images are not fading in.:

/// Handle day/night
glColor4f(Red, Green, Blue, AlphaR);
/// Tell Xplane what we are doing
XPLMSetGraphicsState(0/*Fog*/, 1/*TexUnits*/, 0/*Lighting*/, 0/*AlphaTesting*/, 1/*AlphaBlending*/, 1/*DepthTesting*/, 1/*DepthWriting*/);

glPushMatrix();
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

...

If I put glcolor4f after setgraphics the images are to dark but fading in ok.

Thanks

If your messing with the draw color, of course things are going to happen. If all the values (r,g,b and a) aren't 1.0 with blending enabled, your image is going to be darker. If you have them all set to 1, the Samoth is probably correct in that it's a thing with the gamma.

This topic is closed to new replies.

Advertisement