Advertisement

Contrast and Brightness

Started by July 12, 2004 12:11 PM
1 comment, last by Missing Name 20 years, 4 months ago
You see all these games where you can change the contrast and brightness, and I was wondering if anyone knew how it could be done in opengl, I've tried SetColorAdjustment, but that doesn't seem to work (then again, I might be doing something wrong). Thenks!
Typically, contrast and brightness should not be setup on the game level. It's better to show a grey+black quad and tell the user "use your monitor settings so that the black and grey quads merge".

There are very few applications where you really need to expose color and brightness contrast. Anyway, the function you mentioned does this. You can also use SetDeviceGammaRamp which does it too. But keep in mind that both functions don't use OpenGL. If you want ot do it at the OpenGL level, there are two ways :
1- render big quads (that fill the whole screen) with blending enabled,
2- render your scene to a texture (typically a pbuffer) and map this texture ont he screen with some kind of pixel shader that setups the color correction. (pixel shader does not necessarily means ARB_fragment_program and-the-like, it can simply be a two-stage multitexturing setup)
Advertisement
Thx for the response, I'll look into the big quad thing.

BTW, for some reason, SetDeviceGammaRamp doesn't seem to be supported by my radeon 9700 (maybe a driver thing), perhaps ati aggrees with you that Brightness/Contrast/Gamma shouldn't be set at app level ;)

This topic is closed to new replies.

Advertisement