

When the viewer moves around, we add or remove grass objects in the distance by blending them in or out. But this is not enough: some polygons that use this texture must be combined in such a way that the individual polygons are not noticeable (see Section 7.3.2). In Section 7.3.1, we start by combining several blades of grass and displaying them in one texture. Fortunately, the solution is not too difficult. Independent of the camera position and direction, the appearance should be like that of an open countryside. 7.3 Preparation of the Grass ObjectsĪs we just mentioned, many blades of grass must be represented by few polygons. In Section 7.4, we discuss three different animation methods. In the next section, we build grass objects that meet these conditions.Īdditionally, we must be able to animate the grass realistically. Grass must appear dense from different lines of sight.Many blades of grass must be represented by few polygons.So we have to build a simple and useful alternative that meets the following conditions: A scene with countless blades of polygonal grass would not be displayable in real time with the graphics hardware available today. Additionally, a special version of our Codecreatures Benchmark application is included in this book's accompanying material, which offers an interactive demo mode.įigure 7-1 Screenshot of the Codecreatures Benchmark Application 7.2 Overviewįirst, we should realize that a detailed modeling of the individual blades of grass is not meaningful, because the number of polygons that would be required for larger meadows would be much too high. In this chapter, we describe a flexible, widely applicable grass simulation based on the grass effect shown in the benchmark. The Codecreatures Benchmark (published by Codecult in 2002) disproved this pessimistic assertion.

In the past, a high-quality grass simulation would have been considered too complex for real-time applications. The grass should look naturally grown and should wave realistically in the wind. We must be able to cover large areas of the terrain with it, without monopolizing the GPU. To simulate an idyllic nature scene in a realistic fashion, besides detailed trees and bushes, as well as a complex water and sky dome simulation, we need a high-quality grass effect. Rendering Countless Blades of Waving Grass The CD content, including demos and content, is available on the web and for download.Ĭhapter 7. You can purchase a beautifully printed version of this book, and others in the series, at a 30% discount courtesy of InformIT and Addison-Wesley. GPU Gems GPU Gems is now available, right here, online.
