- Unreal Development Kit Game Design Cookbook
- Thomas Mooney
- 437字
- 2021-08-20 15:41:21
Scattering meshes on a Landscape using the Foliage tool
Foliage Mode extends the Landscape tools, and sits alongside Landscape Mode in the editor. In this recipe we'll scatter rock meshes on a Landscape surface, since the Foliage tool, while great for making forests and grass, is not limited to just that.
Getting ready
Open the file Packt_01_Foliage_Start.UDK. This extends from the previous example.
How to do it...
- Press Foliage Mode, shown on the right-hand side in the previous image. Then press Ctrl + Shift + F and in the Browser search for rock to expose StaticMesh assets of that type (although you can use whatever meshes you like).
- In the Foliage dialog there is an area, Meshes, to drop assets to be used. You can drag in several.
- The meshes will appear there and each will have parameters for setting scale, count, and angle when brushed. They can also be assigned to separate layers in the Landscape using existing Parameter Names (such as first, second, third).
- There are three icons that allow you to control the StaticMesh assets used. The first icon is Hide Details [ ], which deselects and effectively disables the mesh from being brushed to the Landscape. The next screenshot shows one of the layers grayed out. The second icon is Show Paint Settings [ ], which exposes values for controlling scale and density. Highlight an available mesh and set a Scale Min value of 1 and a Max value of 5 (though a good value depends on the actual size of the mesh used). The third icon is Show Settings for Placed Instances [ ], which returns info for the meshes where they are used, such as the total count in the scene.
- To paint, at the top of the Foliage Editor, you can adjust a slider for Brush Size and Paint Density, which you should see update in the scene as a pulsing white circle cursor. Then in the view, move the cursor over the Landscape, hold Ctrl, and click or stroke.
- The last thing to point out is that you can remove meshes from the list using the icon [ ] and you can swap out meshes from the browser using the assign icon for the Foliage Editor [ ], and locate the current mesh in the browser using the magnifying glass [ ].