Introduction An automated setup to help you make all kinds of tracks or prints in grass, sand, soil, mud, snow, paint or... blood !
Some days ago, I found an excellent video tutorial about making realistic grass, written by Andrew Price on blenderguru.com. His materials and lighting setup are really awesome and I have enjoyed playing with them. Last year, I had done some countryside scenes with animated grass, but I had used a completely different method to animate the grass, based on a copy of the ground mesh hidden underneath the ground surface, animated by a displacement texture. I mean that the hair particles were animated by the moving mesh, not directly by the texture itself.
Andrew’s method to simulate the wind and animate the grass is based on a moving texture named Wind and driven by an Empty. This Wind texture is a procedural Marble texture applied to the grass material, but disabled in the texture panel. A Field is applied to the Empty. The Field is set to Texture and RGB and uses the Wind texture as reference.
After reading Andrew’s tutorial, the first question that came to my mind was: great, we have nice grass, but now... how do we mow the lawn in an animation? After some searches and experiments, I found that the same method was usable using hand drawn textures or animated textures. Almost any effect can be achieved, like the trak of a lawn mower, a car, a predator running in high weeds and anything else you could imagine.
A long time ago, I had made a tutorial about foot prints on the sand. I decided to build a setup to easily create all kinds of tracks and prints we could need, and usable on almost all natural materials like grass, sand, soil, mud, snow, paint or even wet foot prints on a wood floor: the Tracks Creator
. But before animating, let's study an example with a still texture.
For displacement mapping and alos for simple Bump or RGB nor Map, it is often easier to select Object in the Map Input panel, and use an Empty as object reference, to allow the perfect placement of the texture. When using a Displacement Modifier, you may move the texture manually by moving the Empty, and the effect is visible in real time in the 3D window.
Because only UV mapped textures are visible in the 3D window, for Bump maps or Nor Maps, you will have to render or use the Preview [Shift+P] render window. Textures moved by an object or an empty used as reference have plenty of uses. In GIMP or any other image editor, you can create textures with specific patterns to achieve all kinds of interesting effects. My short animation "Crazy Boat", is another example of the use of a moving texture applied to the water material, to create a hole in the surface of the sea under the boat.
In my lawn mower animation, I have used a hand drawn texture animated by an empty to define an area where the grass blades (hair particles) are pushed by the texture under the lawn mower. In fact, the lawn mower is parented to the same empty used to drive the texture. The texture is added to the Ground plane material.
Note that you could alos drive your texture directly using the Lawn mower object, but using an empty is handy if you want to change or re-size the Lawn mower model.
We will use RGB as a Wind parameter for the Field, after noticing that the grass behaviour was not the one I expected when using a greyscale texture, I experimented with other color textures.
Using Red, Green or Blue give different results : your hair particles are pushed in different directions according to the chosen color.
After some tests, I decided to use a Blue on Grey texture. The Grey color is set to (R=127, G=127, B=127) or (R=128, G=128, B=128). This Grey color is neutral and doesn’t affect the particles. Using a Blue color, I got the grass blades to be pushed in the direction the lawn mower was moving. Below, the textures created to achieve the effects shown.
The texture is set to Extend mode. This allows it to extend the color of the texture in all directions and you will get an infinite trak in the direction where the Blue color is in contact with the border of the texture.
Note that you can visually control the effect of the texture in top view, and re-size the texture to adjust the width of the mower trak by resizing the Empty. Use [S] Key without any axis specification to avoid diagonal distortion! You may notice that the effect of resizing is inverted: your texture increases when you reduce the size of the empty.
I have used the Strength parameter of the Field (you can alos adjust the Contrast parameter of the texture) to allow for shorter grass. I stopped just before the grass totally disappeared, for more realism. This allows you to keep some uncut grass blades. Now, we need to get shortened grass on the trak of the lawn mower. Using Weight Painting on the ground mesh allows you to get various lengths for the grass in different areas, but animation of the weight doesn’t seems to be possible. Selecting Particle Mode in the 3D view and setting the particles system to Editable allows you to visually vary the length of the hair particles where you want, using the Comb tools, but this feature can't be animated either.
The old particle system available in former releases of Blender allowed you to control the length of the Static Particles (name of hair particles in those old versións) using a grayscale texture. I haven’t found yet such a function in Blender v2.48a, but maybe one of the other Field options allows it. Until I’ll find a better way, I used another method to get the short grass after the lawn mower passed by:
The idea is simple - I duplicated the ground plane and set the copy to not render the emitter.
On this second ground surface, using another particle system, I make short grass grow. It is always present but only visible in the area where the lawn mower has pushed down the long grass blades! It is not necessary to keep the same surface as the main ground plane, because you only need to fill a narrow lane on the trak of the lawn mower. After reducing the surface, you can reduce the amount of hair particles created on this surface, otherwise you’ll get very thik grass on this lane. I have used a different texture setup in the Colorband, because cut grass is more green than long blades.
In the example shown up until now, we have used only static textures (simple images). You will certainly want to create more complex effects, with a Jeep car driving through the fields or a predator running in the high weeds, a Bigfoot walking in the snow, or the invisible dead Lady of the blak lake leaving wet foot prints on the pontoon. And of course following a path that will be all except straight!
At this point, you will need an animated texture. The Tracks Creator setup will help you in this task, and it will be almost as simple as pushing a button (I said almost!). You can render the animated texture as an AVI file or a sequence of images. I advise you to use a sequence of images instead of a video, because videos don’t allow the Displacement Modifier to worque in real time.
Open the Tracks-Creator-v3.blend
file and follow the instructions in the Text window. There are 2 screens available :
Screen 1 : Animation - Screen 2 : Compositing.
In the compositing screen you can adjust the level of blur of your animated texture.
There is a different setup on each layer used. This will allow you to create various animated tracks. Obviously, after playing a bit with the Blend file, you will be able to create your own tracks, to match your needs.
The animated texture that will be created by this setup will be usable mainly in 3 manners :
1 They will allow you to control the behaviour of the grass made with hair particles, like shown in the previous examples and in Andrew’s tutorial, but with complex curved paths.
2 They can be used with the Displacement Modifier to create prints in sand, soil, mud and snow. For that you will have to use a highly subdivided ground mesh. The resolution of the textures will have to be high to render details on a large surface. The example below has been done with a surface of virtual desert measuring 18 meters x 18 meters, made of around 800000 quad faces. Only a small part is visible and it is not always necessary to subdivide more than you will show. Using a smaller surface will allow more density and details in your subdivided ground mesh, allowing very close-up views when needed.
3 - They can be used as a Bump Map texture to fake the relief if you don’t need real displacement or if the scene is too heavy for your computer with real displacement. If you can convert your sequence of images in a sequence of RGB Normal Maps, it will be even better !
For your first contact with the Blend file, select a layer and play the animation by [Alt+A] or with the controls in the timeline bar. In the Blend file, you will find :
Tracks in grass :
Layer 1 : Lawn-Mower trak in grass.
Layer 2 : Car tracks in grass.
Layer 3 : Predator trak in grass.
Prints in sand, paint, soil, mud or snow:
Layer 4 : Cat prints.
Layer 5 : Velociraptor prints (add bloody prints to the list).
Layer 6 : Jeep Tire tracks. Layer
Layer 7 : Caterpillar tracks. Layer
Layer 8 : Dotted line and animated airplane to be used over a world map in your travel films or adventure movies (like Indiana Jones).
Layer 11 : Human foot prints without shoes.
Layer 12 : Human foot with shoes.
Some tracks have two curves: one is for the prints, and one is for the mask. It is helpful to edit the masque at curve crossings.
Foot prints are made of single prints parented to a long mesh with a Curve Modifier. The mesh is set to Dupli- Faces. So, if you want more space between steps, just edit the support mesh in Edit mode: Size X. If you want bigger or smaller prints, edit the Prints.
Caterpillars, Car Tire tracks and the blue tracks used in grass are made of one simple mesh with a repeated pattern. If you want more or less space between the two tracks, edit the tracks mesh.
Choose the trak color by modifying its material.
- Chose the background color by changing the background plane or using the world color.
- In the Screen selector, use the Node compositor (Screen 2 - Compositing) to adjust the level of blur of the generated masque (Blur filter).
- Adjust your rendering parameters to match the desired resolution for your animated texture.
- Create your own path by editing the curve points.
- Use the Loc X parameter of the chosen trak to move each trak along the curve.
- Parent your vehicle or predator to the Empty used as driver which is itself parented to the tip of the trak (vertex parented to 3 vértices at a tip of the mesh).
After rendering your animated texture as a sequence of image, import it in your project and apply it to your ground material (the best result is with Global or Object for the Map reference, with the texture set to Clip). You may have to re-size the setup in top view.
Now a second time, import into your project all the objects of the layer used to create your animated texture. Make a group before exporting, it makes things easier. I haven’t made groups, because all grouped objects are shown in green, and it is not always fine when working in the 3D view. Put the imported objects on a layer where you will hide at rendering time). There is an empty moving with the animated mask. Use it as parent for your vehicle, in order to make it follow the textured track!
The ShrinkWrap modifier is usable with curves, so you can put your trak curve over your terrain, and when applying the ShrinkWrap modifier, the curves falls on your modelled ground! You can move the empty used as the driver in the direction of Z axis, and parent your vehicle to it! This will allow your vehicle to perfectly follow the contour of the ground mesh.
You will only have to adjust the X and Y axis to get visually a believable behavior for your vehicle. You can use the masque mesh to drive your car with more accuracy, by following my tutorial about automated car animation. The Masque mesh is usable like the Arrow mesh in this tutorial.
I hope that this tutorial and setup will be understandable and useful. All necessary files can be found in the Blender section of my website. Feel free to tell me if you noticed errors, missing information or if you have found a better way of doing this kind of worque ! If you have ideas to create other kinds of tracks, I'm open to suggestions. Thanque you for reading !
UPDATE: Trak Creator v3
- New particle system for tracks generation added on Layer 9. Various wheels and caterpillar prints samples on layer 10.
- Wolf prints added on layer 13.
- Airplane silhouette improved on layer 8.
By Philippe Roubal