Volumetric Atmospheric Scattering

Hey there!

A few years ago, I made a small implementation of a volumetric atmosphere post-process based on Sebastian Lague’s video. I did not share it at the time, so I am fixing this now ^^

Take a look at the demo: Volumetric Atmospheric Scattering

It is just a few files that you can integrate in any project you want. It is not the fastest, but it gets the job done, and works at any scale imaginable (including 1:1 with planet-size worlds).

Source code with instructions: GitHub - BarthPaleologue/volumetric-atmospheric-scattering: A simple implementation of volumetric atmospheric scattering using babylonjs.

16 Likes

This demo is awesome! I love it!
There is no way to set back the value of ‘Atmosphere Radius’ to the startup value. The slider min value seems too high.

1 Like

Thanks a lot! Good catch for the radius slider I will fix it in the coming days :wink:

1 Like

so pretty !!!

1 Like

It should be fixed now ^^ And I upgraded everything to Babylon 7 while I was at it.

3 Likes

This looks so good!

1 Like

Physics does create amazing things :ok_hand:

Okay, I got it to look better!

I added Mie scattering and Ozone absorption from skythedragon’s shadertoy, which improves the look of the atmosphere quite a bit, especially near the terminator:

Online demo is at Volumetric Atmospheric Scattering

It is still as easy to use as before: just 2 files and 2 lines of code to get high quality atmosphere rendering in BabylonJS :ok_hand:

Here are some more picures:

From the ground

From space

It is still not that fast as I keep using the basics from Nishita’s original paper. However I came accross this WebGPU project:

It looks really promising and uses a more advanced technique to render the atmosphere waaaaay faster. I might get around to port it to BabylonJS in the future :eyes:

11 Likes

Woot! it’s beautiful!

2 Likes

It would be even better with some volumetric clouds :eyes:

1 Like

Wow! :heart_eyes_cat: :heart_eyes_cat: :heart_eyes_cat:

2 Likes

Yeah…this is quite something I agree!

2 Likes

That awesome, If you are agree, i’m gona test it within my geographic Babylon mapping tests…

3 Likes

Thanks :heart:

Go ahead, I want to see how it looks in your project! Let me know if you have any difficulties using it :wink:

2 Likes

The demo was broken on chrome because of a change in WebGPU’s spec. I just upgraded the project to Babylon 8 and the problem is gone :ok_hand:

1 Like