feat(sky): dim/brighten the moon highlight through its phase - #86
Open
soloturn wants to merge 1 commit into
Open
feat(sky): dim/brighten the moon highlight through its phase#86soloturn wants to merge 1 commit into
soloturn wants to merge 1 commit into
Conversation
Companion to a MovingBlocks/Terasology engine PR adding CelestialSystem/BackdropProvider#getMoonPhase() for MovingBlocks/ Terasology#94 - a hook for basing the moon's phase on the game's day counter. sky_frag.glsl's moon highlight (the soft glow rendered opposite the sun once it's below the horizon - there's no separate textured moon disc) previously used a hardcoded MOON_HIGHLIGHT_INTENSITY_FACTOR of 1.0, so it was always full brightness regardless of what phase the moon should be in. Replaced that #define with a moonPhaseIntensity uniform, set in BackdropNode from 1.0 - abs(backdropProvider.getMoonPhase() * 2.0 - 1.0) - a triangle wave that's 0 at new moon (phase 0 or 1) and 1 at full moon (phase 0.5), folding smoothly between. No new textures or art assets needed - this reuses the existing highlight rendering, just no longer holds its peak brightness constant. ## Verification Compiles against a local engine checkout carrying the paired getMoonPhase() addition (symlinked in for the build, not committed here). No GL context available to render and confirm visually - the shader/uniform change is small and mirrors the existing sunExponent/ skySettings wiring pattern already used a few lines above it in BackdropNode, but this genuinely needs an eyeball check in-game across a few in-game days to confirm the fade reads correctly. Companion PR: MovingBlocks/Terasology#TBD Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 20, 2026
soloturn
added a commit
that referenced
this pull request
Aug 21, 2026
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.
Companion to a MovingBlocks/Terasology engine PR adding
CelestialSystem/BackdropProvider#getMoonPhase()for MovingBlocks/Terasology#94 - a hook for basing the moon's phase on the game's day counter.What changed
sky_frag.glsl's moon highlight (the soft glow rendered opposite the sun once it's below the horizon - there's no separate textured moon disc) previously used a hardcodedMOON_HIGHLIGHT_INTENSITY_FACTORof1.0, so it was always full brightness regardless of what phase the moon should be in. Replaced that#definewith amoonPhaseIntensityuniform, set inBackdropNodefrom1.0 - abs(backdropProvider.getMoonPhase() * 2.0 - 1.0)- a triangle wave that's0at new moon (phase 0 or 1) and1at full moon (phase 0.5), folding smoothly between. No new textures or art assets needed - this reuses the existing highlight rendering, just no longer holds its peak brightness constant.Compiles against a local engine checkout carrying the paired
getMoonPhase()addition. No GL context available here to render and confirm visually - the shader/uniform change is small and mirrors the existingsunExponent/skySettingswiring pattern already used a few lines above it inBackdropNode, but this genuinely needs an eyeball check in-game across a few in-game days to confirm the fade reads correctly (e.g. via the sun-halting debug command to fast-check specific phases).Companion PR: MovingBlocks/Terasology#5387