Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


make rgb image brighter


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 FGFS   Members   -  Reputation: 229

Like
-1Likes
Like

Posted 17 May 2014 - 03:31 AM

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

 

 



Sponsor:

#2 samoth   Crossbones+   -  Reputation: 6207

Like
0Likes
Like

Posted 17 May 2014 - 04:56 AM

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.



#3 FGFS   Members   -  Reputation: 229

Like
0Likes
Like

Posted 18 May 2014 - 05:53 AM

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, 18 May 2014 - 06:22 AM.


#4 BlueSpud   Members   -  Reputation: 523

Like
0Likes
Like

Posted 28 May 2014 - 10:23 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS