Skip to content

SkyController: refactoring, new simple sky mode, improvements and bug fixes#2790

Open
airnez wants to merge 19 commits into
iTowns:masterfrom
airnez:feat/skycontroller-and-simple-sky
Open

SkyController: refactoring, new simple sky mode, improvements and bug fixes#2790
airnez wants to merge 19 commits into
iTowns:masterfrom
airnez:feat/skycontroller-and-simple-sky

Conversation

@airnez

@airnez airnez commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description

This PR has to be merged after #2699. It is its follow-up. It answers some of the issues pointed out by #2780.

Major changes

It introduces a new architecture for sky management:

Sky strategies

  • SkyManager code was mostly moved into RealisticSky. It implements the new interface ISkyStrategy.
  • A new "simple" sky mode was introduced with SimpleSky. It also implements ISkyStrategy. It changes the sky color based on altitude, adds fog to the scene and renders an "atmospheric gradient" to blend the fog with the sky. A skyAltitude parameter defines when the sky changes color. Fog and horizon gradient are disabled above this value, and their spread is increased when getting closer to the ground.
  • The HorizonGradient code and its shader hold responsability for the atmospheric gradient rendering. It's a full-screen quad rendered on a Mesh. This part was mostly written with LLMs.
  • A new SkyController was created to handle sky-related logic away from the view. It was named so to avoid confusions with SkyManager that was also renamed. It lazy-loads sky strategies, preventing from initializing three-geospatial when not required.
  • Providing an API to modify atmosphere parameters (see mars example)
  • Actually removing RealisticSky effect passes from the composer when disabling it. The realisticLighting mode was still having effects on the view when disabled.

SunLight and shadow casting

  • Adding a new forceDaytime option to the sunLightLayer to make the sun "follow" the camera instead of relying on a Date. The sun is aligned with the camera to display the full globe, and tilts when zooming in to cast shadows nicely.
  • Computing the shadows box size based on distance to the sun target instead of using camera far.
  • Turning off shadow casting above a shadowsMaxAltitude parameter
  • Making the "sun intensity hack" that prevents from lighting buildings from below when the sun is behing horizon only apply when close to the ground, under shadowsMaxAltitude parameter

Minor changes

  • Making the 3DTiles meshes matte
  • Disabling any sky effect during debug camera render for consistency
  • Tweeking realistic lighting Aerial Perspective Blending to make it look better

Notes

  • For now, Realistic lighting is not compatible with dynamic far. Many more tiles are displayed when it is enabled.

Screenshots

Globe appearance improvements (this branch versus master)

image image

Simple Sky

image

forceDayTime

image

Matte 3D tiles mesh

image

Adjusting aerial perspective blending (this branch versus master)

image image

Mars simple and realistic atmosphere

image image

Debug camera render ignores the sky effects

image image

@airnez airnez changed the title A new SkyControllermanaging a simple and a realistic sky mode SkyController: refactoring, new simple sky mode, improvements and bug fixes Jun 9, 2026
@airnez airnez force-pushed the feat/skycontroller-and-simple-sky branch from 283427a to f391046 Compare June 9, 2026 10:28
@jailln jailln added the P1 label Jun 9, 2026
@airnez airnez force-pushed the feat/skycontroller-and-simple-sky branch 2 times, most recently from 0498016 to b1f0adf Compare June 16, 2026 08:39
@airnez airnez force-pushed the feat/skycontroller-and-simple-sky branch 4 times, most recently from 0c509ca to 38d5c2b Compare June 18, 2026 13:48
@airnez airnez force-pushed the feat/skycontroller-and-simple-sky branch from 38d5c2b to 7be2992 Compare July 2, 2026 14:27
@airnez

airnez commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@Desplandis rebased on master and pushed 4 new commits:

  • Set a smaller default sse for 3dtiles loader example
  • Disable realisticLigthing by default for 3dtiles loader example
  • Add an ambient light when sunlightLayer is off in SkyController
  • Provide an uniform realistic lighting debug ui

@airnez airnez requested a review from Desplandis July 6, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants