CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.02k stars 3.51k forks source link

Atmosphere gets too bright with HDR turned on #12240

Open jjspace opened 1 month ago

jjspace commented 1 month ago

This is based off an observation from @ggetz while we were working on https://github.com/CesiumGS/cesium/issues/12126

Atmosphere seems really bright when HDR is on. Check to make sure we're not accidentally doubly applying tonemapping for the atmosphere when HDR is on. Maybe verify if this issue was present with ACES tonemapping or not.

HDR off 2024-10-07_17-54

HDR on 2024-10-07_17-54_1

Notice that the atmosphere does get "brighter" when HDR is on. I notice it most as the blue part shrinks to almost nothing.

Another weird part of this is that if you crank the brightness way up you can see the total height of the atmosphere including the fully transparent pixels. That might be a separate bug but it also reveals that with HDR off those pixels are semi-transparent but with HDR on they become fully opaque. This might hint at the actual issue here being that when HDR is on the transparency or light accumulation is not being calculated correctly

HDR off + brightness 2024-10-07_17-58

HDR on + brightness 2024-10-07_17-58_1

Reproduce

  1. Load the Atmosphere Sandcastle
  2. Turn off Fog and Ground atmosphere just so they don't distract, these do not seem to be impacted
  3. Move the camera to be looking at the horizon as shown in the pics above
  4. Toggle HDR under the Sky Atmosphere tab
  5. slide the Brightness Shift up higher to observe the "transparent vs opaque" oddity