# CWD-Sim: Real-Time Simulation on Grass Swaying with Controllable Wind Dynamics
## 1 Introduction  
Simulating natural phenomena presents a significant challenge but is essential in computer graphics, especially for creating realistic scenes in applications like video games and virtual environments. Grass, ubiquitous in natural landscapes, plays a pivotal role. The accurate simulation of grass swaying in the wind necessitates a detailed modeling of each blade and an in-depth understanding of the wind flow dynamics. Achieving such realism requires sophisticated physics algorithms capable of simulating intricate wind patterns and blade deformation along with substantial computing resources to simulate and render a large number of blades effectively.  
In this paper, we introduce the Controllable Wind Dynamics (CWD) techniques, which were designed to facilitate the real-time simulation of numerous grass blades interacting with external forces. This approach leverages the parallel computation capabilities of GPUs for the simulation, deformation, and rendering of grass blades. To minimize unnecessary transfer overhead between the CPU and GPU, all data updates are confined to the GPU memory buffer. The computation of blade deformation is contingent upon the direction and magnitude of the artificially generated wind. We achieve a precise representation of wind force and its interaction with the blades through fluid simulation governed by the Navier-Stokes equations, which are fundamental to fluid dynamics. The methodology for implementing fluid simulation using the Navier-Stokes equations is extensively documented. In our research, we have adopted the methods delineated in [1; 2; 3; 4; 5].  
The reason why the CWD-Sim algorithm uses minimal computational resources compared to previous methods is that it uses a combination of techniques specificallydesigned to optimize simulation steps. First, unlike the method proposed in [6], which uses Bezier curves to deform the grass blades, our method uses a simple quadratic equation to stretch the grass blade model vertically and bend it in all directions. This approach requires fewer operations than spline curves, although both produce similar results. Second, instead of simulating individual blades, we group them based on their world positions and place them in a grid structure. All blades in a group can have different deformation effects, even if they are exposed to the same wind force because they have slightly different initial physical properties. This grouping significantly reduces the computation time without causing any noticeable visual artifacts. Through experiments, we have found that the computation speed remains almost constant regardless of the number of blades and objects. Essentially, the value of a cell on the grid computed by the fluid simulation determines the curvature, orientation, and shadow of the blade through specific separate equations. In particular, we use the quadratic equation to deform the blade model into a curved shape, as if it were under the influence of gravity. The curved shape of the blade model can also be bent or stretched by external wind forces.  
An important problem to be addressed is how to efficiently specify the direction and force of the wind in the environment. Our method proposes the AGC (Arrow-Guided wind flow Control) interface, which allows users to intuitively control wind flow. The interface adds a set of 2D arrows that represent wind directions for a given time period directly into the environment. These arrows are connected to control the flow. Using this interface, users can manage complex flows, such as branching and merging of the wind.  
The remaining sections consist of the following. Section 2 provides an overview of related work and a comparison with the proposed algorithm. Section 3 describes the technical details of the CWD-Sim algorithms. Section 4 presents the experimental results and performance graphs. Finally, Section 5 concludes the paper with a discussion and outlines future work that could improve our CWD method.