Home

Awesome

Atmospheric Scattering for Unity 5

IMAGE ALT TEXT HERE

Open source (BSD) atmospheric scattering for Unity 5. Features precomputed physically based atmospheric scattering (single scattering at the moment). It can render skybox, atmospheric fog, light shafts and global reflection probe (only skybox is reflected). It can also control directional and ambient light color/intensity. All parts can be turned on and off at any time.

Important: This is a hobby project without any official support. I don't intent to use it in any real world application. Use it at your own risk.

Corresponding Unity forum thread can be found here.

See the demo scenes on Youtube here and here

Sister project

Volumetric Lights for Unity

Roadmap

TBD (I plan to continue working on it but no promises)

Requirements

Usage

See included sample scenes for examples.

Building a standalone player

IMPORTANT - Standalone player will work only if all shaders are included in build! All shaders must be added into "Always Included Shaders" in ProjectSettings/Graphics.

Atmospheric Scattering Parameters

General Settings
Atmospheric Scattering
Sun disk
Directional Light
Ambient Light
Light Shafts
Reflection Probe

Known Limitations

Technique overview

Skybox rendering

Atmospheric Scattering is precomputed for every altitude, camera angle nad light angle. Based on [Elek09]. Sun/camera azimuth is omitted for better performance (3D lookup table is sufficient). See [Bruneton08] if you want higher quality (requires 4D lookup table).

Atmospheric fog

Numerically integrated every frame at very low resolution and stored in 3D lookup table for future use.

Directional/Ambient light color

Precomputed for every time of day [Bruneton08]. Stored in 1D look up tables.

Light Shafts

Light shafts are not physically based. Computed separately and used to multiply atmospheric scattering during post-processing. Based on ray-marching. Retrofitted from Volumetric Lights project.

Possible improvements

Donations

I've been asked about donation button several times now. I don't feel very comfortable about it. I don't need the money. I have a well paid job. It could also give the impression that I would use the money for further development. But that is certainly not the case.

But if you really like it and you want to brighten my day then you can always buy me a little gift. Send me Amazon or Steam gift card and I'll buy myself something shiny. You can find my email in my profile.

References

IMAGE ALT TEXT HERE