Help with ppl and lightmaps

Started by
14 comments, last by mikeman 19 years, 7 months ago
if i have a scene with lightmaps, is there a way to light up a dark spot using a per pixel light? In my engine i got full ppl with dot3 bump mapping. it works very fine (i posted a demo on this forum few days ago,if someone wants..) and now i'm trying to add some "atmosphere" :) I've added lightmaps, but if i move my spotlight in a dark zone of the map nothing changes :/ How can i do?
Advertisement
How are you combining your lightmap to the scene?
If at first you don't succeed, redefine success.
this way:

glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, Cube_Map_Id);
glEnable(GL_TEXTURE_CUBE_MAP);

glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, Normal_Map_Id);

glActiveTextureARB(GL_TEXTURE2_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, Texture_Id);

glActiveTextureARB(GL_TEXTURE3_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, Lightmap_Id);


then i set the extensions like in the NeHe's article #20.
For GL_TEXTURE3_ARB i use GL_MODULATE. I've tryed to use another value, but nothing changes.
are you using

glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

or

glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);
You know,lightmaps don't support bumpmapping.Wouldn't it look weird if lightmapping and PPL bumpmapping were combined?The bumps will show only when the surfaces are lit by dynamic lights.I think the most you can do is just plain simple PPL lighting,without bumpmapping.
@lc_overlord:

glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);
ok then i don't know, it could be the order of the textures that is flawed.

mikeman: actuarly your wrong and it looks pretty good to.
Just go to http://esprit.campus.luth.se/~humus/ and look at the softshadows demo and the Volume Lightmapping demo in the openGL section, it's pretty l33t.
Quote:Original post by lc_overlord
ok then i don't know, it could be the order of the textures that is flawed.

mikeman: actuarly your wrong and it looks pretty good to.
Just go to http://esprit.campus.luth.se/~humus/ and look at the softshadows demo and the Volume Lightmapping demo in the openGL section, it's pretty l33t.


Hmmm...After a quick look on the shaders,I saw that he calculates diffuse and specular lighting the normal way for every pixel,and then he modulates the result with "shadow",a value sampled from the lightmap.From that I conclude that the lightmap indicates only if a point is in shadow or not,and does not include diffuse values.So he uses PPL bumpmapping for all light sources,and the lightmap only to implement shadows.When I said combining lightmap&bumpmapping will look weird,I meant full lightmapping for static lights,and PPL bumpmapping for dynamic ones.
So what's all the fuss about.
If you want to combine bumpmaps with lightmaps and use the lightmap for lightinfo and only use static light's( and not as humus does it, use it for shadows), then just increase the resolution on the lightmap and bake the bumpiness into it, easy quick and simple.

However, if you want a static light(static position that is) in a static world with soft shadows, bumpmaps, paralax efect and some varying degree of controll over the intensety and color of the light.
This method allso gives you accurate specular highlight's, true lightmaps can not.

Combining the two(true lightmapping and dynamic lights) is pretty easy, but don't even try doing it in a single pass(light is addative, so just add the different passes together).
You can use lightmaps pretty effectively to simulate some fake radiosity.
Quote:Original post by lc_overlord
So what's all the fuss about.
If you want to combine bumpmaps with lightmaps and use the lightmap for lightinfo and only use static light's( and not as humus does it, use it for shadows), then just increase the resolution on the lightmap and bake the bumpiness into it, easy quick and simple.


It would need a huge resolution to do that.

This topic is closed to new replies.

Advertisement