Archived

This topic is now archived and is closed to further replies.

HellRaiZer

Blending modes???

Recommended Posts

Do anyone know what every BlendFunc combination do??? I mean, i know the glBlendFunc(GL_ONE, GL_ONE) is for additive blending. I mean that every pixel''s color is added to the color buffer. What about other common combinations. If i read in a paper that i need to do multiplicative (!!!)blending, what glBlendFunc must i use??? Thanks in advance. And forgive my terrible English!!! HellRaiZer

Share this post


Link to post
Share on other sites
The equation is
(srcColor * srcOperand) operation (DestColor * destOperand)

SrcColor = the new fragmend( the triangle that you draw)
DestColor = The frame buffer ( what you drawn before)
srcOperand = the first argument in glBlendFunc
destOperand = the last argument in glBlendfunc

operation = always + if you dont set othervise with an extension (and if that case you know about it)

so for multiplaction blend we want
result=SrcColor*DestColor.

we can also write that as
result = (SrcColor * Destcolor) + (DestColor * 0);

and in code
glBlendFunc(GL_DST_COLOR, GL_ZERO);


Share this post


Link to post
Share on other sites