This tutorial shows a technique I came up with to create displaced trails in the snow. (I won't claim to be the first ever person to invent this, since most good ideas are usually not new ideas!).
If you want to see what the result looks like, then jump to the final page of this tutorial where you can download the animation at the bottom of the page.
- I need to create trails in the snow
- The trails need to react to the characters feet and also to the cloth simulation that is running on the characters clothes.
- It needs to be repeatable and pretty much automatic so that if the model or the animation changes, I won't have to repeat a huge amount of work.
- It also needs to work on a surface that can vary in height, i.e. not a perfectly flat surface.
Doesn't sound easy huh! Well it is, and I'm going to tell you how to do it.
You'll need a copy of Digital Fusion to follow this tutorial, but all decent compositing packages have the features that I describe. To be honest I reckon you could even do it in Photoshop now that CS has scripting support. (I wouldn't like to try it using Photoshop Actions, but if you manage to get it to work, let me know!)
To do this tutorial you need a snow surface and something with which to create trails in the snow. I'm going to just use a simple Sub-D plane for the snow and a ball to make the trails. I'm using simple objects so that I can provide you with complete scene files to download as this tutorial progresses. I can assure you that this technique easily scales to work with objects with as many polygons as you like.
The snow surface is a 10m x 10m grid in the XZ plane, subdivided 10 times along each direction, and I've pressed TAB to turn it into a subdivided surface. The ball is just a tesselated sphere (sometimes called a geosphere) subdivided at level 5 with a radius of 0.75m. Both objects are centered at the origin.
You can download the objects here
Start Lightwave Layout and load both objects. Since we want an undulating snow surface, we're going to apply some fractal noise to the grid as a displacement texture to the snow surface.
Firstly, make sure you set the subdivision order to "After Displacement" in the Object Properties->Geometry tab. Now go to the Object Properties->Deform tab and click on the "T" button next to Displacement Map. Set a procedural texture layer to the following settings:
Layer Type: Procedural Texture
Procedural Type: Turbulence
Texture Value: 1.0
Contrast: 100 %
Small Power: 1
Scale X: 5 m
Scale Y: 5 m
Scale Z: 5 m
Animate the ball moving across the snow surface, so that it intersects it in several places. Wherever the ball intersects is where the snow trails will be formed (or at least they will later when we've finished). I animated my ball over 180 frames, but you may want to do fewer to speed things up.
Now that we've got the geometry set up, we need to sort out how we're going to render this scene to generate the information we need.
What we want to obtain is a depth map for each frame showing how much the object has penetrated the snow surface. If it were a flat surface, this would be simple, but since our surface undulates, we're going to have to do something a little more sophisticated. For the moment however we'll ignore this, since we can solve this problem later in Digital Fusion.
So first of all, we need to set all of the objects to white and 100% luminosity. You must also set diffuse, specularity, and reflection to 0% as otherwise this will adversely affect the result.
Now modify the camera position, rotation, and zoom factor to the settings shown below. If you switch to camera view, the whole viewport should be covered exactly by the snow surface.
X = 0 m
H = 0 deg
Y = -500 m
P = -90 deg
Z = 0 m
B = 0 deg
Zoom Factor 100
If you're not using the objects that I've provided and you've used a different shaped surface, then adjust the zoom factor so that you can only just see the entire snow surface (be exact, it makes life easier later). You should also set your image size to use the same proportions as the snow surface, in this case square. I set my image to be 800 pixels x 800 pixels. This minimises image wastage on the rendered output.
We are moving the camera far away from the surface so as to minimise perspective distortion, since the camera in Lightwave doesn't provide orthographic projections.
What we want is for surfaces that are closer, to appear whiter. Basically, we want to create a depth map and we're going to use standard Lightwave fog to achieve this, since it gives us the most control.
next page >
Working out fog range