Jump to content
  • Advertisement
Sign in to follow this  

Post-Process Fog and Transparent Object

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

Hi all,

Post-Process Fog is a simple fullscreen quad with a shader who uses scene color and scene depth.

The problem is scene depth doesn't contains transparent object (meshes + particles).

The fog doesn't affect these object who cause rendering problems.

What is the way to avoid this problem correctly ?

Thanks for the help

Share this post


Link to post
Share on other sites
Advertisement
Calculate the fog not as a post-process but already when drawing your stuff (as a last step in your pixel shaders).

Depending on your setup you could half-way go with your approach. Render opaque objects, do that full screen quad fog, then the transparent objects with fog integrated.

Share this post


Link to post
Share on other sites

For transparent objects I use premultiply alpha and I combine fog like this.

color.rgb =  lerp(color.rgb, fogInScatter.rgb * color.a, extinction);
Edited by kalle_h

Share this post


Link to post
Share on other sites

This is the only option I found too, sounds like no other way exist.

There's always another way, it just might be too complicated to bother using ;-)

Share this post


Link to post
Share on other sites

I was just reading through my new copy of GPU Pro 5, and one of the articles from Guerrilla talked about how they computed fog scattering at 16 different depths and stored the result in a 3D texture. Then they had transparents sample that texture to approximate the result. It's probably a bit overkill for your simple, old-school fixed-function fog but it's another option to consider.

Share this post


Link to post
Share on other sites

Interesting, that demand research on the atmospheric scattering rendering.

It's surely a better option than old school fog, more modern, I should look at GPU Pro 5.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!