skip to Main Content

Some objects that get clipped when Global Snow is enabled (forward rendering)

Global Snow uses replacement shaders to render a snow-covered version of the geometry. This snow layer is rendered before transparent objects as a screen-space effect.

Objects that render during the transparent queue won’t be clipped by Global Snow, so this issue should only happen when some opaque shaders don’t expose the RenderType appropriately (which is a recommendation). Try using Fix Materials option in Scene Setup section of the inspector.

Another solution to this issue involves editing that object shader and set the RenderType tag to one of the following:

  • Opaque”: this render type will cover the geometry with snow, and also allow footprints and terrain marks. It can also expose holes or transparent parts not covered by snow using alpha channel IF the “OpaqueCutout” parameter is enabled in Global Snow inspector.
  • TransparentCutout”: same than before but will also take into account the alpha channel to discard those pixels REGARDLESS of the OpaqueCutout parameter.
  • TerrainOpaque”: same that “Opaque” but will ALWAYS ignore alpha channel. Commonly used for full opaque objects.
  • AntiSnow”: will cause the geometry to prevent any kind of snow covering. Useful for water or liquid objects that render in the opaque queue or anything you want to exclude at shader level. Note that you can also exclude objects from GlobalSnow using the Layer Mask parameter under Coverage section in the inspector or adding the GlobalSnowIgnoreCoverage script to that gameobject.

When you edit the shader, the change should read like this (other tags should not be touched!):

SubShader {

    Tags { "RenderType"="Opaque" ... }
...
}

Other render types supported are:

  • TreeOpaque”: used for covering opaque parts of standard Unity tree.
  • SnowedSpeedTree”: used as a replacement for the SpeedTree shader. This tag is used when you enable the “Update SpeedTree” parameter in GlobalSnow inspector.
  • SnowedSpeedTreeBillboard”: same but for the billboard trees.
  • Grass”: used to cover standard Unity grass objects.
  • GrassBillboard”: used to cover standard Unity grass billboard objects.

How can I exclude terrain from snow in deferred rendering path?

This is a 2-step process:

  1. The terrain material needs to be switched to the TerrainWithoutSnow material provided by Global Snow. This material can be found in GlobalSnow/Resources/Common/ExcludedTerrain folder.
  2. Edit global snow shader and uncomment the lines related to stencil. This shader is located in GlobalSnow/Resources/Worlkflow/Deferred/Shaders/SnowOverlay.shader file.

Once you open the file, you will immediately see the commented lines. Remove the comment tags (/* and */) to enable the stencil filter

There are no snow marks on some objects, like floating platforms. They only work on the terrain.

You need to add the GlobalSnowCollisionDetector script to any geometry (except for the terrain) if you want it to support terrain marks when collisions occurs. Demo scene contains some geometry that allows terrain marks over them using this approach. You can also add custom terrain marks using code, see below

How can I manually add footprints over any place?

You can use this code to add footprints at any position:

GlobalSnow snow = GlobalSnow.instance;
snow.FootprintAt(position, direction);

Can I customize footprint shape?

Yes, the footprint feature uses the Footprint texture located in Resources/Textures folder. Feel free to use another texture for your footprints

Alternatively, you can use the Terrain Marks feature to generate footprints-like marks as your FPS character moves (enable the FPS Marks option)

Can I change the size of the terrain marks?

You can specify a default mark size using the GlobalSnow inspector or if using the API you can pass a value between 0 and 1. You can also add GlobalSnowColliderExtraInfo script to any object and set the mark size individually in this script.

I see terrain marks over the distance, but nothing should be causing them

Increase the Extents parameter or reduce the View Distance parameter in the Terrain Marks section of Global Snow inspector

Is there any footfall option?

You can find 3 snow footfalls audio clips inside GlobalSnow/Resources/Footfalls folder. Assign them to your First Person Controller script (footsteps sounds property).

Note that there’s currently no way to determine if there’s snow under players feet. You could use a RayCast from above the player position to check if it’s under cover and switch between normal footfalls and snow footfalls

How to enable snow reflections on water? (forward rendering)

Support for snow reflections in Unity Water Pro system from Standard Assets is included.

For instructions on setting up, please check the README file inside GlobalSnow/Extras/WaterReflections folder

Does it work with VR/Single Pass Stereo Rendering?

VR support is supported/not guaranteed due to the differences in Unity versions, VR modes, pipelines and VR SDK features.

It’s recommended to use deferred rendering since the performance will be better.

How can I manually add static snow over moving objects?

Unity’s standard tree billboards are not covered by snow. Is it possible to use them?

Forward rendering mode

Standard Tree billboards render as transparent objects hence you need to make a couple of changes:

  1. Edit GlobalSnow.shader and uncomment the last SubShader section related to TreeBillboard.
  2. Edit GlobalSnow.cs script and comment out [ImageEffectOpaque] just before OnRenderImage method.

Deferred rendering mode

Locate the GrassAndBillboardsReplacementShaders package inside the folder Resources/Workflow_Deferred_Shaders/Grass & Billboards and import it.

Once imported, they should automatically override the default shaders (it’s possible that you need to reload the scene). 

Compilation takes a long time / GlobalSnow adds many shader variants, can I reduce them?

If you use deferred mode, you can rename GlobalSnow.shader file to something like “GlobalSnow.shader.old” inside the folder Resources/Workflow_Forward/Shaders. This way, Unity won’t waste time compiling this complex snow shader.

If you use forward rendering mode, edit GlobalSnow.shader file and look for these groups of keywords:

#pragma multi_compile __ GLOBALSNOW_FLAT_SHADING GLOBALSNOW_RELIEF GLOBALSNOW_OCCLUSION
#pragma multi_compile __ GLOBALSNOW_OPAQUE_CUTOUT
#pragma multi_compile __ GLOBALSNOW_FOOTPRINTS
#pragma multi_compile __ GLOBALSNOW_TERRAINMARKS

For example, if you really want to use terrain marks, you could replace this line:

#pragma multi_compile __ GLOBALSNOW_TERRAINMARKS

with

#define GLOBALSNOW_TERRAINMARKS 1

This change will enforce the use of terrain marks without multiplying the number of shader variants while also reducing compilation time.

Can I add “holes” into the terrain?

If you use a custom terrain shader that support holes, you can use the “CircularHole” or “QuadHole” prefabs located in GlobalSnow/Resources/Prefabs folder to erase the snow over the entrance of the hole.

These prefabs are just normal geometry what use a custom material “GlobalSnowEraser” and have the “GlobalSnowIgnoreCoverage” script attached. You can use any other geometry, assign the same material and script and it will act as a stencil object – snow will not appear behind that geometry. 

Grass appears transparent?

If you have issues with the grass or grass billboard included in the folder Global Snow / Resources / Workflow_Deferred/Shaders / Grass & Billboards in deferred rendering path try the following:

Option 1:

Edit WavingGrass.shader and WavingGrassBillboard.shader and replace

"Queue" = "Geometry+200"

with

"Queue" = "Geometry+1200"

Option 2:

Edit WavingGrass.shader and WavingGrassBillboard.shader and do not modify the Queue tag but instead comment out this pragma:

//  exclude_path:deferred

My FPS weapon is receiving snow. How can I exclude it?

To exclude objects from snow, usually the exclusion options detailed in this manual apply. However, since FPS weapons render very close to the camera near clip plane, we can just exclude any snow coverage if the position of the pixel in the depth buffer is very small. This trick only works for deferred rendering path.

Edit GlobalSnowDeferredOptions.cginc file and uncomment

EXCLUDE_NEAR_SNOW

Save the changes and verify the result in your scene. You may need to increase the NEAR_DISTANCE_SNOW value if the weapon still receives snow.

How can I programmatically know if there’s snow at any position?

Use the method

GetSnowAmountAt(worldPosition);

This method returns 0 if there’s no snow, or a value greater than 0 if there’s snow at that position.

How can I programmatically modify the coverage mask texture?

Use the methods MaskFill and MaskFillArea to modify the contents of the coverage mask. The MaskFillArea method provides different overloads and can accept a gameobject so it will update the coverage mask area under the given gameobject.

I have a question which is not covered in the guide

Please use the Support Forum and post your question there. Our team will get back to you shortly.

Back To Top