Jump to content
  • Advertisement
Sign in to follow this  
Arcibald Wearlot

Lighting equation for environment mapping

This topic is 5061 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

What lighting equation do you use for env mapping? That is, how do you compute the final color of the pixel. Let's just consider the diffuse color, a base texture and an environment map. I think a lot of people uses (Diffuse * Texture) + EnvMap, but that's wrong because the object would have reflections of the surroundings even where it's completely in shadow! For now I'm using: (Diffuse * Texture) + (Diffuse * Envmap * Attenuation) This way there is no reflection where there's no light (Diffuse = 0). But still, I'm not very convinced with this approach. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
This is where ambient occlusion can help. You store a scalar value at each vertex ( or texel ) that says how much of the environment map the vertex can see without being blocked.

Then use this to modulate the environment map.

Something like

diffuse_color * diffuse_texture + ambient_occlusion * environment_map( normal )

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!