Jump to content
  • Advertisement
Sign in to follow this  
b3rs3rk

Help with ppl and lightmaps

This topic is 5128 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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);

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
@lc_overlord:

glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!