HFC Tutorial

Second part: General improvements

The previous steps led us to create a basic grass field in a few minutes. In this section, we'll deal with some more settings which can improve the overall aspect of the scene. A third part will introduce blade-level detail.

Complex packing

One of the most noticeable issues with our image is that the grass blades form a repetitive pattern. The basic packing algorithm always ties a block with the closest one in the dictionary, in its closest orientation. It is especially noticeable in flat areas, where the selected block is always the same in the same position.

If you uncheck the "basic packing" box, the packing algorithm changes. It lists, for each block, every acceptable block in the dictionary, in every acceptable position. It then matches the block with a random one from the list. This method is slower, but usually gives much better results at no added memory expense. Click "pack", export overwriting your previous file, and render. This is the result. Please note that the effect of this option is more or less visible, depending on the scene, amount of blades, and orientation.

Number of blades

By default, HFC places 30000 grass blades. In our scene, we have around 10000 blocks, which only makes 3 blades per block. This is another reason for our repetitiveness seen above. Given the high packing efficiency, we can afford to use 3 million blades. You will notice that the exported file size increases, though much lower than the number of blades. This increase might be more noticeable using 10 million blades or less efficient packing parameters. Now the mount of blades reaches around 300 per block, with 10 times thinner blades. Export and render again. The difference is striking, but would be even more in close-up.

Dealing with slope

Growing grass on the steep sides of a cliff is not easy, even if modern glue might help. HFC features a simplistic grass growth filtering taking slope into account.

A slider allows tuning, while a small diagram shows the filtering function. These settings modify the probability that a grass blade will grow on a given point, depending on the local slope.

If the slider is on the left half of its path, the probability for a blade to grow on a vertical wall is changed. For instance, at the first quarter, the diagram on the right shows that the growth probability on a vertical place is 50%. It is 75% for a 45° slope, and 100% on a flat area. Reaching the half of the slider path, the probability falls to zero for vertical areas, 50% for 45°, and 100% on flat lands.

Above half the path, the null probability extends to lower slopes. Setting the slider to the two thirds of its path shows the diagram drawn on the right: no grass may grow at slopes over 60°, 50% may grow at 30°, and always 100% on flat areas.

Setting this value to 65° gives the following result:

Masks for roads, ponds...

To walk on our cliff more easily, a footpath would help. Moreover, you won't often see grass growing under the ocean. To solve these issues, a masking mechanism has been included in HFC.

The idea is to use a second greyscale image the same size as the HF, on which white areas mean that grass may grow, black areas prevent any growth, and grey zones give an intermadiate growth probability.

The HF image is he following:

On this image, we want both to add a footpath, and remove grass under a given height. The aim is thus to remove grass on the red areas:

Creating a white image on which the above red areas are painted black, we get the mask image needed by HFC:

A simple check consists in using the mask as a texture for the cliff. By the way, a different point of view will make the footpath more noticeable:

Check the "probability" box, open your mask, start packing, take a cup of coffee, export and render. The footpath is clearly at the right place, and grass no longer grows under the ocean level.

Well, I must admit I cheated a bit: I used curved blades, grouped in tufts and nicely textured. Would you like to do the same? Read on!

 


1. First contact Contents 3. Close-up


© François Dispot 2003