Skip to content

fix(rendering): add SunLightLayer only if explicitly enabled in options#2785

Open
Neptilo wants to merge 2 commits into
iTowns:masterfrom
Neptilo:fix/default-sunlight-layer
Open

fix(rendering): add SunLightLayer only if explicitly enabled in options#2785
Neptilo wants to merge 2 commits into
iTowns:masterfrom
Neptilo:fix/default-sunlight-layer

Conversation

@Neptilo

@Neptilo Neptilo commented May 26, 2026

Copy link
Copy Markdown
Contributor

Description

Add an option in GlobeView to decide whether to add a SunLightLayer.
Set it to false by default to recreate the default behavior in cases where a sunlight is not needed.

Motivation and Context

The unconditional creation of a Sunlight layer in #2691 modified the default lighting of the scenes by creating a directional sunlight. As a result, the globe views always had a bright side and a dark side, instead of being uniformly lit.
For example, the default placement of potree_3d_map example was completely in the dark.

Technical decisions

To avoid blocking the upcoming release, provide a minimal viable solution, i.e. the additional option creates and adds a SunLightLayer only during initialization. If it is not created during initialization, it therefore cannot be enabled afterward.

An alternative is to always create it but make it “invisible” immediately afterward if the configuration option is not enabled. In that case, it could be enabled/disabled afterward, but the downside is that a SunLightLayer would always be created, even in examples where it is not needed.

A long-term solution could of course combine both advantages (creation only upon first activation + ability to modify it afterward), but I do not consider that a minimal solution, and it requires discussions to decide on architectural specifications.

@Neptilo Neptilo requested a review from Desplandis May 26, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant