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.04k stars 3.51k forks source link

Visualize fog for 3D Tiles/Models #11716

Closed ptrgags closed 10 months ago

ptrgags commented 11 months ago

Splitting up #4196 into smaller, more focused tasks.

While #11715 focuses on the performance aspects of fog, this issue focuses on the visual aspects of fog.

The main objective is to add a FogPipelineStage to the Model pipeline that applies fog to models far away from the camera in horizon views. I had started prototyping such an architecture in the branch .

Some details, like using czm_fog() are straightforward. However, the main difficulty comes from computing the atmosphere color. Most of the details here are documented in other issues, so see:

ptrgags commented 11 months ago

Yesterday I was talking to @jjhembd about the difficulties with projecting a vertex to the ellipsoid surface, and he had some good insights and resources to look at. Recording them here for the future:

Approach 1: Use a local azimuthal radius of curvature

Approach 2: Convert problem to 2D and use an iterative solver