Inverted-colors text on top of an OpenGL scene -


i have font texture use in order draw text on top of opengl scene. problem scene's colors vary solid color use hard read. possible draw font texture inverted colors?

a call glblendfunc(gl_src_alpha, gl_one_minus_src_alpha); draw solid color, call glblendfunc(gl_one_minus_dst_color, gl_zero); draw inverted, disregard alpha values of texture you'd see inverted rectangle instead of letters.

what need equivalent glblendfunc(gl_src_alpha * gl_one_minus_dst_color, gl_one_minus_src_alpha);

can achieved somehow without using shaders ?

problem solved.

following dave's comment original post: instead of using gl_alpha texture generate gl_rgba texture each pixel equal: (alpha, alpha, alpha, 0xff) (this greyscale image instead of luminance image). use texture with:

glblendfunc(gl_one_minus_dst_color, gl_one_minus_src_color);

the result is: (1 - dest_color) x "src_alpha" + dest_color x (1 - "src_alpha") needed.

thank you! ron


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -