This was one of the first times I experimented with shaders, and it was the project that sparked my passion for real-time rendering. The collection consists of two shaders. The first allows for the generation of snow surfaces on objects based on a snowfall direction vector and the object’s normals. This enables integration into dynamic weather systems. Additionally, the snow thickness can increase gradually, configurable through an intensity parameter.

Snow generation based on object normals.
The second is a shader that modifies a tessellated surface as an object passes through it, simulating snow being pushed aside by movement.

Drawing trails in the snow as an object passes through.
Render Targets
A camera renders geometry into a depth buffer from a top-down perspective, with the frustum’s near plane set at the maximum height of the snow plane. Any geometry below that height leaves a trail in the depth buffer based on its depth relative to the maximum height plane. With this information, we can modify the snow plane’s geometry as if it were a height map, which, combined with tessellation, allows us to achieve a realistic snow effect.

Render target used to generate the marks in the snow.
Tessellation
Tessellation increases the triangle density of a 3D model without modifying the original geometry. It is a deterministic, real-time process that allows for on-demand geometry modification and resource optimization. For example, the tessellation factor can decrease dynamically based on the distance from the camera.

Top: Snow plane with a tessellation factor of 2. Bottom: Snow plane with a tessellation factor of 16.
Procedural snow shader demonstration.
Snow trail shader demonstration.