# CWD-Sim: Real-Time Simulation on Grass Swaying with Controllable Wind Dynamics
## 4 Experiments  
To verify our algorithms, we built a system and performed a set of experiments. Hardware specifications include an E3-1230 v2 CPU and GTX 660 2 GB GPU. For 3D rendering, we used the OpenGL and GLSL version 4.5. The grass model that we used in the experiments was in Autodesk's FBX format. Please see the accompanying video clip that we submitted (Supplementary Materials) and the Youtube video ([[https://youtu.be/uV0](https://youtu.be/uV0) CFSqszjE]([https://youtu.be/uV0](https://youtu.be/uV0) CFSqszjE) (accessed on 5 January 2024)). For fluid simulation, we used a 2D texture grid size of 1000 \(\times\) 1000 to simulate fluid dynamics, applying Equations (4)-(10). In Equation (5), we set the vorticity confinement factor \(\lambda\) to 50. Regarding grass deformation, in Equation (11), we set the deformation parameters \(k_{1}\) to 0.05 and \(k_{2}\) to 0.1. These values were used to control the initial shape of the grass, which represented the weight of a grass blade due to gravity. Furthermore, in Equation (13), we set 0.2 for \(\lambda\) to control the flexibility of the grass blade under external force. In the first experiment, we checked the performance of our algorithm. As we increase the number of grass blades, we checked its fps. Note that all computations and rendering are performed on the GPU side. The result is shown in Figure 9. As we can see in the figure, our algorithm maintained the real-time performance even if we increased the number of grasses up to 1,200,000. For comparison with other algorithms, we picked [6], which we believe to be one of the complete solutions for grass rendering and animation. Figure 9 shows the performance comparison between our algorithm and [6]. Note that the narrow blue and orange bands represent the trends of the graph. For this test, we used the same GPU to obtain an unbiased result. From this test, we knew that our algorithm did not significantly reduce performance as we increase the number of grasses. On the contrary, the algorithm proposed in [6] had a substantial decrease in fps. It turned out that our simulation can achieve speeds 10\(\times\) to 50\(\times\) faster than [6] in a similar hardware environment. Figure 8: Starting with the state of (**a**) and adding as shown in (**b**) using the controllable arrow guide wind editing tool. In the second experiment, we tested how efficient our algorithms are in designing complicated wind dynamics. Figure 1 shows the case where winds coming from multiple sources must interact with static obstacles. Our method could generate a realistic bump and churn in a very realistic way between wind and obstacles. Figure 10 shows two winds colliding in the middle of the environment. You can see that the two winds are deflecting and changing direction smoothly as shown in Figure 11. Please refer to the accompanying video of the result for more details. Figure 7 compared two cases in which we applied the shadow generation technique proposed in Section 3.5 and not. We can easily tell that shadowing between grasses improves visual quality. Finally, Figure 8 shows the wind-editing process with the proposed AGC interface. Root points and end points are added directly to the environment to form the arrow guides, and those guides are connected to each other to create complicate tree-like wind forces, which improves controllability. The data in Table 2 present additional performance metrics obtained using an Intel Core i7-10700 KF CPU and an NVIDIA RTX 2080 8 GB GPU. The simulations were conducted with a varying number of grass blades, up to a maximum of 7,000,000, to evaluate real-time performance. The optimal frame rate achieved under these conditions was 29 fps. The grid size for wind simulation was 1000 \(\times\) 1000. The whole simulation time includes the processes time described in Equations (11)-(13). The time for the grass shadow indicates the performance of the shading algorithm, as illustrated in Figure 7b. The grass rendering time includes both the grass simulation and shadow rendering step.