It seems as though enabling multitexture enables me to use textures+lightmaps with the Depth-Buffer ON, whereas I used to have to disable depth-testing when applying the lightmaps. Thats pretty cool…
Okay…the questions:
Is there any other advantage to multi-texturing besides what i just said and the speed?
I had a look at Quake and it does its lightmap blending with GL_BLEND, whereas if i try that in my prog, it looks very screwed… Is this because indexed color (quake) modes do blending differently? I personally use GL_MODULATE…
Thanks in adv.
[This message has been edited by drakaza (edited 08-06-2000).]
In multi-pass rendering, you should not disable depth testing after the first pass. You should, instead, set the depth function to GL_EQUAL and the depth mask to GL_FALSE. This way, only the fragments with the same depth as those visible in the first pass will be written in the subsequent passes.
Your code should look something like:
// first pass
glDepthFunc(GL_LESS);
glDepthMask(GL_TRUE);
make_first_pass();
// all subsequent passes
glDepthFunc(GL_EQUAL);
glDepthMask(GL_FALSE);
all_subsequent_passes();