Skip to main content
GameDev.net gamedev.net
🔒 Locked

Tonemapping and fog

Started by Ashaman73 Oct 18, 2011 at 7:15 AM 1 replies 1.4k views
Original Post
Ashaman73
Ashaman73
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 ?
L. Spiro
L. Spiro
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
I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid
Hodgman
Hodgman
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.