Weather: per-avatar shelter map (umbrellas, hats) and per-avatar mesh snow #901

Open
opened 2026-10-20 23:52:27 +00:00 by sky_line · 1 comment
Owner

Follow-up to #783.

Today

The roof/occlusion maps contain static casters only. Worn attachments and moving objects are excluded on purpose (987da32ed6), so the map doesn't smear or need rebuilding every frame. As a result:

  • An umbrella or a hat brim does nothing. Rain falls through it, the wearer still gets wet or snowed on, and the ground under them still gets wet.
  • Snow on avatars uses the same open-sky test, so it ignores what the avatar is wearing above it.

Proposal: a small top-down map per avatar

Render a local, top-down shelter map for each nearby avatar. It covers only that avatar and what it wears, in the avatar's own frame.

Coverage and resolution

  • Coverage: the avatar's attachment bounds plus a margin. That's typically about 2-3 m square (an open umbrella is about 1.2-1.5 m across), and the square grows for large attachments, up to a cap. The vertical range is the avatar's bounds.
  • Resolution:
    • 128x128 for other nearby avatars: about 2 cm texels over 2.5 m.
    • 256x256 for your own avatar and the closest few: about 1 cm, so hat brims, shoulders and umbrella ribs resolve.
    • Pick the tier by screen size or distance, not a fixed rule.
  • Contents: RG32F, or R16F plus R16F. One channel is the top-surface height; the other is the second surface, or the per-avatar snow depth (below).
  • Frame: aligned to the avatar's position and yaw, so the map moves and turns with the avatar and nothing smears.

Rendering (GPU-driven)

  • One depth-only pass into a 2D texture array, one layer per avatar, holding up to N avatars (e.g. 16).
  • Draw from the existing instance store, filtered to that avatar's body and worn attachments. Use the rigged path's already-skinned positions, so animated umbrellas and arms count.
  • Use per-layer view-projections with multiview/instanced layer output, so all avatars render in one indirect draw.
  • Update rates: your own avatar every frame; nearby avatars round-robin (e.g. a few per frame); avatars at rest less often.
  • Memory: 16 x 256^2 x RG32F is about 8 MB at the top tier; a mix of tiers is about 2-4 MB. Soft allocation, with the tier count lowered under VRAM pressure.
  • No cost when weather is off or no avatars are near.

Uses

  1. Shelter for the wearer.
    • Avatar wetness and avatar snow treat the avatar's own map as cover: a point on the body is sheltered if a worn surface lies above it in the map.
    • Hands under an umbrella stay dry; the umbrella's top gets wet or snowy.
  2. Ground and rain.
    • Rain particles falling into an avatar's map footprint are culled or splashed at the top surface, so rain visibly bounces off the umbrella.
    • The ground directly under the avatar picks up a small dry patch while they stand there. It is optional and transient, because it isn't written into the persistent wetness.
  3. Per-avatar mesh snow, with the map as the heightfield base.
    • Snow builds on the avatar's own top surfaces (shoulders, head or hat, an umbrella canopy, the back of a quadruped) as a small mesh layer, using the same model as the world snow at avatar scale: depth on top surfaces, the support cap and repose so it forms domes, and slide-off on steep surfaces.
    • It is stored per avatar in the map's second channel, in avatar space, so it moves and turns with them.
    • It sheds when the avatar moves quickly or shakes (velocity or acceleration thresholds), melts indoors, and is cleared on teleport.
    • It replaces or extends the current per-avatar snow (M3), which has no proper mesh.
  4. Optional: the same map could give rigged-attachment occlusion for the world snow, e.g. a cape. That's out of scope for the first pass.

Wind

The roof map tilts with the wind for rain. For a small per-avatar map, a vertical projection is fine to start with. Shelter can be offset by the wind's horizontal drift at the avatar's height later.

Questions

  • Avatar count: how many avatars are worth it at once (nearest N, by screen size)?
  • Large attachments: handling for very large attachments (wings, vehicles worn as attachments): cap the coverage, or fall back to coarse.
  • Agreement between viewers: both viewers render the same attachments, so results should match.

Acceptance

  • With an umbrella in rain, the wearer and the area under the canopy stay dry, and rain splashes on the canopy.
  • With a hat in snow, snow builds on the hat and shoulders, not the face. It sheds when running and doesn't smear when turning.
  • Other avatars nearby behave the same.
  • The cost is measured and bounded, and nothing runs with weather off.
Follow-up to #783. ## Today The roof/occlusion maps contain static casters only. Worn attachments and moving objects are excluded on purpose (987da32ed6), so the map doesn't smear or need rebuilding every frame. As a result: - An umbrella or a hat brim does nothing. Rain falls through it, the wearer still gets wet or snowed on, and the ground under them still gets wet. - Snow on avatars uses the same open-sky test, so it ignores what the avatar is wearing above it. ## Proposal: a small top-down map per avatar Render a local, top-down shelter map for each nearby avatar. It covers only that avatar and what it wears, in the avatar's own frame. ### Coverage and resolution - **Coverage:** the avatar's attachment bounds plus a margin. That's typically about 2-3 m square (an open umbrella is about 1.2-1.5 m across), and the square grows for large attachments, up to a cap. The vertical range is the avatar's bounds. - **Resolution:** - **128x128** for other nearby avatars: about 2 cm texels over 2.5 m. - **256x256** for your own avatar and the closest few: about 1 cm, so hat brims, shoulders and umbrella ribs resolve. - Pick the tier by screen size or distance, not a fixed rule. - **Contents:** RG32F, or R16F plus R16F. One channel is the top-surface height; the other is the second surface, or the per-avatar snow depth (below). - **Frame:** aligned to the avatar's position and yaw, so the map moves and turns with the avatar and nothing smears. ### Rendering (GPU-driven) - One depth-only pass into a 2D texture array, one layer per avatar, holding up to N avatars (e.g. 16). - Draw from the existing instance store, filtered to that avatar's body and worn attachments. Use the rigged path's already-skinned positions, so animated umbrellas and arms count. - Use per-layer view-projections with multiview/instanced layer output, so all avatars render in one indirect draw. - Update rates: your own avatar every frame; nearby avatars round-robin (e.g. a few per frame); avatars at rest less often. - Memory: 16 x 256^2 x RG32F is about 8 MB at the top tier; a mix of tiers is about 2-4 MB. Soft allocation, with the tier count lowered under VRAM pressure. - No cost when weather is off or no avatars are near. ### Uses 1. **Shelter for the wearer.** - Avatar wetness and avatar snow treat the avatar's own map as cover: a point on the body is sheltered if a worn surface lies above it in the map. - Hands under an umbrella stay dry; the umbrella's top gets wet or snowy. 2. **Ground and rain.** - Rain particles falling into an avatar's map footprint are culled or splashed at the top surface, so rain visibly bounces off the umbrella. - The ground directly under the avatar picks up a small dry patch while they stand there. It is optional and transient, because it isn't written into the persistent wetness. 3. **Per-avatar mesh snow, with the map as the heightfield base.** - Snow builds on the avatar's own top surfaces (shoulders, head or hat, an umbrella canopy, the back of a quadruped) as a small mesh layer, using the same model as the world snow at avatar scale: depth on top surfaces, the support cap and repose so it forms domes, and slide-off on steep surfaces. - It is stored per avatar in the map's second channel, in avatar space, so it moves and turns with them. - It sheds when the avatar moves quickly or shakes (velocity or acceleration thresholds), melts indoors, and is cleared on teleport. - It replaces or extends the current per-avatar snow (M3), which has no proper mesh. 4. **Optional:** the same map could give rigged-attachment occlusion for the world snow, e.g. a cape. That's out of scope for the first pass. ## Wind The roof map tilts with the wind for rain. For a small per-avatar map, a vertical projection is fine to start with. Shelter can be offset by the wind's horizontal drift at the avatar's height later. ## Questions - **Avatar count:** how many avatars are worth it at once (nearest N, by screen size)? - **Large attachments:** handling for very large attachments (wings, vehicles worn as attachments): cap the coverage, or fall back to coarse. - **Agreement between viewers:** both viewers render the same attachments, so results should match. ## Acceptance - With an umbrella in rain, the wearer and the area under the canopy stay dry, and rain splashes on the canopy. - With a hat in snow, snow builds on the hat and shoulders, not the face. It sheds when running and doesn't smear when turning. - Other avatars nearby behave the same. - The cost is measured and bounded, and nothing runs with weather off.
sky_line added this to the Slipstream project 2026-10-20 23:52:27 +00:00

Previous betas had the feature working properly, but it seems to have broken again in Beta 1.4.0.8. Snow is once again accumulating in parts of avatars regardless of whether there is an attachment above it or not. This causes snow to build up even in mouth interiors.

Previous betas had the feature working properly, but it seems to have broken again in **Beta 1.4.0.8**. Snow is once again accumulating in parts of avatars regardless of whether there is an attachment above it or not. This causes snow to build up even in mouth interiors.
Sign in to join this conversation.
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#901
No description provided.