PDA

View Full Version : How to increase/decrease intensity of window background color



JORGEMAL
09-16-2015, 12:29 PM
I am using "glClearColor" to set the background color of my window and I need to increase/decrease the intensity. Looking at the syntax of "glClearColor" I see that it has 4 arguments that define red, green, blue and alpha values. I supposed that the alpha parameter would do the trick but nothing changes no mater what value I set to such parameter. I have reviewed OpenGL reference trying to find a "command" to achieve my goal without success. I will very much appreciate any help to solve my issue.

Respectfully,
Jorge Maldonado

Alfonse Reinheart
09-16-2015, 01:49 PM
Colors don't have an "intensity" per-se; they have a color. If you want to increase the "brightness" of a color, then what you're really doing is picking a new color by starting with one color and modifying it appropriately. For example, if you double the RGB values, you should double the brightness (up to the maximum values of 1.0 for each channel).

If you're talking about some kind of HDR technique, where extremely bright lights bleed over against partial occludes, that's not something that just happens by setting a color. You have to do special render something to create that effect.

JORGEMAL
09-16-2015, 02:21 PM
Colors don't have an "intensity" per-se; they have a color. If you want to increase the "brightness" of a color, then what you're really doing is picking a new color by starting with one color and modifying it appropriately. For example, if you double the RGB values, you should double the brightness (up to the maximum values of 1.0 for each channel).

If you're talking about some kind of HDR technique, where extremely bright lights bleed over against partial occludes, that's not something that just happens by setting a color. You have to do special render something to create that effect.

Thank you, I really appreciate your kind response. The solution you provided is perfect to achieve my goal.