Skip to content

fix: allow rendering shadows without realistic lighting - #2830

Merged
Neptilo merged 3 commits into
iTowns:masterfrom
Neptilo:fix/shadows-without-realistic-lighting
Oct 8, 2026
Merged

Neptilo merged 3 commits into
iTowns:masterfrom
Neptilo:fix/shadows-without-realistic-lighting

Conversation

@Neptilo

@Neptilo Neptilo commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

Fixed SkyController so enabling castShadow turns on the sun light even when realisticLighting is off.

Motivation and Context

Consumers may want cast shadows independently of realistic lighting, but the sunlight visibility logic coupled the two, silently dropping shadows when realistic lighting was disabled.

Tested on Firefox, Ubuntu.

@Neptilo
Neptilo requested review from Desplandis and airnez August 14, 2026 12:49

@airnez airnez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me ! :)
Just add a condition on !view.shadows to avoid hiding date / time UI in RealisticLightingDebug.js in toggleDateTimeFolder function to avoid hiding date / time sliders when disabling realisticLighting in examples when shadows are enabled

airnez
airnez previously approved these changes Aug 24, 2026

@airnez airnez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@Desplandis

Copy link
Copy Markdown
Contributor

I haven’t tested this PR yet, but from what I can see in the code, this is not a fix. We should consider it a new feature, since it may impact the default non-realistic use case.

As such, I don’t think it should be merged until we proceed with a proper release. We already have a ton of regressions, so let’s not add more to the pile.

I also veto the merge until we can confirm that this is not enabled by default and that it has no performance impact on the default non-realistic use case. Unfortunately, we don't have any regression-testing to assert this automatically since we do not have converged on #2714 (ping @mgermerie).

@Desplandis
Desplandis requested a review from airnez August 31, 2026 08:58
@Desplandis
Desplandis dismissed airnez’s stale review August 31, 2026 08:58

Since my comment above.

@Neptilo

Neptilo commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

until we can confirm that this is not enabled by default

I confirm this is not enabled by default, and that, in examples that don't use it (e.g. source_stream_wfs_3d, vector_tile_3d_mesh), castShadow is never set, either on the SunLightLayer or on SkyController.

I updated the PR to make it work not only when setting the flag after construction, but also when shadows is already set to true in GlobeView's constructor.

shadows and realisticLighting are documented as independent options of GlobeView. The doc doens't mention shadows requires realisticLighting to work. Setting shadows: true alone just silently did nothing, with no error. Fixing that makes an existing flag do what it claims to do, without adding any new option or behavior.

@jailln

jailln commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@HoloTheDrunk so ? Have you verified the points raised by Desplandis? Can we merge? It's been open for 2 months now...

@Neptilo
Neptilo force-pushed the fix/shadows-without-realistic-lighting branch from 733d2db to 47569cf Compare October 8, 2026 07:36
@Neptilo
Neptilo merged commit 1162e5d into iTowns:master Oct 8, 2026
12 checks passed
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.

5 participants