Skip to content

tangcheng-x/Brunetons-Improved-Atmospheric-Scattering

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Brunetons-Improved-Atmospheric-Scattering

This is a port to Unity of a updated and improved version of Brunetons atmospheric scatter published in 2017. The original was published in 2008 so is a bit old now.

The new version contains the follow improvements.

  • More descriptive function and variable names and extensive comments.

  • Improved texture coordinate mapping which removes the horizon artifact in the previous version.

  • Provides a option to store the single Mie scatter in the alpha channel (Rayleigh is in the rgb) or in the rgb of a separate texture.

  • Provides a example of how to combine with light shafts.

  • Converts the spectral radiance values to RGB luminance values as described in A Qualitative and Quantitative Evaluation of 8 Clear Sky Models (section 14.3)

  • Or precomputes luminance values instead of spectral radiance values, as described in Real-time Spectral Scattering in Large-scale Natural Participating Media (section 4.4). The precomputation phase is then slower than with the above option, but uses the same amount of GPU memory.

  • Adds support for the ozone layer, and for custom density profiles for air molecules and aerosols.

The demo uses a image effect shader as a example of how to use the scattering. The sphere rendered and its light shafts are hard coded into the shader as its just a example. Some work would be needed to convert this into a practical implementation

You can download a Unity package here.

AtmosphericScatter0

AtmosphericScatter1

AtmosphericScatter2

AtmosphericScatter3

AtmosphericScatter4

About

A Unity port of Brunetons improved atmospheric scattering

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HLSL 48.2%
  • C# 44.1%
  • GLSL 7.7%