PDA

View Full Version : GL_MIN_EXT and background color problem



ysatou
05-12-2002, 09:44 PM
Hi everyone , please teach me.
I want to get min and max color of layered-texture using EXT_blend_minmax.
When background color is black , and success to get max color using glBlendEquationEXT( GL_MAX_EXT );

But , I can't get min color using glBlendEquationEXT( GL_MIN_EXT );
( Always get black images ).

Perhaps , GL_MIN_EXT get backgound color for min-color.

My work requires black backgound color , so can't solve with white-backgound.

Please teach me , how to except background color on glBlendEquationEXT.

clunis_immensus
05-13-2002, 10:22 PM
Originally posted by ysatou:

Please teach me , how to except background color on glBlendEquationEXT.

How about enabling GL_ALPHA_TEST with a threshold of zero or thereabouts ?
That should prevent low-value elements from going into the blend.

Karthik

ysatou
05-15-2002, 03:52 PM
Thanks for your reply.

I try to following code.
But , background color is blended , and failed( only display black image ).




glEnable( GL_BLEND );
glBlendFunc( GL_ONE , GL_ONE );
glEnable( GL_ALPHA_TEST );
glAlphaFunc( GL_GREATER , 0.0 );
glBlendEquation( GL_MIN_EXT );

glClearColor( 0,0,0,0 );
glClear( GL_COLOR_BUFFER_BIT );

glColor4f( 1,1,1,1 );
glRectf( -0.5 , -0.5 , 0.5 , 0.5 );