Jump to content
  • Advertisement
Sign in to follow this  
FGFS

make rgb image brighter

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

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

 

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Edited by FGFS

Share this post


Link to post
Share on other sites
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.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!