ebruneton / precomputed_atmospheric_scattering

This project provides a new implementation of our EGSR 2008 paper "Precomputed Atmospheric Scattering".
BSD 3-Clause "New" or "Revised" License
922 stars 121 forks source link

Advice for combining aerial fog color #27

Closed Sssyt closed 6 years ago

Sssyt commented 6 years ago

Hi Eric, first of all, I´m sorry because this cannot be considered an issue. Your work is amazing and I really enjoyed implementing this. 👍

I have problems combining the aerial fog color with the scene´s color. To my understanding, this should be a postprocess at the end of frame.

However, if I feed final pixel color to retrieve the aerial fog I lose all "indirect lighting" contribution of my scene. This is due to the fact that for computing the sun irradiance your implementation is using the normal of the surface, therefore all surface which is pointing away from the sun looks black or almost black.

Is this even the correct way of doing it? I don´t know if I am missing something important. Thank you very much :)

ebruneton commented 6 years ago

Yes, it is possible to adapt the algorithm to use it as a postprocess effect. See for instance http://gamedevs.org/uploads/deferred-rendering-of-planetary-terrains-with-accurate-atmospheres.pdf.