Snow
- Last UpdatedDec 16, 2023
- 4 minute read
The Snow node creates a snow effect.
-
The characteristics of the snow can be modified at run time.
-
There can be just one snow node per project.
For more information, see Snow Particles Renderer.

Platform support
This node is supported on XR-Windows platform only.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
No support |
No support |
No support |
No support |
|
|
|
|
|
|
Heightmap or Drain
Usually, snow should not pass through solid objects.
The Snow node supports two different possibilities to determine where snow stops falling:
-
Height map
-
Drain
Height map
During loading time, an heightmap image is generated by the system. This map is generated positioning a special camera at the top of the scene.
The heightmap box (heightmapCenter, heightmapSize) defines the area to be included in the heightmap texture calculation.
For each pixel of the map, it is defined at which height the snow should disappear.
The precision of this approach relies on several factors.
|
Factor |
Description |
|---|---|
|
textureSize |
Larger maps are more precise because each pixel covers a smaller area. |
|
textureFormat |
Increasing pixel format increases precision. |
Drain
The Drain approach is simpler. It involves setting an absolute height at which snow drops disappear.
You can use this method in landscapes where there are no high structures.
Code example
This is a code example for Snow.
<Snow name="3DSnow" enabled="false" wind="0 0 0" heightmapPosition="-249 35 -173" heightmapSize="1400 80 1400" textureSize="2048" />
Snow fields
These are the fields for Snow node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > Snow
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
emitterPosition |
svec3 |
Optional |
0 0 |
Emitter position. This is used when followRenderCamera is false. |
|
enabled |
sbool |
Optional |
true |
Enables/disables the snow effect. |
|
followRenderCamera |
sbool |
Optional |
true |
When enabled, the emitter position moves each frame to match the Camera used for rendering. |
|
forcesMultiplier |
sfloat |
Optional |
0.73 |
Scales all the forces in the simulation. Can be used while tweaking forces. Resets the simulation. |
|
frameZeroAutoPopulate |
sbool |
Optional |
true |
Populates the simulation with random particles on the first simulation frame, otherwise the particles start from a simulated position (but the screen could be empty until the particles fall down). Resets the simulation. |
|
frameZeroYRange |
sfloat |
Optional |
The Y range where the particles are spawned if frameZeroAutoPopulate is true. It is relative to the emitter position. Resets the simulation. |
|
|
gravity |
svec3 |
Optional |
0 -9.8 0 |
Gravity (or main force). |
|
heightmapPosition |
svec3 |
Optional |
0 0 0 |
Defines the center of the area handled by heightmap. |
|
heightmapSize |
svec3 |
Optional |
100 100 100 |
Defines the size of the heightmap box on the three dimensions. |
|
maxParticles |
sint |
Optional |
42000 |
Maximum number of particles available for the simulation. Should not be changed in runtime. Resets the simulation. |
|
mode |
senum |
Optional |
heightmapRT |
Specifies mode as drain or heightmapRT. |
|
numParticles |
sint |
Optional |
42000 |
Number of particles to be processed and rendered. Must be less (or equal) than maxParticles. |
|
opacity |
sfloat |
Optional |
1 |
Pixel opacity. |
|
particleWidth |
sfloat |
Optional |
0.0316 |
Width of the rendered particles. |
|
particleYAspect |
sfloat |
Optional |
1.55 |
Y aspect ratio of the rendered particles (Y= Width x YAspect). |
|
randomForceRange |
svec3 |
Optional |
2 3 4 |
Additional force added randomly to each particle.
|
|
shrinkMinValue |
sfloat |
Optional |
0.3 |
Minimum shrink value that the particles can have. Otherwise, they would disappear. Particles shrink when viewed towards the direction of the camera. This way when looking up (or down) the particles appear less wide. 0 means full shrink. 1 means no shrink at all. |
|
spawnRadius |
sfloat |
Optional |
100 |
Particles spawn radius (X and Z components). |
|
spawnY |
sfloat |
Optional |
5 |
Particles spawn Y (relative to the emitter position, Y= emitY + spawnY). |
|
spawnYRandomRange |
sfloat |
Optional |
2 |
Particles spawn range on the Y axis. |
|
template |
sstring |
modules/physx/template_snow |
No default |
Name of the template particle system loaded as parameter starting point. It can be set at runtime to change the particle system settings. |
|
texture |
sstring |
Optional |
Rain.png |
Name of the rain drop texture used for the effect. |
|
textureFormat |
senum |
Optional |
U8 |
Defines the precision to be used for each pixel of the heightmap texture among U8,U16,F16 and F32. Larger formats allow more precision. Use float formats only when there is a large range of different heights. |
|
textureSize |
senum |
Optional |
1024 |
Selects heightmap texture size among 512,1024,2048 and \\4096\\. |
|
wind |
svec3 |
Optional |
3 0 1 |
Additional force. |
|
yDrain |
sfloat |
Optional |
0 |
The Y value where the Particles die. Drain and heightMap cannot be used at the same time. |