Sign in to follow this  
Ashaman73

Tonemapping and fog

Recommended Posts

Well, I'm currently trying to improve my standard full screen fog.

I'm not sure how to handle fog best.Currently I apply fog in a post-processing step (deferred shader) by just mixing the fog color with the frame color depending on a density function and the screen depth. My question is, would it be better to apply the fog before or after tone mapping ?

I would say, that before tonemapping would be the correct way, but wouldn't a dark and fogged scene lead to an undesired bright fogged screen ?

Share this post


Link to post
Share on other sites
If your tone mapper causes darks to turn bright, then that is the expected result. Darkening down the scene afterwards with fog would not provide the result expected by the artists.
Additionally, if you are not already, be sure you are blending all of your colors in linear space for the correct amount of contrast and color range. It helps the dark areas a lot.


L. Spiro

Share this post


Link to post
Share on other sites
Yeah it should be applied pre-tone-mapping if going for something physically correct. What kind of scene are you adding fog to?

If you're just using a plain fog colour, then that's similar to rendering the atmosphere as lit by a constant ambient light source -- so yeah, if you've got a black scene, and add a brightly-lit atmosphere to it, the atmosphere's lighting contribution will be way too dominant.

The first thing I'd try is making your fog colour similar to your average lighting (or ambient lighting) colour. If you're adding fog to a black cave, the fog colour should be black.

Share this post


Link to post
Share on other sites

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