DynamicRain_Thumb.png

Dynamic Rain and Level Voxelization

 Dynamic Rain and Level Voxelization

Abstract

A system for presenting dynamic rain to the player, supporting a range of rain types from none to drizzle to downpour. The system is aware of the level geometry and only presents rain and wetness in areas where it is appropriate. The system is applied to all surfaces showing rain drops, dynamic puddles, water absorption, water running down surfaces. The system can smoothly transition between rain types, so if the rain stops, the surfaces will slowly dry up.

The Problem

Environments feel damp but static with rain relegated to very specific story beats. A system to support dynamic rain is needed to improve environmental visuals without requiring additional resources from Environment Art or VFX to implement due to limited resources.

Goals

  1. Drive the entire system through a single SceneComponent on the player BP

  2. Create a vowelized representation of the level which records what areas are overhangs, interiors, etc.

  3. Create a tool to generate these voxel maps using pseudo-volume textures.

  4. Create a set of material functions which can be added to the master materials and auto-magically apply wetness based on current rain conditions.

  5. Use render targets to make the water details dynamic and avoid repeating / tiling artifacts.

 

Render Targets

The system has multiple dynamic elements so we channel pack them to reduce memory footprint and texture lookups. Render targets are used to calculate droplet behaviors, puddle behaviors, and generate normal maps for those results.

Level Voxelization

 

Due to resource constraints of the project, the system would need to work without any environment art support, so I wrote a voxelizer tool to store a low fidelity voxel map of the entire level as a psudo-volume texture which the system could sample to determine if the rain system is visible at any given position in the world.

The system determines what areas of the map are below open sky or adjacent to a voxel under the open sky. Any space occluded by geometry is recorded, and all voxels below that are also marked as occluded. This creates rain shadows for situations such as interiors, overhangs, and bridges and creates a convincing approximation of blocking the rain. Both VFX and Surface shaders can sample this voxel map so it also determines surface wetness.

VoxelizedMapExample.png