#1145 Weather: rain no longer falls inside under a sloped roof #1163

Manually merged
sky_line merged 1 commit from TheSlowly/Slipstream:weather-rain-sloped-roof-1145 into main 2026-10-27 20:25:35 +00:00
Collaborator

Part of #1145 (rain streaks about a metre inside a steep sloped roof, and through the room below).

Cause: the weather occlusion map is drawn with the projector depth pipelines, which carry the shadow slope bias (RenderVKShadowBiasSlope, default 2). A 45-60 degree roof is stored 0.75-1.3 m lower than it is (more on the rain-tilted map). The streak test then used only the coarse map, a nearest sample, and a 0.4 m allowance.

Change (clean_weather_sim.comp, streak test only; the map itself is unchanged):

  • Use the near cascade (~3 cm texels) where it covers the drop.
  • Rebuild the roof height from the neighbouring texels' slope with the same bias factor the map was drawn with (passed in from the pipeline template), taking the gentler neighbour slope so eaves and walls aren't mistaken for roof.
  • Hide a drop more than 0.1 m under that height.

Tested in-world: no streaks under a pitched slate roof; rain still reaches the eaves outside.

Leaves #1145 open for the follow-up (the remaining indoor leak is the static-prim mover jitter, fixed separately). Not covered here: surface wetness and snow cover still read the biased map.

Part of #1145 (rain streaks about a metre inside a steep sloped roof, and through the room below). Cause: the weather occlusion map is drawn with the projector depth pipelines, which carry the shadow slope bias (RenderVKShadowBiasSlope, default 2). A 45-60 degree roof is stored 0.75-1.3 m lower than it is (more on the rain-tilted map). The streak test then used only the coarse map, a nearest sample, and a 0.4 m allowance. Change (clean_weather_sim.comp, streak test only; the map itself is unchanged): - Use the near cascade (~3 cm texels) where it covers the drop. - Rebuild the roof height from the neighbouring texels' slope with the same bias factor the map was drawn with (passed in from the pipeline template), taking the gentler neighbour slope so eaves and walls aren't mistaken for roof. - Hide a drop more than 0.1 m under that height. Tested in-world: no streaks under a pitched slate roof; rain still reaches the eaves outside. Leaves #1145 open for the follow-up (the remaining indoor leak is the static-prim mover jitter, fixed separately). Not covered here: surface wetness and snow cover still read the biased map.
The streaks' roof test read the coarse occlusion map with a nearest sample and a 0.4 m
tolerance, but the map's casters are drawn with the projector depth pipelines'
slope-scaled depth bias (RenderVKShadowBiasSlope, 2): a sloped face sits factor x its
rise per texel lower in the map. Under a 45-60 degree roof on ~0.4 m coarse texels
that is 0.75-1.3 m (far more on the tilted map for a face sloping with the rain), so
drops fell a metre and more inside the attic and on into the rooms below.

The test now uses the near cascade where it covers the drop (cm texels), else the
coarse one, and puts the bias back: the nearest texel's rise along x / y from its
neighbours (the gentler pair: an eave / wall / fence step is an edge, not the face's
slope) lifts it by factor x |rise| and steps from the texel centre to the drop.
Tolerance 0.1 m. The maps themselves are unchanged (surfaces, wetness and snow read
them as before); the factor comes from the projector pipeline template (Frame ->
occlN2.w).
Owner

Merged to main (cherry-picked) as ae2b972c16, tested in-world by the owner together with the other open PRs. Thank you!

Owner test: much less rain inside under the sloped roof. Leftovers for a follow-up: a little rain still appears near the sloped roof, and the roof rivulets sometimes clip inside.

Merged to main (cherry-picked) as ae2b972c16, tested in-world by the owner together with the other open PRs. Thank you! Owner test: much less rain inside under the sloped roof. Leftovers for a follow-up: a little rain still appears near the sloped roof, and the roof rivulets sometimes clip inside.
sky_line manually merged commit ae2b972c16 into main 2026-10-27 20:25:35 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!1163
No description provided.