What is the correct blending-mode for lightmaps?

Hmm,I have the problem that if I blend the lightmaps with the textures,the result is way too dark.I even overbright the lighmaps as far as possible at loading time.(The lightmaps can´t be wrong,´cause I code a q3viewer and I think, Id knows how to create lmaps )
I use glBlenFunc(NULL,GL_SRC_COLOR).Is this the usually used blending mode for lmaps?

Thanx in advance,XBTC!

Originally posted by XBCT:
I use glBlenFunc(NULL,GL_SRC_COLOR).Is this the usually used blending mode for lightmaps?

Yes.

Kosta

Generally yes, (or the equivalent glBlendFunc(GL_DST_COLOR,GL_ZERO)). Two things I’d check though are, are you in GL_MODULATE mode, and are you setting the vertex colors properly?

Hmm,I don´t use any vertex-colors at all,why should I?Can one really boost the brightness of the lmaps with bright vertex-color-values?
Thanx for your help,XBTC!

In GL_MODULATE mode, the color of the fragment is multipled by the color of the texture. If the fragment color is dark, then the resulting color will be dark. Make sure you set the vertex colors to white, R=G=B=1.0, and see if that doesn’t solve the problem.

Originally posted by DFrey:
In GL_MODULATE mode, the color of the fragment is multipled by the color of the texture. If the fragment color is dark, then the resulting color will be dark. Make sure you set the vertex colors to white, R=G=B=1.0, and see if that doesn’t solve the problem.

Or use GL_DECAL or GL_REPLACE for texturing.

Thanx guys,I´ll give it a try.
Greets,XBTC!

If you use (GL_DST_COLOR, GL_ZERO) the resulting image will always be darker than the original no?
I read somewhere that you first have to multiply the lightmaps with 2.0 so that their range is 0.0-2.0. That way you can make the texture twice as bright when the color of the lightmap is white ((1.0,1.0,1.0)*2 = (2.0,2.0,2.0)).

Serious Sam uses (gl_dst_color*2,gl_zero)
I don’t know how they implemented it though.

Uuuuups,sorry I didn´t realize that somebody has answered to this thread,thanx.
Yes I make the lightmaps brighter.But what do you mean with “so that the colors lie between 0 and 2”?I thaught OpenGl only accepts colors between 0 and 1 and clamps everything into this range…

XBTC!

They can have an intermediate value of 0-2.

If you use the blendfunc(GL_DST_COLOR,GL_SRC_COLOR) you will get the same effect as using source2destination.

In other words, anything above 0.5 will make the image brighter (1.0 will make it twice as bright) and anything below will make it darker (0.0 will be black).

Thanx ,I´ll give it a try…

Greets,XBTC!