Sign in to follow this  

Lighting equation for environment mapping

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

This topic is 4779 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this