Weather: glass roofs let rain and snow through (alpha-blend casters below 0.5 count as open sky) #1159

Closed
opened 2026-10-27 18:28:53 +00:00 by TheSlowly · 1 comment
Collaborator

A closed glass dome (PBR alpha 0.26) over an observatory's upper floor lets rain fall inside, and through a floor opening the floor below gets a wet patch too.

Cause: the weather occlusion map (#783, recordWeatherOcclusion, llcleanrenderervk.cpp) draws alpha-blend casters with the projector/shadow alpha test, which uses a 0.5 cutoff for blend materials (clean_shadow_mask.frag, clean_alpha_rule.glsl). Any glass below 0.5 is open sky for rain streaks, surface wetness and snow cover. The code comment there already names the intended fix as "M2: a weather-specific low-cutoff test"; it was never done.

Why the cutoff exists: fully transparent prims (phantom barriers, invisible platforms, security prims) must not become roofs.

Proposed: a weather-only alpha cutoff for blend casters in the occlusion map (e.g. a setting, default around 0.05-0.1), so tinted or clear glass (0.1-0.5) roofs while alpha-0 / near-invisible prims stay open. Physics (collision/phantom) is not visible to the renderer and plays no part.

Notes:

  • A retractable roof is excluded while it moves (mover tracker) and taken back in when it settles. That is correct.
  • Related: #1145 (rain under a sloped roof; same map), #1037 (indoor snow; same map).

Test: under a closed glass roof in rain or snow, nothing falls inside and the floor stays dry. An alpha-0 prim overhead still lets the rain through.

A closed glass dome (PBR alpha 0.26) over an observatory's upper floor lets rain fall inside, and through a floor opening the floor below gets a wet patch too. **Cause:** the weather occlusion map (#783, `recordWeatherOcclusion`, llcleanrenderervk.cpp) draws alpha-blend casters with the projector/shadow alpha test, which uses a 0.5 cutoff for blend materials (`clean_shadow_mask.frag`, clean_alpha_rule.glsl). Any glass below 0.5 is open sky for rain streaks, surface wetness and snow cover. The code comment there already names the intended fix as "M2: a weather-specific low-cutoff test"; it was never done. **Why the cutoff exists:** fully transparent prims (phantom barriers, invisible platforms, security prims) must not become roofs. **Proposed:** a weather-only alpha cutoff for blend casters in the occlusion map (e.g. a setting, default around 0.05-0.1), so tinted or clear glass (0.1-0.5) roofs while alpha-0 / near-invisible prims stay open. Physics (collision/phantom) is not visible to the renderer and plays no part. **Notes:** - A retractable roof is excluded while it moves (mover tracker) and taken back in when it settles. That is correct. - Related: #1145 (rain under a sloped roof; same map), #1037 (indoor snow; same map). **Test:** under a closed glass roof in rain or snow, nothing falls inside and the floor stays dry. An alpha-0 prim overhead still lets the rain through.
TheSlowly added this to the Slipstream project 2026-10-27 18:28:53 +00:00
Author
Collaborator

Fixed in main by dfb46dc975 (PR #1168).

Fixed in main by dfb46dc975 (PR #1168).
Sign in to join this conversation.
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#1159
No description provided.