How do you increase the brightness of a texture?

I was wondering if there is a simple way to increase the brightness of a texture.

I tried using SDL_SetTextureColorMod but that only manages to darken the texture.

Looks like the only option available is to render a white texture (with a small alpha value) on top of the texture.

If you’re using OpenGL, a white quad rendered over it with this blendfunc will do:
glBlendFunc(GL_DST_COLOR, GL_ONE)

Basically this multiplies the source color (white in this case) by the framebuffer color, and adds it to the framebuffer color multiplied by 1, so it can (without floating point framebuffers) multiply
by at least 2.0x, with floating point framebuffers you can brighten more than that in one pass.On 03/28/2014 02:53 AM, mr_tawan wrote:

Looks like the only option available is to render a white texture (with a small alpha value) on top of the texture.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier