Stretch shadows at dusk without them running off the screen at sunset
Long shadows at dusk are one of the cheapest ways to make a scene feel uneasy, but the plain maths gives a shadow of endless length just as the sun touches the horizon, and then it jumps away when the sun sets. Here is how to keep the mood and avoid both the blow-up and the jump.
Why this works
A shadow's length is height over how steeply the sun stands, which blows up as the sun reaches the horizon. Real dusk shadows also fade into the general light, so limiting length and fading together hides the break.
When not to use it
Don't use it when the shadow itself is a game element, such as a puzzle where the player reads exact shadow positions. Keep the geometry honest there and move the sun only within a safe range.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 21 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Stretch shadows at dusk without them running off the screen at sunset" (read_entry long-shadows-at-dusk-with-a-cap) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP