Well I asked this over in the advanced forum, and no one has answered yet. Figured I’d try here instead:
I know this has come up before, but after following previous posts, I couldn’t get this to work. I’m basically trying to combine two lightmaps together. In my case, this would be used to add a dynamic lightmap to a static lightmap. I know this has to be possible.
I’ve messed around with GL_ADD in multitexturing, with no success. Is this what I should be using? If anyone could point me in the right direction, I would be grateful. If it has anything to do with GL_ADD, please include source, since I just can’t get this to work.
Hmm I was trying to avoid multiple passes if possible, but maybe it can’t be avoided. Or maybe it can be combined with multitexturing to bring it down to 2 passes. Thanks for the info though… I’ll try that out sometime soon and let you know how it goes.
hmmm, well, i guess you could mod the lightmap directly but then youd need to make a backup somewhere and youd have the same low res as the static. now, doesnt most modern cards do 3 pass multitexturing? im sure i heard they where going to support like 7 pass or something.
with multitexturing u can do both passes in one
try this
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, lightmap1); glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glColor4f(1,1,1,1)
no need for blending, its up to you to choose if you want to modulate or add the colours ( though prolly modulating is a safe bet for lightmapping/darkmapping )
Zed, I’m not near my developing station right now so I can’t test stuff. So… thought I’d ask: where does the original texture fit into what you are suggesting? You’ve got both lightmaps covered but please explain/show source on what I’d do with the texture that these maps are going onto.
original texture , you only mentioned how to blend 2 lightmaps together, i take it you have some thing like this
tex0 bricks
tex1 static lm
tex2 dynamic lm
bind tex0 - bricks + tex1 static lm
set it up + draw it (using multitexture) like ive explained above.
now disable tex1.
bind tex0 -> dynamic lm
enable blending
blend func dst_color src_color
dont change anything else ie the colour stays at 1,1,1,1 + modulate.
make sure your depth stuff is sorted and then draw the dynamic lm.
Zed - I haven’t gotten it to work yet… but I haven’t been able to spend much time on it either. At a glance though, all I am getting is a very light spot where the whiteness on the second lightmap is. Everything else is black. I know the other stuff is working, if I take out the second pass, the first lightmap is on the bricks just fine.
Kludgy - What is that? I assume it deals with manipulating the actual textures instead of using multiples? If so, are there any handle tutorials / writeups on this?