Fade between day and night #92
Labels
No labels
animation
audio
blocked
bug report
controversial
documentation
easy
feature request
hard
medium
multiplayer
physics
ui
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
elsie/liuverse#92
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
daytimeis a server-authoritative bool, and the client switches between twohard-coded light presets when it changes. The entire campus, sky included, snaps
in one frame.
That snap is the most visible seam in the game after the flat sky, and it is also
why the two presets have to be tuned to be far apart: there is no moment in
between to be halfway pleasant.
Interpolate the photometric values client-side toward the server value over a few
seconds: sun and moon color and intensity, ambient, fog color, sky tint and
exposure. The sun direction is fixed in config today; keeping it fixed means the
shadow map does not rebuild during the fade, which is the cheap version. If a
moving sun ever lands (#7), the fade becomes a time of day instead.
Related: #7, #39 and #64 define what day and night should each look like, and
#79 and #90 provide the values to interpolate.
This landed, so this is closed.
The client keeps a
daylight_easethat animates toward the server'sdaytimeflag overDAY_NIGHT_FADE_SECONDS, and the same blend drives both the light values and the sky.frame_lightsmixes the ambient intensity, the sun intensity and the sun color between the moon preset and the day preset by it, and the renderer mixes the night and day zenith, the cloud color and the cloud cover by the same factor. The sun direction is still fixed in the config, so the shadow map does not rebuild during the fade.One small thing from the issue's list is left: the fog color is a single config value and is not interpolated, and the fog is switched off during the day by a bool rather than by the blend, so the distance haze still switches rather than fades. The sky's horizon color is that same fog color, so the seam is small.