Snow generator (POV-Ray)

by Oyonale
The MakeSnow macro projects blob elements on an object, making it look like it is covered by snow (or shaving cream...). The quot;snow" itself is a single blob, made of two layers (one of large particles, the other of smaller ones). This macro was developed for the imagePersistence, where it covers dozens of Xfrog trees (the ground itself is an isosurface). The macro could have other uses, like making moss, lichen, drops of paint etc. It gives better results on complex objects than on flat ones. It doesn't work well on sharp angles, where the blob particles tend to create overhangs.In 2008Nick Humphriesmade a few modifications in the macro (makesnow2.inc below) so that snow can deposit on text objects. Try this version if the regular one does not work.The "Lost bus" image below is a demonstration scene for the MakeSnow macro. The entire scene is written in pure POV-Ray script (no meshes or image_maps). This scene applies the MakeSnow macro to the snow banks, the bus and the twigs.Main parametersParameterUseParticlesNumber of snow particles. Values depend on the surface to be covered, from 100 to several thousands. More particles mean more parsing and rendering time.SizeMore or less the size of the biggest particle. If 1 POV unit = 1 centimeter, Size can be between 2 and 100.ThicknessRelative thickness of the particles. 1 is a good value that gives slight flattened ones. Smaller values will flatten the particles even more, which can cause bizarre ovehangs; higher value give a blobby aspect.MinHeight, MaxHeightThe macro works by "dropping" a blob component from a certain position, by creating the component on the first surface met. Areas below this (like lower branches) are protected from the snow. MinHeight and MaxHeight are the relative minimum and maximum "drop" height : 0 is the bottom of the object and 1 its heighest point. Having MinHeight = 1 makes sure that snow won't get in unprotected areas.DirectionDirection vector of the fall. A vertical fall without wind is -y. A strong wind from the sides would need a direction with an horizontal component such as x or z.