Shaders & Materials:

Real-Time Snow in Unreal Engine 5

Ever since seeing Red Dead Redemption 2, I've been fascinated by the process of creating real-time snow effects. I started by brainstorming what might go into a snow material and effects would make it compelling.

Some important aspects of snow...
1. Spans vast areas
2. Covers the tops of objects
3. Builds up in big piles over time
4. Shimmers in sunlight


Snow spans vast areas

Since snow occurs over a vast area, I started by looking into anti-tiling methods.


You can read about how I'm handling texture tiling in unreal engine here


Snow covers the tops of objects

From my time inside of Substance Painter/ Designer and Arnold, I was familiar with different nodes for creating masks, so I went looking for something similar within Unreal.

I started by exploring `WorldAlignBlend`, but I love the simplicity of a single parameter so the necessity of a Bias and Blend parameter felt clunky — maybe that's too nitpicky, but too many parameters will inundate artists with complexity; the more lean we keep our tools the faster our artists can work.

I heard `PixelNormalWS` produced a detailed result for orientation, but unfortunately, since Normals use the `PixelNormalWS` this crashed Unreal every time I tried to use it to lerp between Normal maps.

Quick fix, use the `VectorNormalWS` and expose a scalar parameter to control the fall off amount.

Much better, but what about accumulation?

Snow builds up in big piles over time

I wanted the material to transition from a base texture into snow over time which naturally lead to blueprints.

The `Timeline` node was perfect for this.

After creating and exposing a "Snow Amount" parameter, I could pass it directly into the blueprint to be incremented.

Because I was using the `VectorNormalWS`, it came with the added benefit of also being able to drive a Height parameter.

Once the material had finished transitioning between the base and snow textures, it would begin adjusting the height — that way it wouldn't look like the ground was bulging up.

This was a straightforward solution for creating a buildup effect, but it came with one big problem: sharp vertical edges on a mesh, such as a 90° edge of a box, would magically float away whereas more gradual edges would stretch.

This is a limitation of the `VertexNormalWS` — for now, I've solved this by exposing a toggle which disables the height effects within the Material Instance, and artists will have to use to manage the edge case on a per-mesh basis.

Alternatively, if we have the resources to bake a mask for the mesh ahead of time, we can use this to feather the edges of the transition which would eliminate this issue. In the meantime, I'll be looking into a lightweight means to generate that mask on the fly to prevent additional work for my team.

Snow shimmers in sunlight

Snow has a natural shimmer when hit with direct sunlight. This attention to detail would elevate the artistic quality of my material beyond a basic image texture.

I was considering using an animated texture but this would introduce repetition and additional memory usage. Instead, I began exploring screen space effects.

Using a single low resolution image texture, I created two masks:

  • The first mask tiled across the surface of the snow and created the location of small emissive dots.
  • The second mask used `ScreenPosition` and `ScreenResolution` to create a version of the texture that was fixed in place on the screen.

Layering the masks created a parallax effect displaying a sparkle where the white areas of the masks overlap.

But I also had to ensure that this effect only occurred when the snow was being hit with a light source. Thankfully, Unreal Engine has a node for that already. Using `Atmosphere Sun Light Vector` and `VectorNormalWS`, I created a mask so that the sparkles only appear in the light.

This produces a more natural sparkle effect than an animation because it more closely replicates what happens in real life. As the camera moves so do the sparkles — it's as if the light is catching your eye as you move.

Unfortunately, in bright sunlight the white of the snow can somewhat obscure the white sparkles, but I think this is still a nice attention to detail with relatively low performance impact.

What's next?

I'll be releasing a part 2 where I dive into additional screen space effects, altering character animation to respond to weather effects, real-time snow deformations for footprints, and a particle system for snowfall.


 

 

 

Using Format