Atmosphere improvements in CesiumJS

Hi all!

We are in the process of making improvements to the atmosphere rendering in CesiumJS. Our goal is to improve the accuracy and visual quality of all parts of the atmosphere: in the sky, on the ground and in the fog. In addition to making improvements to the core atmospheric scattering algorithm, we’re also expanding the public API to allow you to change key parameters in the algorithm to achieve the look that best suits your needs. To help with this, we’re also adding a new Sandcastle.

While this system offers a lot of flexibility and customization, we want to make sure that we’re offering the best defaults. Following are a few comparison GIFs (hosted on Gfycat, click on them to play) between the current implementation and the proposed implementation.

Globe Lighting

Old

New

Sunset

Old

New

The atmosphere has an important role to play in the look of any CesiumJS application, so we welcome any feedback you may have! If you’re interested in playing around with the new API, I highly recommend taking a look at the pull request and running the new Atmosphere Sandcastle.

It is important to note that our implementation for atmospheric scattering only accounts for single scattering, so there are limitations to what can be achieved without accounting for multiple scattering.

3 Likes

This looks pretty nice. There are some camera angles where the old code looks better and some where the new code looks better, but overall I think it’s an improvement. My comments are based on the latest commit 574865d.

Oh also, the sandcastle is extremely handy. :smile:

Globe lighting

I like how it looks when globe lighting is enabled and the camera is far away.

Zooming in it starts to look a bit desaturated

When globe lighting is disabled it also looks too desaturated

Is it possible to find a happy medium? And is it possible for globe lighting and non globe lighting be more consistent?

Color

Ground Atmosphere Settings: Rayleigh Coefficient: Blue - 30 seems like a good tradeoff of ground atmosphere blueness without the fog becoming too blue.

Per-fragment

On the latest commit I can’t see the sky atmosphere when this box is unchecked

Atmosphere falloff

The falloff seems too sharp compared to main.

Fog strength

There’s one height where the fog seems too strong. I don’t think it’s an issue with the atmosphere code per-se, but with the fog density constants. Or maybe the sky is not blue enough by default. I couldn’t tweak the constants to my exact liking but I’m happy with these colors. More vibrant than main.

1 Like