maybe i ask for something obvious for some of you but how can i do the fastest way
blend colors of source pixels with destiny pixels like
result_color = (source_color + destiny_color) / 2 ?
is that possible without manipulating with alpha values for certain texels and with single pass texturing?
thx for help.
i think its not so simple to do, because the blend func dont understand GL_HALF_SRC and GL_HALF_DST !!! you could do something like:
glColor(1,1,1, 0.5);//the alpha value of the current color is multiplied with alpha of texture, so you get source_color*0.5= source_color/2 !
but you only get:
source_color/2 + dest_color
you cannot do something similar with the dest color …
but still what is the way (any way) to achieve that effect?
i don’t undestand it at all why OpenGL doesn’t have blend function that would simply get the average value of source and destiny - isn’t it very common for our real world (the one not in the screen), that we face some materials making all behind it twice less visible?:
(src_color + dest_color) >> 1 is implemented very fast
i think this could be useful too if OpenGL had something like parametrized(?) blending function taking two values and resulting in
src_color * src_given_value + dst_color * dst_given_value
although i know this could be very slow (on present video processors i guess 2 * mul > 10 * add)