#1159 Weather: glass roofs keep the rain and snow out #1168

Closed
TheSlowly wants to merge 1 commit from TheSlowly/Slipstream:weather-glass-roof-1159 into main
Collaborator

Fixes #1159 (a closed glass dome let rain and snow through).

Cause: the weather roof map drew alpha-blend casters with the shadow alpha test's 0.5 cutoff, so any glass below half opacity counted as open sky.

Change: the map's blend bucket uses its own pipeline (a specialization constant in clean_shadow_mask.frag) with a weather-only cutoff, RenderVKWeatherGlassAlphaCutoff (default 0.05, the same threshold as shadows and the avatar shelter maps). Glass roofs now shelter, while alpha-0 and near-invisible prims stay open. Alpha-mask foliage keeps its own cutoff, and the shadow passes are unchanged.

Tested in-world: a glass dome at alpha 0.26 keeps the floor under it dry; 0.5 brings the old behaviour back.

Fixes #1159 (a closed glass dome let rain and snow through). Cause: the weather roof map drew alpha-blend casters with the shadow alpha test's 0.5 cutoff, so any glass below half opacity counted as open sky. Change: the map's blend bucket uses its own pipeline (a specialization constant in `clean_shadow_mask.frag`) with a weather-only cutoff, `RenderVKWeatherGlassAlphaCutoff` (default 0.05, the same threshold as shadows and the avatar shelter maps). Glass roofs now shelter, while alpha-0 and near-invisible prims stay open. Alpha-mask foliage keeps its own cutoff, and the shadow passes are unchanged. Tested in-world: a glass dome at alpha 0.26 keeps the floor under it dry; 0.5 brings the old behaviour back.
The weather occlusion map drew alpha-blend casters with the projector tiles' alpha test, which
cuts blend materials at 0.5: glass under half opaque (the observatory dome, PBR alpha 0.26) was
open sky for the rain streaks, the surface wetness and the snow cover.

The map's alpha-blend bucket now draws with mWeatherBlendPipe: mProjMaskDsPipe with the
alpha-test FS's weather twin (clean_shadow_mask.frag specialization constant 0). It tests a
blend caster's alpha (PBR base colour alpha or legacy transparency, x the texel's alpha) against
RenderVKWeatherGlassAlphaCutoff (default 0.05, about 95% transparency; floored at 1/255),
pushed in VKDrawViewPush::pad1. Alpha-mask materials keep their own cutoff. Every sun /
projector / cluster shadow pipeline specializes the constant false: their test is unchanged
and they never read the push. One extra pipeline (+ its depth-only VS twin) at init, nothing
per frame; while it compiles (or if it fails) the map falls back to the 0.5 test.
Author
Collaborator

Merged into main (rebased) as dfb46dc975.

Merged into main (rebased) as dfb46dc975.
TheSlowly closed this pull request 2026-10-27 22:10:00 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream!1168
No description provided.