GL_MODULATE Vs GL_BLEND

Hi !

Could somebody explain the difference between GL_MODULATE and GL_BLEND ?

Thank you !

      Mathias

http://trant.sgi.com/opengl/docs/Specs/glspec1.1/node88.html#tabrepmodtenv

check this link

What? GL_BLEND isn’t doing a middle value, what are you talking about, and where did you read that?

The exact formula is:

Rv = Rf * (1-Rt) + Rc * Rt
Gv = Gf * (1-Gt) + Gc * Gt
Bv = Bf * (1-Bt) + Bc * Bt
Av = Af * At ( with At=1 in RGB mode instead of RGBA )

My understanding of this mode is that it uses the values of the texture as a per-texel alpha ratio to blend between two constant colors.

Y.

Originally posted by Ysaneya:
[BRv = Rf * (1-Rt) + Rc * Rt
Gv = Gf * (1-Gt) + Gc * Gt
Bv = Bf * (1-Bt) + Bc * Bt
Av = Af * At ( with At=1 in RGB mode instead of RGBA )

My understanding of this mode is that it uses the values of the texture as a per-texel alpha ratio to blend between two constant colors.

Y.[/b]

I suppose Rt, Gt and Bt are the values of the texture, and Rc, Gc and Bc are the values of the
color ?
… then what are Rf, Gf and Bf ???

… and … do you know where this formula comes from ???

Thank you,

Mathias

The main difference, forgetting formulae, is that modulate is a texture environment function, for combining the texture color with primary colors, or other texture units. Whereas blend is used for blending with the frame buffer on multi-pass rendering.

Nutty

Originally posted by Nutty:
[b]The main difference, forgetting formulae, is that modulate is a texture environment function, for combining the texture color with primary colors, or other texture units. Whereas blend is used for blending with the frame buffer on multi-pass rendering.

Nutty[/b]

???
GL_BLEND is a texture environment function too and it has nothing common with blending with the frame buffer.

[This message has been edited by Michail Bespalov (edited 05-29-2001).]

Calm down, guys.
Just look up the formulae at this place and your through with the discussion.
I’d like everybody to do that before a thread is started so that we might get some more interesting topics to read.
http://msdn.microsoft.com/library/psdk/opengl/glfunc03_6xyu.htm

I emailed you a screenshot to the email address you provided. tell me if you can’t open .tga files or there is some other problem.

Originally posted by Relic:
Calm down, guys.
Just look up the formulae at this place and your through with the discussion.
I’d like everybody to do that before a thread is started so that we might get some more interesting topics to read.
http://msdn.microsoft.com/library/psdk/opengl/glfunc03_6xyu.htm

First of all i am calm

But I am wondering so why microft can’t blend RGBA ord RGB values…

I am confused…

Just compare the two links http://trant.sgi.com/opengl/docs/Specs/glspec1.1/node88.html#tabrepmodtenv

Chris

GL_BLEND is a texture environment function too

It is? Hardly the most detailed of names is it.

If you set the tex env to be GL_BLEND, does glBlendFunc() affect it?

Nutty

Originally posted by Nutty:
[b] It is? Hardly the most detailed of names is it.

If you set the tex env to be GL_BLEND, does glBlendFunc() affect it?

Nutty[/b]

nope glBlendFunc() does not directly affect it.
using RGB or RGBA the new Color calculates by
C=Cf*(1-Ct)+Cc*Ct

Cf Fragment Color of Frambuffer
Ct Fragment Color of Textur
Cc constant Color specified by GL_TEXTURE_ENV_COLOR

the Fragment produced by this is possibly affected by glBlendFunc(). I am pretty sure it is affected…

Chris

Originally posted by grady:
I emailed you a screenshot to the email address you provided. tell me if you can’t open .tga files or there is some other problem.

I answered you yesterday. Maybe you didn’t reveiced my answer ?!
With your image, I understand which option is the best …
In my mail, I also wrote you that 3Mb for an image were … too much !

But thank you :slight_smile:

This formulaes always seem strange to me ?
What does it mean to multiply two RGB values ???
With colors, you don’t have the same facility than with levels of gray. You can get “false colors” (I don’t know if this expression is exact in english …)

An anybody an explaination ?

Mathias

Originally posted by mathias:
[b]

This formulaes always seem strange to me ?
What does it mean to multiply two RGB values ???
With colors, you don’t have the same facility than with levels of gray. You can get “false colors” (I don’t know if this expression is exact in english …)

An anybody an explaination ?

Mathias[/b]

you can’t get “false” color values. Values in OpenGL are always clamoed or transferred to the
range of 0.0-1.0, so if you are using colors like

R=0 -> R=0
G=127 -> G=0.5
B=255 -> B=1.0

So if your multiplying those values with an other color value, you will never get anything bigger than 1.0

hope that helps

Chris

I agree that values are clamped in [0,1], but what does it mean, to multiply two intensities ?

What means R=R1*R2 ???

I don’t know where you get R1*R2 from and if you check the link I provided above, you will see that you never multiply 2 intensities

Chirs

Sorry, maybe I used the bad word …
You wrote : C=Cf*(1-Ct)+Cc*Ct.

I call Ci an “intensity”. Maybe you call it a “value”.
… or maybe a “level” (as for level of gray) …

In this example, what means Cc*Ct ?

>>But I am wondering so why microft can’t blend RGBA ord RGB values…<<

Ehm, because MS has not updated to OpenGL 1.2.
You’re right, next time I’ll look in the 1.2.1 specs first, too.

Originally posted by mathias:
[b]Sorry, maybe I used the bad word …
You wrote : C=Cf*(1-Ct)+Cc*Ct.

I call Ci an “intensity”. Maybe you call it a “value”.
… or maybe a “level” (as for level of gray) …

In this example, what means Cc*Ct ?

[/b]

Ci is not intensitiy it would be I…

C is an RGB value so CcCt actually stands for
Rc
Rt
GcGt
Bc
Bt

Relic:
acutally withe the new NVIDIA drivers my app tells me that I am using OpenGL 1.2.2 already…maybe yet another spec

Greets Chris

[This message has been edited by DaViper (edited 05-31-2001).]

[b]
>>But I am wondering so why microft can’t blend RGBA ord RGB values…<<

Ehm, because MS has not updated to OpenGL 1.2.
You’re right, next time I’ll look in the 1.2.1 specs first, too.
[/b]

I think ,MS’s documentation is simply bad, not complete. OpenGL 1.1 GL_BLEND env should work fine with RGB/RGBA.