[RELEASED] ❄️Screen Space Snow ❄️

Have you ever wanted to winterize your game? Sure, you can swap every material for a snow-covered or icy variant. This can be tedious. Don’t you wish there was a way of adding snow to your scene, with just 1 effect?

This is my solution to that problem, and I’m sharing it with you all! The screen space snow effect lets you control snow in your scene, at a very large scale. It works using the deferred rendering path.

You can control how the snow looks, and behaves with your scene. Control the snow material, by using different textures to control the snow (using the same BRDFs using uses for Physically Based Rendering). Normal maps and textures get projected onto your scene, without the need for any secondary UV maps on your objects.

You can also occlude snow, by tagging objects that it shouldn’t affect. You can customize the snow to

  • Excluding skinned mesh renderers

  • Exclude paths, or hot surfaces, which might not have a lot of snow

  • Exclude an entire volume! Turn off snow inside your buildings or under objects

The snow effect works great with other snow effects too. If you have an icicle shader, it should seamlessly integrate with it. This is because the snow is applied after your scene is rendered, so your custom Surface Shaders still work!

If you don’t have an icicle shader, it’s fine. This effect ships with a simple shader to help illustrate that snow works with all other shaders:

Check it out, feel free to ask me any questions. Suggestions are appreciated, I’ve put it on the store for you, so let me know what interests you! This is my second iteration of this effect, and it now works with all unity lights, without any surprises. Please check it out on the store for a list of things it can and can’t do.

Thanks for your continued support and interest!

  • David
5 Likes

This looks good :slight_smile:

How does the exclude work? Is there any way to exclude objects drawn with the Graphics.DrawMesh/DrawMeshInstanced API?

Lennart

Exclude works in the command buffers set up for the effect. There’s a simple buffer that you can feel free to write in to. It’s used to control the effect, with enough precision for a falloff gradient too! So it sounds like you know your way around, and can definitely draw into this buffer from that API. The only issue with it being, I am not sure exactly when the DrawMesh/DrawMeshInstanced API actually draws. It’s just queued to render if I’m not mistaken. The command buffers draw excluded meshes before the reflections in the deferred rendering pipeline. So you might have better luck with a command buffer at the same location. Command buffers can DrawMesh and DrawMeshInstanced as well!

David

Good, that sounds like it would work. :slight_smile:

Do you have an override shader that should be used when rendering to the buffer?

I have a standalone occlusion shader, with multiple passes. The first pass is used for the cube volumes, the second one for spherical volumes, and the third pass is used with custom renderers. So using a material with this shader, and pass #3 should do the trick :slight_smile:

The first two passes are used for this effect:

And the 3rd pass I mentioned is used for occlusion (what you want)

Hi David. Cool work!

  1. Shader icicles included in the package? Or where i can find it?
  2. What is different from “Global Snow” pack?
  3. How much less FPS?
  4. It’s worked in PC build and webGl?

Hey Aleks,

Wow I never even saw the Global Snow pack, I thought I did my research but, I guess I missed it. From what I can see, it looks like their snow is using a harsh cutoff. Maybe this can be adjusted in their settings, but in my snow effect, it’s always a nice realistic blend :slight_smile: Kronnects shader also doesn’t work with mobile so, I assume it’s also using deferred rendering. Meaning we both have similar limitations.

With my snow, there is the same options for occlusion, but also occlusion volumes. These volumes can have feathering, and can also add snow to a scene. I recently uploaded a video showcasing some of this, and I am finishing up a demo-reel flythrough :slight_smile: I have a new version of the asset that I will upload tonight. It works with WebGL, PC, and I tested it with Oculus rift and HTC vive as well.

The frame rates are tricky. I am not an expert in profiling, but from running the game with and without snow for about ten minutes, I didn’t see any drops in frame rate. I will explore this further. I have a GTX 970 with a small overclock on it right now. I will do some more profiling and make sure to add it to this thread.

The shader icicles are inside the package :slight_smile: They aren’t the highlight, but maybe I will clean them up for a different asset. It’s there to show how snow can work with any shader!

Here’s a simple tutorial video I made with the new version of the snow I will upload, so you can see the workflow and customization options,

1 Like

I’ve updated the package on the asset store to be the newest version, with all the features in the above video included.

Here’s a simple demo reel I made with the effect, showing a night and day scene to show off lighting.

1 Like

How many ms does the effect take on your GTX 970?

I ran the profiler with the exact same scene from the video above:

The scene took 4.29ms for everything in total. This is with a resolution of 1920x1080.

The first part of my effect is in a command buffer, set to execute before the G buffer. This appears as 0ms (it just clears the snow coverage buffer, so that’s to be expected)

The main effect is in a command buffer set to execute before reflections. I chose this spot because, the depth buffer is resolved at this point in time. It executed in 0.13ms. Whatever value you see on your GPU, shouldn’t scale with the complexity of any scene you’re rendering. This is because it’s a screen space effect.

If you don’t use textured snow, you will have faster snow. For the profiling I did above, I had all of the advanced texture settings: Triplanar projection mapping, Tiling fix turned on, Normal maps, Albedo, and Specular lookup texture. Without any texturing, the scene rendered in 0.11ms.

* I did have a lot of spikes when this scene was rendering, but none of the spikes were caused by the snow, and it stayed surprisingly consistent throughout everything. The spikes were still present with snow turned off.

That’s quite cheap. What impact do the exclusion volumes have? And would it also be possible to have a control texture for e. g. the terrain?

Hi David,

does it work with multiple camera setups?

For just the terrain, it’s not difficult to add a control texture. But this support isn’t written directly in. The two ways to limit snow on a surface as it stands are with volumes, or entire renderers. You can control the level of snow with these methods, but it’s not driven by a texture.

For the impact of exclusion volumes, it’s very small. With a 400 cube volumes in a 20x20 array, each was 10x10x10 meters, and the camera was positioned so it drew each one. The performance went from 0.11ms to 0.37ms. The math behind the occlusion volumes is very simple and fast, using analytical distance fields. It’s also why occlusion volumes are only spheres and boxes right now.

1 Like

It does! Extremely well. I’ve tested the effect with HTC vive and Oculus rift, which are both stereoscopic camera rigs. Also when you’re in the scene view, it’s drawing on the scene view as well as in game. It’s worked with multiple cameras since day 1 :slight_smile: As long as both cameras are deferred. I believe the scene view camera uses the same rendering path as your main game camera. So even if your main game camera is marked as forward, it will still work on other game cameras (even if it’s not showing up in the scene view).

Can this snow asset work with Sleepless Footsteps?

Hmm, I am not sure. I don’t own that asset myself, but I looked at the video and the description. The author mentions Plane Textures, and also those textures include transparency. What this tells me is that these footsteps are transparent objects. Transparent objects are drawn after solid objects are drawn. The screen space snow works with the GBuffer in deferred rendering, so it would put a layer of snow on top of your scene before the footprints.

My educated guess is, yes, it should work seamlessly with sleepless footsteps. I will reach out to the author and edit this if it doesn’t work.

Well, It does work!
Neat!3385521--265953--Snow_And_Footstep.png

Glad it’s working :slight_smile:

Great, I will purchase it then today :slight_smile:

EDIT: It is submitted with 2017.2. Will it work with an older version? We still use 5.6.3 at the moment.

Hmmm, I am not sure. One part has got me worried, I don’t know if CameraEvent.BeforeReflections was part of 5.6.3.

Let me download 5.6.3, and I will get back to you,