Brute Force - Snow & Ice Shader Documentation
4. Getting started
First thing you should do is load up the snow demo scene inside the asset package "Assets\BruteForce\Scenes\SnowIce"
You will see that some files have a Standard and URP version, choose accordingly.
Once the "01_SnowIce" or "01_SnowIceURP" is loaded you will be prompted to play the scene for a quick introduction. This will help you understand the asset better and showcase all its basic features in a complete environment.
In the first showcase you can use Left Click to dig the snow and wet the ice, Right Click to change snow into ice, Middle Click to pull snow upward.
You can click the top arrows on the screen to switch sub-showcases and the left and right arrows to switch showcases.
Additionally you can use WASD to move the ball when showcased, it works great as a player template leaving an interactive trail on the snow.
Importing it in your project and Components
To append the snow assets in your projects you can either copy and import one of the working showcase as a starting template or you can use the setup prefab. Keep in mind that if you need the interactive feature you have to append the CameraEffects in your scene. I will go into details on what components you need in the prefab for the snow to work properly:
The first main component you'll need if you want interactivity on your snow are the "Camera Effects" like a regular camera it will be used for rendering, but instead this one will render to a target texture namely: "RTSnow" and "RTSnowAdditional" and will have only ONE culling mask set to "TransparentFX", we only need to render the effects.
It needs to have a target texture set to a render texture and it also needs the script "BF_InteractiveEffects.cs" for the first one and "BF_InteractiveEffectsAdditional" for the second one (which is optional, more details below). This script will make sure your cameras will render to the render textures.
If you have a moving camera you'll need to set a transform to follow (preferably the camera). RTCamAdd MUST have your main camera as transform value.
If you don't know what the global names are do not change them.
If you do not need the interactive part of the shader you can disable the CameraEffects and the "Use RT" in the material pragmas for a small performance boost.
You can increase the size of the camera projection to increase the radius of the rendered effect at a precision cost (more details below), do not rotate the RTcamera.
I refer to the Snow/Ice shader simply as snow inside the project.
You can drag and drop any snow materials to a mesh or any assets you want to use as ground, I will explain in more depth how the Snow Shader works in the next page so you can be able to customize or create a snow material for your projects.
Particle System Effects
To control the interactive effect of the snow you can use a particle system set on the TransparentFX layer, the important thing to note is that only the rendered color matters:
Red color will turn snow into ice, Blue color will dig the snow, Green color will pull up the snow.
You can use anything that can be rendered to achieve the desired effect: meshes, sprites, particle systems etc...
This means you can place a colored quad in the TransparentFX layer to have a permanent snow effect in your scene.
Alternatively you can edit the "Duration" and "Start Lifetime" parameters of the particle system to either shorten or extend the effect duration.
Increasing the Render Texture size
Depending on your project, you can increase the size of the Render Texture field so you would be able to see snow effects from much further away.
To do so you'll need to select your RTCam in your scene and increase the "Size" Camera variable, keep in mind that increasing this value will decrease the effect resolution.
To increase the effect resolution you can change the "Size" of the RenderTexture to 2048x2048 or 4096x4096 by selecting the "RTSnow" in your project. Changing this value will greatly increase memory consumption.
Using the RTCamAdd to expand the Snow effect area
In addition to the RTCam I created an experimental additive RenderTexture effect which is much larger. This camera is optional but its use is highly recommended if you intend to use the effects on a large area.
When you assign the main camera to the "Main Camera" field in the BF_InteractiveEffectsAdditional script; the RTcamAdd will automatically change its position based on the main camera FOV.