colors - What is a simple way to brighten textures mapped to a quad in OpenGL ES? -


i'm displaying 2d sprites built using multiple textures (with transparency) applied quads. have enabled color array gldrawarrays , know how use change ratio of each color , dim textures (ie. reducing colors same amount).

this done using premultiplied alpha , following:

glblendfunc(gl_one, gl_one_minus_src_alpha); gltexenvi(gl_texture_env, gl_texture_env_mode, gl_modulate); 

is there simple way brighten texture well?

i tried using gl_add, causes entire quad become visible (ie. pixels transparent not anymore).

thanks.

this quite easy: draw quad on region want brightened, overlay quad using

glblendfunc(gl10.gl_dst_color, gl10.gl_one); 

which effectively means take underlying color (dst, gl_one) is, , add fraction of same color (src, gl10.gl_dst_color).

the fraction add specified color of quad, can tweak brightness setting overlay quad's vertex colors {0.0f, 0.0f, 0.0f} (no brightening) {1.0f, 1.0f, 1.0f} ('doubling' brightness). of course can increase individual colors' brightness tweaking factors well.

good luck!

cheers, aert.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -