feat: procedural sky ESM script with day/night cycle and dynamic IBL#8943
Merged
Conversation
Adds a ProceduralSky ESM script (daytime atmosphere ported from the three.js Sky shader, expanded with an original procedural night sky) and a graphics example showcasing a day/night cycle with dynamic image-based lighting. Addresses #4378.
Build size reportThis PR does not change the size of the minified bundles.
|
Contributor
|
Oh Nice this will save me some time! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
ProceduralSkyESM script and a graphics example showcasing a full day/night cycle with dynamic image-based lighting. The daytime atmosphere is a port of the three.jsSkyshader (Preetham analytic daylight); this is expanded with an original procedural night-sky model (deep gradient, warm twilight glow, stars, and a moon disk) blended in by time of day, plus a moon key light. Addresses #4378.Changes:
scripts/esm/sky/procedural-sky.mjs- reusable ESM script. Renders the visible sky via askyboxPSchunk override (no custom mesh) and bakes the lighting into the scene env-atlas (RGBM, so no float-renderable dependency). Drives a linked directional light's direction/color/intensity across the day and crossfades to a configurable moon key light at night. The night sky (gradient, twilight glow, stars, moon disk) is an original addition on top of the ported daytime model.procedural-sky(.example.mjs+.controls.jsx) - a laboratory in a desert with SSAO, HDR bloom, PCSS soft shadows, torch lights at night, and editable time-of-day curves.dry-sand-terrain.glb(+ attribution) and example thumbnails.Examples:
Credits:
Sky(MIT) - Simon Wallner, Martin Upitis, Joshua Koo / zz85; underlying model by Preetham, Shirley, Smits (1999).Depends on: #8942 (PCSS hardware-bias fix) for correct WebGPU PCSS shadows.