{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"longbench-v2","formal_name":"LongBench v2","introduction":"長い資料の深い理解と推論を、多肢選択問題で評価するベンチマークです。公式紹介では503問を収録し、単一・複数文書の質問応答やコードリポジトリ理解などを扱います。\n\nLongBench v2 evaluates deep understanding and reasoning over long contexts through multiple-choice questions. Its official description lists 503 questions spanning tasks such as single-document and multi-document QA and code-repository understanding.","introduction_ja":"","introduction_en":"","category":"Category not supplied","task_count":null,"acquisition_status":"Acquisition status not supplied","official_url":"https://huggingface.co/datasets/zai-org/LongBench-v2","indexing_mode":"noindex"},"task_id":"117f2100-7cdf-5ac7-9e0c-effc090181a4","task_key":"train--66eefe85821e116aacb228dc","task_revision_id":"1","upstream_id":"66eefe85821e116aacb228dc","short_description":"These are two articles about grassland simulation. The first article is…","config":"","split":"train","body":"{\"choice_A\":\"In the first article, some unimportant leaves were removed to save performance, and the second article use LOD (detail level) algorithm for performance optimization.\",\"choice_B\":\"The second article emphasizes the undulation of the grass by using color changes in different bent states, while the first article does not use this method.\",\"choice_C\":\"The first article calculates leaf displacement using natural elements as coefficients, while the second article uses fluid simulation to calculate wind forces that bend the leaves.\",\"choice_D\":\"The first article can simulate wind in a certain direction or specific wind source, while the second article can simulate the effects of wind fields in multiple directions on grasslands and allow users to freely customize wind effects.\",\"context\":\"Responsive Real-Time Grass Rendering for General 3D Scenes\\nKlemens Jahrmann∗\\nMichael Wimmer†\\nTU Wien\\nTU Wien\\nFigure 1: This ﬁgure shows an example of our rendering technique. The collision reaction is visible at the trail of the bowling ball. The right\\nside is rendered in wireframe mode to show the accuracy of our occlusion culling method.\\nAbstract\\nGrass plays an important role in most natural environments. Most\\ninteractive applications use image-based techniques to approximate\\nﬁelds of grass due to the high geometrical complexity, leading to vi-\\nsual artifacts. In this paper, we propose a grass-rendering technique\\nthat is capable of drawing each blade of grass as geometrical ob-\\nject in real time. Accurate culling methods together with an adapt-\\nable rendering pipeline ensure that only the blades of grass that are\\nimportant for the visual appearance of the ﬁeld of grass are ren-\\ndered. In addition, we introduce a physical model that is evaluated\\nfor each blade of grass. This enables that a blade of grass can react\\nto its environment by calculating the inﬂuence of gravity, wind and\\ncollisions. A major advantage of our approach is that it can ren-\\nder ﬁelds of grass of arbitrary shape and spatial alignment. Thus,\\nin contrast to previous work, the blades of grass can be placed on\\nany 3D model, which is not required to be a ﬂat surface or a height\\nmap.\\nKeywords: real-time rendering, vegetation, hardware tessellation\\nConcepts: •Computing methodologies →Rendering; Physical\\nsimulation; Visibility;\\n1\\nIntroduction\\nRendering outdoor scenes is an important task for many interac-\\ntive applications. Almost all of these outdoor scenes contain grass\\n∗e-mail:klemens.jahrmann@net1220.at\\n†e-mail:wimmer@cg.tuwien.ac.at\\nPermission to make digital or hard copies of all or part of this work for per-\\nsonal or classroom use is granted without fee provided that copies are not\\nmade or distributed for proﬁt or commercial advantage and that copies bear\\nthis notice and the full citation on the ﬁrst page. Copyrights for components\\nof this work owned by others than the author(s) must be honored. Abstract-\\ning with credit is permitted. To copy otherwise, or republish, to post on\\nservers or to redistribute to lists, requires prior speciﬁc permission and/or a\\nfee. Request permissions from permissions@acm.org. c\\n⃝2017 Copyright\\nheld by the owner/author(s). Publication rights licensed to ACM.\\nI3D ’17, February 25 - 27, 2017, San Francisco, CA, USA\\nISBN: 978-1-4503-4886-7/17/03\\nDOI: http://dx.doi.org/10.1145/3023368.3023380\\nor grass-like vegetation.\\nDue to the high geometrical complex-\\nity, ﬁelds of grass are often rendered using billboards or other\\nimage-based techniques. However, image-based techniques have\\nthe drawback that the realism depends on the position and the\\nviewing direction of the camera. To remedy this, modern grass-\\nrendering techniques draw each blade of grass as geometrical ob-\\nject. While this enables the animation of each blade according to\\nits environment, it also requires acceleration structures to handle\\nthe high amount of geometrical objects. Therefore, most of these\\ntechniques use hardware instancing to draw patches of grass in a\\ngrid-based data structure. This limits the shape of a ﬁeld of grass to\\nheight ﬁelds, which is a problem since many terrains are not equiv-\\nalent to height maps.\\nIn this paper, we propose a rendering technique that is capable of\\nrendering ﬁelds of grass on arbitrary 3D models by drawing each\\nblade of grass as geometrical object indexed by a geometry-agnostic\\nacceleration structure. For the rendering of each blade, we use\\nhardware tessellation to apply dynamic level of detail, and the shape\\nof a blade is deﬁned by an analytic function. Each blade of grass\\nis inﬂuenced by environmental forces, like gravity, wind and col-\\nlisions with both simple and complex objects. In addition, several\\nculling methods ensure that only those blades are rendered that have\\nan impact on the visual appearance of the ﬁeld of grass. In addition\\nto standard occlusion culling, we also use the orientation and the\\ndistance to the camera as culling criteria. All of these computations\\nare carried out completely on the GPU through indirect rendering,\\navoiding costly round-trips between CPU and GPU.\\n2\\nPrevious Work\\nCurrent grass-rendering techniques can can be divided into image-\\nbased, geometric and hybrid approaches. Image-based rendering\\ntechniques are used most often in interactive applications because\\nthey are fast. Most of these techniques draw billboards with semi-\\ntransparent grass textures. The billboards can be camera-facing\\n[Whatley 2005] or arranged in star-shaped clusters [Pelzer 2004].\\nOrthmann et al. [2009] introduce a billboard technique that is able\\nto react to collisions with complex objects. Other image-based tech-\\nniques use transparent texture slices that are placed in a grid [Habel\\net al. 2007]. The major drawback of all image-based techniques\\nis that the visual quality is different when viewed from different\\n\\n\\nangles. In addition, wind animation and reaction to collisions can\\nheavily distort the used textures, which leads to rendering artifacts\\nand lack of realism.\\nSimilar to our rendering technique, there are several methods that\\ndraw single blades of grass as geometrical objects. Most of them\\ndraw patches that consist of many blades of grass multiple times\\nusing hardware instancing. However, this requires that the ﬁeld of\\ngrass is placed on a height map, which limits the ﬁeld of applica-\\ntion. The advantage of geometric methods is that each blade can\\nbe individually inﬂuenced by its environment. This inﬂuence can\\nbe processed in different ways. A skeleton [Wang et al. 2005] can\\nbe added to each blade of grass that can be animated to simulate\\nwind effects. Another approach simulates collisions using wave\\ncalculations [Chen and Johan 2010]. Jahrmann et al. [2013] trans-\\nlate the tip of a blade of grass according to a wind animation and\\nuse image-based methods to approximate collisions. More sophis-\\nticated collisions are introduced by Fan et al. [2015], who evaluate\\ncollisions between single blades of grass and spheres. However, the\\nwind is calculated separately using an analytic function. In contrast\\nto these methods, our rendering technique is not limited to height\\nmaps. Furthermore, a single consistent physical model is evaluated\\nfor each blade of grass to calculate natural forces like gravity or\\nwind, and collisions with both simple and complex objects, while\\nno previous method combines all these effects.\\nAn alternative to pure geometry-based or image-based rendering\\nis to draw a billboard only as a proxy geometry and evaluate the\\nexact curve geometry in the fragment shader [Loop and Blinn\\n2005], however, this was not implemented for grass yet. Finally,\\nBoulanger et al. [2009] propose a hybrid grass-rendering technique\\nthat uses both geometric and image-based approaches as different\\nstatic level-of-detail stages. Grass that is near the camera is drawn\\nas geometric objects, whereas grass that is further away is drawn by\\nrendering multiple horizontal and vertical texture slices. This ap-\\nproach is able to render realistic images in real time, and was used\\nin production video games such as Madden NFL 25 (EA Sports\\nR\\n⃝).\\nHowever, the blades of grass are static and cannot react to colli-\\nsions or natural forces. The idea of multiple level-of-detail stages\\ncan be added to our approach as future work to further increase the\\nrendering performance.\\n3\\nOverview\\nIn a preprocessing phase, the blades of grass are distributed on\\nthe surface of a 3D model, and subsequently divided into mul-\\ntiple patches, where each patch contains approximately the same\\nnumber of blades. Note that the patches can have arbitrary shapes\\nand alignments, since they are only container objects of individual\\nblades of grass. During the rendering of each image, three steps are\\nperformed:\\n1. The physical model is evaluated for each blade of grass.\\n2. The culling methods cull the blades that are not important for\\nthe ﬁnal rendering, based on occlusions and the orientation\\nand distance of the blade to the camera.\\n3. Each blade of grass is rendered as tessellated geometric object\\nusing an indirect rendering approach.\\nThe following sections describe each step in detail.\\n4\\nPreprocessing\\nDuring the preprocessing step, the blades of grass are generated on\\nthe surface of a 3D model and the patches are generated from these\\nFigure 2: Illustration of the deﬁnition of a blade of grass.\\nblades. We start by introducing our model for a single blade of\\ngrass.\\nGrass blade model\\nIn our system, a blade of grass consists of\\nthree vertices, v0...2, which are the control points of a quadratic\\nB´\\nezier curve. The ﬁrst control point v0 indicates the ﬁxed position\\nof the blade of grass, v2 is moved according to the physical model\\ndescribed in the next section, and v1 is positioned according to v2.\\nIn addition, a blade of grass has several further attributes: height,\\nwidth, stiffness coefﬁcient, up-vector and direction angle, which in-\\ndicates the alignment of the blade on the local plane deﬁned by the\\nup-vector. Altogether, a blade of grass can be completely described\\nby four 4D vectors. An illustration of a blade of grass is shown in\\nFigure 2.\\nGrass distribution\\nDuring the generation of the blades of grass,\\neither single blades or whole tufts of grass can be generated. The\\namount of blades that are generated is deﬁned by a user-deﬁned\\ndensity value and the total area of the 3D model. In case of gen-\\nerating tufts of grass, we use Poisson-disk sampling on the surface\\n[Cline et al. 2009] to ensure that the tufts are not clumped together.\\nThe blades of a tuft are placed randomly in the vicinity of the tuft\\ncenter, and orientation and attributes are also assigned randomly\\nwithin certain ranges. In case of generating single blades of grass,\\nthe blades are distributed randomly on the surface of the 3D model,\\nwithout Poisson-disk sampling, since random clumping of blades\\nis beneﬁcial for a natural grass distribution. Single-blade seeding\\nis good for covering ﬁelds of grass with equal density, whereas tuft\\nseeding generates a more natural grass distribution. Therefore, a re-\\nalistic meadow can be generated using a combination of both seed-\\ning methods. Each blade of grass is generated in an initial pose\\nwhere the control points v1 and v2 share the same position, which\\nis above the ground position v0 according to the height and the up-\\nvector.\\nPatch generation\\nAfter the blades of grass have been generated,\\npatches are formed. The number of patches generated from the\\nblades is crucial for the performance of our rendering algorithm,\\nand the optimal number depends on the graphics hardware. The\\nevaluation of the physical model and culling will be performed\\nusing compute shaders. To maximize parallelism, the number of\\nblades in a patch should therefore be (1) the same in all patches and\\n(2) allow maximum occupancy in compute shader dispatches. In\\npractice, we use a multiple of the maximum number of workgroup\\ninvocations reported by the hardware. Furthermore, the shape of a\\npatch should be as compact and rectangular as possible to achieve\\na tight bounding box, which improves the effectiveness of culling.\\n\\n\\nSplitting the blades into compact and equally sized patches can be\\nseen as balanced clustering problem [Malinen and Fr¨\\nanti 2014],\\nwhich has the constraint of equal-element clusters. The balanced\\nclustering problem can be efﬁciently solved using linear program-\\nming or graph-theoretical approaches. In our case, the elements are\\nthe blades of grass, the resulting clusters are the patches and the\\nmetric used for clustering is proximity. For measuring the proxim-\\nity, we use the Euclidean and the Manhattan distance metrics. After\\nthe division into patches, the blades of each patch are sorted to en-\\nsure that nearby blades have similar indices, which is necessary for\\nour algorithm. Currently, a simple lexicographical sort according\\nto the coordinates has proven efﬁcient, although more sophisticated\\nsorting algorithms (like Morton order) could be investigated.\\n5\\nPhysical Model\\nOur physical model simulates natural forces and collisions with\\nother objects, represented as collections of spheres, and is evalu-\\nated for each blade of grass separately for highest realism. Figure\\n3 shows an illustration of the different inﬂuences. The calculations\\nare performed completely on the graphics card using a compute\\nshader. In order to allow free movement for a blade of grass, the\\nforces ﬁrst manipulate only the tip of the blade (v2), followed by\\nthree correction steps to achieve a valid state for the blade. This\\nvalidation procedure is explained in Section 5.2.\\nThe translation ⃗\\nδ of v2 is calculated by using three natural forces\\n(recovery r, gravity g and wind w) and a displacement d caused by\\ncollisions. The forces are applied to the translation by a heuristic.\\nThis heuristic uses the natural forces directly as displacement that\\nis normalized by a time interval ∆t, which corresponds to the time\\nrequired for the last frame. The collision reaction is already calcu-\\nlated as displacement and must not be normalized. This leads to a\\nreaction of the blade to the environment that is independent of the\\nframe rate.\\n⃗\\nδ = (r + g + w) ∆t + d\\n(1)\\nThe ﬁnal translation is saved in a texture, called force map, where\\neach blade of grass has a distinct texel. In addition, the fourth di-\\nmension of a texel in the force map saves the strength of the col-\\nlisions that inﬂuence this blade of grass. This collision strength is\\nused in later frames to have a persistent crippling effect of collisions\\non each blade of grass. Over the time, this value decreases, which\\nmakes the blade stand up after some time if no further collisions are\\ndetected. In order to simulate the fading over time of the collision\\nstrength η, we multiply a constant user-deﬁned amount of decrease\\na with ∆t:\\nη = max (c −a∆t, 0)\\n(2)\\n5.1\\nNatural Forces\\nIn our physical model, we consider three different natural forces:\\nrecovery, gravity and wind. Most related algorithms, like Fan et al.\\n[2015], focus more on collisions than on the natural forces and only\\nsimulate wind by procedurally modifying the geometry during the\\nrendering.\\nRecovery\\nThe recovery force is the counterforce to previously\\napplied forces, which follows Hooke’s law. It is directed towards\\nthe initial pose of the blade of grass Iv2 and its strength depends\\non the stiffness coefﬁcient s of the blade. In order to simulate the\\ncrippling effect of a blade, the collision strength η is added to the\\nequation to suppress the effect of the recovery force r.\\nr = (Iv2 −v2) s max (1 −η, 0.1)\\n(3)\\nFigure 3: Illustration of the different inﬂuences that are considered\\nin the physical model.\\nGravity\\nThe inﬂuence of gravity on a blade of grass consists of\\ntwo additive forces. One force represents the gravity of the whole\\nscene. We call this inﬂuence the environmental gravity, gE. In\\norder to be adaptable to various scenes, the environmental gravity\\ncan be represented in two different ways: It can be a global gravity\\ndirection that is the same for the whole scene, or it can be a gravity\\ncenter to which all gravity forces point. In practice, we allow both\\nrepresentations to be used simultaneously and interpolate them with\\na user-deﬁned parameter t:\\ngE = m\\n\\u0012 Dxyz\\n∥Dxyz∥Dw (1 −t) + Cxyz −v0\\nCxyz −v0 Cw t\\n\\u0013\\n(4)\\nIn this equation, m is the mass of a blade and D is the four-\\ndimensional gravity direction, where the fourth component indi-\\ncates the gravitational acceleration. In the same way, C is the cen-\\nter of a gravity force. The vector of the other inﬂuencing force is\\northogonal to the width of the blade of grass. Based on the direc-\\ntion of this inﬂuence, we call it front gravity, gF . This simulates the\\nelasticity of a blade of grass, which causes the tip of the grass being\\nbent by the inﬂuence of the gravity. The strength of gF depends on\\nthe strength of gE, which is expressed in the following equation:\\ngF = 1\\n4 ∥gE∥f,\\n(5)\\nwhere f indicates the front direction that is perpendicular to the\\nwidth of the blade. The total gravity force g is computed by the\\nsum of both gravity forces:\\ng = (gE + gF )\\n(6)\\nWind\\nThe third natural force is the wind inﬂuence, which is com-\\nputed by using analytic functions that represent wind waves moving\\nthrough 3D space. The inﬂuence of this wind wave on a single blade\\nof grass depends on three criteria: the direction and strength of the\\nwind wave at the position of the blade of grass, and the alignment of\\nthe blade towards the wind wave. Thus, the analytic wind function\\nis responsible for computing a vector wi (v0) that represents the\\ndirection and the strength of the wind inﬂuence at the position of a\\nblade of grass. The analytic functions can be modeled heuristically\\nusing multiple sine and cosine functions with different frequencies.\\nThis can simulate wind coming from some direction or a speciﬁc\\nsource, like a helicopter or a fan. Figure 4 shows some examples of\\n\\n\\nFigure 4: This ﬁgure shows the results of two different wind func-\\ntions in 2D space.\\nThe height of the red surface indicates the\\nstrength of the wind at the respective position and the black ar-\\nrows illustrate the direction of the inﬂuence as well as the move-\\nment of the wind wave. The upper function simulates a common\\nwind comming from a direction, whereas the lower function shows\\nthe inﬂuence of a speciﬁc wind source.\\n2D representations of wind functions. The alignment of the blade\\ntowards the wind wave is developed following two ideas: First, a\\nblade of grass that is standing in its straight position should be inﬂu-\\nenced more by the wind than a blade that is pushed to the ground. In\\naddition, if the direction of the force caused by the wind is directed\\nalong the width of the blade, the inﬂuence should be less than if the\\ndirection of the wind is orthogonal to the blade. Thus, the align-\\nment value θ (wi (v0) , h) consists of two factors: the directional\\nalignment fd (wi (v0)) towards the wind inﬂuence wi (v0) and the\\nheight ratio fr (h) that indicates the straightness of the blade with\\nrespect to the up-vector up.\\nfd (wi (v0)) = 1 −\\n\\f\\n\\f\\n\\f\\n\\f\\nwi (v0)\\n∥wi (v0)∥·\\nv2 −v0\\n∥v2 −v0∥\\n\\f\\n\\f\\n\\f\\n\\f\\nfr (h) = (v2 −v0) · up\\nh\\nθ (wi (v0) , h) = fd (wi (v0)) fr (h)\\n(7)\\nFinally, the resulting wind force on a blade of grass is deﬁned by\\nthe following equation:\\nw = wi (v0) θ (wi (v0) , h)\\n(8)\\n5.2\\nState Validation\\nA valid state of a blade of grass is deﬁned by three conditions: v2\\nmust not be pushed beneath the ground, the position of v1 has to\\nbe set according to the position of v2, and the length of the curve\\nmust be equal to the height of the blade of grass. These conditions\\nhave to be fulﬁlled for a blade of grass before it is used for collision\\ndetection or rendering.\\nSince it would require too much time to check whether v2 is pushed\\ninside the underlying 3D model, we assume that the surface is a\\nplane deﬁned by the up-vector of the blade locally. By this assump-\\ntion, a position of v2 above the local plane can be ensured by a\\nsingle equation:\\nv2 = v2 −up min (up · (v2 −v0) , 0) ,\\n(9)\\nwhere up represents the up-vector of the blade.\\nAfter a valid position for v2 is found, the position of v1 can be\\ncalculated. This position is constrained to be always above v0 ac-\\ncording to the up-vector of the blade. For the position calculation,\\nFigure 5: Illustration of the relation between v1 and v2. The dif-\\nferent colors symbolize different states of the blade of grass.\\nthe length of the vector from v0 to v2 projected onto the ground\\nplane lproj is computed:\\nlproj = ∥v2 −v0 −up ((v2 −v0) · up)∥,\\n(10)\\nwhere up is the up-vector of the blade. If this length is zero, v2\\nrests in the idle position and v1 has the same position. Otherwise,\\nthe more v2 is pushed away from the idle position the lower is the\\nposition of v1. However, in order to ensure that the blade of grass\\nalways has at least a slight curvature, the position of v1 is never the\\nsame as the position of v0. This is illustrated in Figure 5 and can\\nbe calculated using the following equation:\\nv1 = v0+h up max\\n\\u0012\\n1 −lproj\\nh , 0.05 max\\n\\u0012lproj\\nh , 1\\n\\u0013\\u0013\\n, (11)\\nwhere h is the height of the blade, up its up-vector and 0.05 is the\\nconstant factor to ensure that the position of v1 is not equal to the\\nposition of v0.\\nThe last validation step has to ensure that the length of the B´\\nezier\\ncurve is not larger than the height of the blade. Without this step, the\\nlength of a blade of grass would not be consistent if it is inﬂuenced\\nby forces, which is a major drawback of the algorithm of Jahrmann\\net al. [2013]. However, calculating and correcting the length of\\na curve precisely for each blade of grass requires too much time.\\nTherefore, we use an approximation for the length L of a Bezier\\ncurve of degree n [Gravesen 1993]:\\nL = 2L0 + (n −1) L1\\nn + 1\\n,\\n(12)\\nwhere L0 indicates the distance between the ﬁrst and the last control\\npoint and L1 is the sum of all distances between a control point and\\nits subsequent one. After the length of the curve is measured, the\\nratio r between the height of the blade and the measured length\\nis calculated. Finally, the correction of the length is performed by\\nmultiplying each segment between the control points with r, which\\nis shown in Equation 13, where v1corr respectively v2corr are the\\ncorrected positions of the control points.\\nr = h\\nL\\nv1corr = v0 + r (v1 −v0)\\nv2corr = v1corr + r (v2 −v1)\\n(13)\\n5.3\\nCollision\\nIn order to simulate natural behavior of a blade of grass, it has to be\\nable to react to its environment. Therefore, we detect and react to\\n\\n\\nFigure 6: Illustration of two possible collisions between a blade of\\ngrass and a sphere.\\ncollisions for each blade of grass separately. We use spheres as ob-\\nject representation, which allows fast calculation with a low mem-\\nory footprint since a sphere can be completely deﬁned by a 4D vec-\\ntor. Thus, complex objects have to be approximated using spheres.\\nIn our application, we use a sphere-packing approach [Weller and\\nZachmann 2010] to generate the sphere representation, but repre-\\nsentations with overlapping spheres [Stolpner et al. 2012] should\\nbe applicable as well. Since it would require too much time to mea-\\nsure the exact intersection between a curve and a sphere, we use\\ntwo points for the calculations, which are v2 and the center point\\nm of the curve, which can be computed using curve interpolation:\\nm = 1\\n4v0 + 1\\n2v1 + 1\\n4v2\\n(14)\\nHowever, our physical model can only modify v2. Thus, a collision\\nreaction of m has to be translated to a reaction of v2, which can be\\neasily achieved by multiplying the translation vector by 4.\\nIn order to detect a collision, we test whether one of the two points\\nis inside the sphere. If a collision is detected, the reaction is the\\ntranslation of the point to the nearest point on the surface of the\\nsphere. Both steps can be formulated by a single equation:\\nd = min (∥c −p∥−r, 0)\\nc −p\\n∥c −p∥,\\n(15)\\nwhere d is the resulting translation, p is the point that is tested and\\nc and r represent the center position and the radius of the sphere.\\nFigure 6 shows an illustration of the collision calculation. Each\\ntime a collision is detected, the squared length of the translation is\\nadded to the collision strength η, which is stored in the force map\\nfor the following frame:\\nη = η + d · d\\n(16)\\n6\\nRendering\\nFor rendering a ﬁeld of grass, we draw each blade as a tessellated\\n2D object. Similar to the method of Jahrmann et al. [2013], we\\nuse the tessellation pipeline to provide dynamic level of detail to\\nthe shape of a blade. However, instead of using an alpha texture to\\ncreate the shape of the blade, we use analytic functions that directly\\nmodify the geometry, which is explained in Section 6.3. Since each\\nblade of grass has its individual state and position, we cannot render\\nmultiple instances of a single patch. In order to achieve real-time\\nperformance, we use culling on the basis of single blades to render\\nonly the blades that have an impact on the appearance of the ﬁeld of\\ngrass. The culling of single blades requires a rendering pipeline that\\nallows a varying amount of geometry to be rendered each frame.\\nTherefore, we use an indirect rendering approach, which is de-\\nscribed in the following section.\\n6.1\\nIndirect Rendering\\nIn contrast to common direct rendering, an indirect rendering call\\ndoes not include the parameters of the draw command. Instead,\\nthe parameters are read from a buffer in GPU memory. This en-\\nables the parameter buffer to be modiﬁed inside a compute shader\\nwithout synchronizing with the CPU. In our technique, we use a\\ncompute shader to cull unwanted blades of grass. The deﬁnition of\\nan unwanted blade of grass is given in the following section. Each\\nblade that is not culled increases the object count of the parameter\\nbuffer and writes its index to an index buffer.\\n6.2\\nCulling\\nCulling is performed in two steps. First, the bounding box of the\\npatches are tested against the camera’s view frustum. Note that in\\npreprocessing, bounding-box calculation takes the potential blade\\nmovement into account to avoid false positives. Then, each blade\\nof grass of visible patches is tested based on occlusions by other\\nobjects and its orientation and distance to the camera. This leads to\\nfour tests that each blade has to pass to be rendered. These tests are\\nexplained in the following.\\nOrientation test\\nThis test culls a blade based on its orientation\\ntowards the camera. This is important due to the pseudo three-\\ndimensionality of a blade of grass, as it has no thickness. Thus,\\nblades that are approximately parallel to the viewing direction can\\ncause unwanted aliasing artifacts since their projected pixel width\\nis less than the size of a pixel. Therefore, we calculate the absolute\\nvalue of the cosine of the angle between the viewing direction dirc\\nand the vector along the width of the blade dirb and cull the blade\\nif this value exceeds 0.9.\\n0.9 > |dirc · dirb| →blade culled\\n(17)\\nView-frustum test\\nThe second test checks whether a blade is in-\\nside the camera’s view frustum. Since it is impossible to test each\\npoint on the blade against the view frustum, we only consider three\\npoints (v0, midpoint of the curve m and v2) and add some toler-\\nance to the calculation. The calculation of m is shown in Equation\\n14. In order to test a point against the view frustum, we project the\\npoint to normalized device coordinates using the view-projection\\nmatrix VP and homogenous coordinates. After the projection, the\\ntest can be performed by comparing the x-, y- and z-coordinates\\nwith the homogenous coordinate. This is shown in the following\\nequation for some point p, where p′ indicates the normalized de-\\nvice coordinates of the point, t is a small tolerance value and h is the\\nhomogenous coordinate with added tolerance. The boolean result v\\nindicates if a point is inside the view frustum. If the test results in\\nfalse for all three points, the blade is culled.\\np′ = VP p\\nh = p′\\nw + t\\nv = p′\\nx ∈[−h, h] ∧p′\\ny ∈[−h, h] ∧p′\\nz ∈[−h, h]\\n(18)\\nAs an optimization, this test could be omitted for patches that are\\nfully inside the view frustum.\\nDistance test\\nThe third test culls blades of grass according to\\ntheir distance towards the camera. This is important since a ﬁeld of\\ngrass appears to be more dense near the horizon due to perspective.\\nThis high density can cause two problems during the rendering.\\nFirst, due to the lower precision of depth values in the distance, z-\\nﬁghting can occur. Second, blades at high distances are smaller than\\n\\n\\nFigure 7: Illustration of the effect of the occlusion test in wireframe\\nmode. The left image is rendered with occlusion test, the right one\\nwithout.\\na pixel, which can cause aliasing artifacts. Note that the density\\nincrease due to perspective is stronger near the horizon than when\\nthe ﬁeld of grass is viewed from above. Therefore, the distance\\nfrom the camera to the blade of grass is projected onto the local\\nplane deﬁned by the up-vector before it is used for distance culling:\\ndproj = ∥v0 −c −up ((v0 −c) · up)∥,\\n(19)\\nwhere dproj is the projected distance, c is the position of the cam-\\nera and up the blade’s up-vector. According to this distance, the\\nblade is classiﬁed into one of n distance levels, which are evenly\\ndistributed over the interval [0, dmax], where dmax is a user-deﬁned\\nmaximum distance. The lowest level culls no blades. The second-\\nlowest level culls one out of n blades, etc., until the nth level culls\\nall blades. In order to determine which blades of the same distance\\nlevel are culled, the index id of each blade is used, which is shown\\nin the following inequality:\\nid mod n <\\n\\u0016\\nn\\n\\u0012\\n1 −dproj\\ndmax\\n\\u0013\\u0017\\n→blade culled\\n(20)\\nThe distance test assumes that nearby blades have similar indices.\\nThus, the blades must not be indexed in an arbitrary way, otherwise\\nthe distance test can introduce bare spaces. This is ensured by the\\npatch generation algorithm, which is described in Section 4.\\nOcclusion test\\nThe last test checks whether a blade of grass is\\noccluded by another object. Similar to the view-frustum test, this\\ntest is applied to three points of the curve, which are projected to\\nscreen coordinates. These coordinates are used to sample a previ-\\nously generated texture that represents the linear depth values of\\nopaque scene objects. The sampled depth values are compared to\\nthe blade’s distance to the camera. If the depth value is smaller,\\nthe blade of grass is culled. Similar to the problems of shadow\\nmapping [Everitt et al. 2001], unwanted artifacts can appear from\\naliasing if the sampled depth values refer to surfaces which are not\\nperpendicular to the viewing direction. Therefore, a small bias has\\nto be added to the depth values. Figure 7 shows the result of the\\nocclusion test.\\n6.3\\nBlade Geometry\\nDuring rendering, each blade is drawn as 2D object positioned in\\n3D space. The generation of the shape of a blade is performed\\nin the tessellation evaluation shader, which is uses the information\\nof the hardware-tessellation unit to position the generated vertices.\\nInitially, the blade geometry is a ﬂat quad that is deﬁned by the\\ninterpolation parameters u and v, where u indicates the interpola-\\ntion along the width of the blade and v the interpolation along the\\nheight. By evaluating the curve interpolation of the control points\\nfor each generated vertex, the quad becomes aligned to the B´\\nezier\\nFigure 8: Illustration of the four basic shapes: quad, triangle,\\nquadratic and triangle-tip. The red and green dotted lines repre-\\nsent the positions of c0 and c1.\\ncurve. This is achieved by using De Casteljau’s algorithm [Farin\\nand Hansford 2000], which also calculates the tangent vector t0 as\\nintermediate results. The bitangent t1 is given directly by the di-\\nrection vector along the width of the blade, which is calculated in\\nadvance. With the two tangent vectors, the normal n can be com-\\nputed by using the cross product. These calculations are shown in\\nthe following equation, where c is the curve point using interpola-\\ntion parameter v and c1 and c2 are the two resulting curve points\\nthat span the width w of the blade. In addition, a respectively b are\\nauxiliary vectors.\\na = v0 + v (v1 −v0)\\nb = v1 + v (v2 −v1)\\nc = a + v (b −a)\\nc0 = c −wt1\\nc1 = c + wt1\\nt0 =\\nb −a\\n∥b −a∥\\nn =\\nt0 × t1\\n∥t0 × t1∥\\n(21)\\nIn order to apply more sophisticated shapes to the blade of grass, we\\nuse analytic functions to calculate the ﬁnal position of the generated\\nvertices. The input of these functions are the interpolation parame-\\nters u and v generated by the tessellation, the resulting curve points\\nc0 and c1, and the normal vector n. The parameter u can only have\\nthe distinct values 0, 0.5 and 1, where a value of 0.5 indicates the\\nmiddle axis of the blade. The speciﬁc values of v that are inside the\\ninterval [0, 1] depend on the grade of the tessellation. In the follow-\\ning, we present four basic shapes, which are illustrated in Figure 8.\\nIn addition, we also show the possibility to create complex shapes\\nwith analytic functions by introducing a function that represents a\\ndandelion leaf. Furthermore, two additional features can be added\\nto the shape of a blade, which are a 3D displacement and a width\\ncorrection that reduces aliasing for tipped shapes by forcing a quad\\nshape if the width becomes too small due to perspective.\\nBasic shapes\\nThe position p of a vertex for a basic shapes is\\ncomputed by interpolating between the two curve points c0 and c1\\nusing an interpolation parameter t that depends on u and v:\\np = (1 −t) c0 + tc1,\\n(22)\\nThe quad shape simply uses the parameter u as interpolation pa-\\nrameter, t = u, so that either c0, c or c1 is emitted. The trian-\\ngle’s interpolation parameter is calculated by applying the equa-\\ntion: t = u + 0.5v −uv. The quadratic shape is formed like\\na quad on one side and like a parabola on the other side. This\\nis achieved by using the parameter t = u −uv2. Finally, the\\ntriangle-tip shape is a combination of a quad near the ground and\\n\\n\\nFigure 9: Illustration of the dandelion shape. The left image repre-\\nsents the graph of the analytic dandelion function, where the x-axis\\nrepresent v and the y-axis represent u. The different colors cor-\\nrespond to different tessellation levels. The right image shows a\\nrendering of a dandelion tuft.\\na triangle further up. The border between these two shapes is de-\\nﬁned by a threshold τ, which is in the interval [0, 1). The inter-\\npolation parameter for this shape is calculated using the equation\\nt = 0.5 + (u −0.5)\\n\\u0010\\n1 −max(v−τ,0)\\n1−τ\\n\\u0011\\n.\\nDandelion\\nIn the same way as the basic shapes, the dandelion\\nfunction interpolates between c0 and c1. The interpolation param-\\neter is calculated by a complex equation that uses trigonometric\\nfunctions that we developed heuristically. Figure 9 shows an illus-\\ntration of the graph of this function together with a rendered image\\nof a dandelion leaf. In order to not lose any spikes due to aliasing\\nwhen the tessellation level is low, the tessellation level is included\\nin the equation.\\n3D displacement\\nThe 3D displacement is an additional feature\\nthat can be added to the shape of a blade, where the middle axis of\\nthe blade is translated along the normal vector, resulting in a “v”-\\nshape in its cross-section. If the shape has a tip, it is important\\nthat the translation has to decrease the nearer the generated point\\nis to the top. Otherwise, the blade has a depth but no width at the\\ntip. Equation 23 shows the calculation of the displacement vector\\nd, where n is the normal vector and w the width of the blade. By\\nadding this displacement, the shape has approximately a right angle\\nand the unfolded width of the blade increases by the factor\\n√\\n2.\\nd = w n (0.5 −|u −0.5| (1 −v))\\n(23)\\nWidth correction\\nWhen rendering blades at greater distance, es-\\npecially tipped shapes can be thinner than the size of a pixel, which\\ncan lead to aliasing artifacts. This effect can be reduced by mod-\\nifying the interpolation parameter of the respective shape with a\\ncorrection value based on the width in pixels, so that blades of\\ngrass at far distances are rendered as quads regardless of the cho-\\nsen shape. The pixel width of the blade is calculated in four steps.\\nFirst, the curve points are transformed to screen coordinates in the\\nrange [0, 1]. Second, the difference between these screen coordi-\\nnates is calculated. Third, this difference vector is multiplied with\\nthe screen resolution. Finally, the length of the difference vector\\nwp represents the width of the blade in pixels. The correction value\\nΦ can be calculated with respect to two constant values, wmin and\\nwspan. The value of wmin indicates the minimum width for a blade.\\nIf the width of a blade is smaller than or equal to wmin, Φ is equal to\\none, which enforces the blade to be shaped as a quad. If Φ is equal\\nto zero, the interpolation of the shape is not inﬂuenced at all. The\\nsecond value wspan indicates the length of the interval, in which\\nthe shape is corrected. Thus, if wmin is set to 1 and wspan is set to\\n2, the shape of all blades having a pixel size in the range [0, 3] are\\ncorrected. The following equation shows the calculation of Φ and\\nhow it is applied to the shape’s interpolation parameter t:\\nΦ = 1 −min\\n\\u0012\\nmax\\n\\u0012wp −wmin\\nwspan\\n, 0\\n\\u0013\\n, 1\\n\\u0013\\nt = t (1 −Φ) + u Φ2\\n(24)\\n7\\nResults\\nIn this section, we present the results of our rendering technique\\nand compare them to related algorithms. The evaluation of our\\nresults is based on visual appearance, elapsed time on the graph-\\nics card and the total time required for a frame.\\nThe results\\nare rendered in a testing framework that focuses on the geome-\\ntry and the animation of the ﬁeld of grass, but lacks additional\\nphoto-realistic rendering techniques that are common in modern\\nengines like shadows, ambient occlusion or atmospheric effects.\\nNote, however, that this is not a limitation of the method: since\\nthe grass blades are drawn as geometrical objects, it is straightfor-\\nward to integrate our method into an engine that supports such tech-\\nniques. The framework is implemented in C++ and OpenGL, ver-\\nsion 4.5. The results are generated on a machine using an NVIDIA\\nGeForce GTX 780M graphics card and an Intel Core i7-4800 @\\n2.7 GHz CPU with 32 GB Ram. The resolution that is used for\\nthe renderings is 1024x768 pixels. In order to reduce aliasing arti-\\nfacts, MSAA with 8 samples is used. A representative open-source\\ndemo application of our grass-rendering technique is availlable at\\nhttps://github.com/klejah/ResponsiveGrassDemo.\\nIn the following, we present two scenes that are evaluated and dis-\\ncussed. The evaluation is based on different measurements, which\\nare: the rendered frames per second, the time for rendering the\\nframe, the number of blades that are drawn, the number of blades\\nthat are culled, the time used for the evaluation of the physical\\nmodel, the time used for the visibility calculation and indirect ren-\\ndering setup, the time used for rendering and the number of colli-\\nsion spheres that are considered in the force update. The time values\\nare measured in milliseconds. The measurements are gathered un-\\nder three different circumstances: all features are enabled, collision\\ndetection disabled, culling disabled. In order to guarantee a reason-\\nable comparison, all measurements of a scene are taken from frames\\nhaving the exact same input data from a ﬁxed reference viewpoint\\nas shown in the respective renderings (Figures 10,11). Animated\\nrenderings of these scenes can be found in the accompanying video.\\n7.1\\nNature scene\\nThe nature scene consists of several 3D objects and resembles an\\noutdoor scenario. A rendering of this scene is presented in Figure\\n10. The ﬁeld of grass is generated on a terrain with smooth hills.\\nIt consists of 397,881 blades of grass. Each blade of grass has a\\nmoderate width, which leads to a high density. The scene contains\\na bunny model, which is represented by 1000 collision spheres in\\ntotal. The effect of the physical model is shown by two rolling\\nballs, which leave a trail behind. Additionally, several objects are\\nadded for a better visual representation. Table 1 presents the mea-\\nsurements of the nature scene.\\nThe evaluation proves the advantage of the culling methods based\\non each blade of grass. Almost three-fourths of all blades of grass\\nof visible patches are culled by our algorithm. Nevertheless, the\\nappearance of the meadow is still dense without any bare spaces.\\nTable 2 shows the number of blades that are culled by the different\\ntests. Note that the sum of culled blades is larger than the number\\nof blades, since some blades fail multiple tests. The visibility test\\nthat culls the most blades is based on the view frustum. If all culling\\n\\n\\nFigure 10: The left image shows the rendering of the nature scene\\nas it is evaluated. The right image visualizes the sphere representa-\\ntion of the bunny model.\\nMeasurement\\nAll\\nCollision\\nCulling\\nfeatures\\ndisabled\\ndisabled\\nFPS\\n123\\n129\\n78\\nFrame time\\n8.130\\n7.742\\n12.821\\nBlades drawn\\n43,128\\n43,128\\n168,333\\nBlades culled\\n125,205\\n125,205\\n0\\nTime physical model\\n0.547\\n0.041\\n0.519\\nTime visibility\\n1.401\\n1.392\\n2.375\\nTime rendering\\n2.057\\n2.082\\n3.872\\nAmount collision spheres\\n183\\n0\\n183\\nTable 1: Evaluation of the nature scene. The most interesting mea-\\nsurements are highlighted.\\nmethods are disabled, an interesting phenomenon occurs. The re-\\nquired time for the visibility test increases, although no visibility\\ntests are performed. This shows that more time is required to set\\nup of the indirect buffer if more blades are visible. Thus, the less\\nblades are culled the more time is required for both the update and\\nthe rendering pass.\\nVisibility test\\nBlades culled\\nOrientation test\\n44,695\\nView-frustum test\\n79,533\\nDistance test\\n46,965\\nOcclusion test\\n6,025\\nTable 2: The amount of blades culled by each visibility test in the\\nnature scene.\\nAnother important fact is shown in the time used for the evalua-\\ntion of the physical model. Even though many collision spheres\\nhave to be checked for collision, the calculation is performed in\\nless time than one millisecond. However, if the collision detection\\nis disabled, the force update requires almost no time, which shows\\nthe high performance of the calculations, especially considering the\\nfact that the physical model is evaluated not only for visible blades\\nof grass.\\n7.2\\nHelicopter scene\\nThe helicopter scene shows the impact of the wind effect together\\nwith the rendering of a ﬁeld of grass of extreme density. Since the\\nonly other 3D model is a helicopter that ﬂies above the ground, no\\nblades can be culled due to occlusion, which resembles a worst-case\\nscenario for our algorithm. The ﬁeld of grass consists of 900,000\\nblades. The wind effect of the helicopter is simulated by a point-\\nbased wind with the helicopter being the wind source. Figure 11\\nshows a rendering of this scene and Table 3 presents the measure-\\nments.\\nFigure 11: This ﬁgure shows a rendering of the helicopter scene.\\nMeasurement\\nAll\\nCollision\\nCulling\\nfeatures\\ndisabled\\ndisabled\\nFPS\\n56\\n56\\n35\\nFrame time\\n17.860\\n17.692\\n28.624\\nBlades drawn\\n165,135\\n165,135\\n503,382\\nBlades culled\\n338,247\\n338,247\\n0\\nTime physical model\\n1.421\\n1.372\\n1.570\\nTime visibility\\n6.817\\n6.792\\n8.142\\nTime rendering\\n5.471\\n5.398\\n9.149\\nAmount collision spheres\\n0\\n0\\n0\\nTable 3: This table shows the evaluation of the helicopter scene.\\nThe most interesting measurements are highlighted.\\nSince the helicopter scene does not contain any collision spheres,\\nthere is obviously no signiﬁcant difference if the collision detection\\nis disabled. Similar to the previous measurement, a huge amount of\\nblades can be culled without a noticeable difference in the density\\nof the ﬁeld of grass. The high amount of blades makes the im-\\nprovement of the performance even more signiﬁcant if the culling\\nmethods are enabled. Note that distance and orientation culling can\\nintroduce some popping artifacts for moving cameras, depending\\non the number of levels used, as can also be seen in the accompa-\\nnying video.\\n7.3\\nComparison to related work\\nIn contrast to many related grass rendering techniques, especially\\ngeometrical approaches, our technique is capable of processing\\nﬁelds of grass of arbitrary shape and spatial alignment. This en-\\nables a variety of different scenes that can not be modeled as a\\nheightmap. In addition, grass that is able to grow on top of a 3D\\nmodel can also simulate fur or hair. Figures 12 and 13 show grass\\ngrowing on three models of different topologies, which cannot be\\nrepresented as heightmaps.\\nA major contribution of our technique is the physical interaction.\\nThe work of Orthmann et al. [2009] as well as the work of Fan et\\nal. [2015] focus on the interaction between grass and environmen-\\ntal colliders. Orthmann et al. use billboards for the grass represen-\\ntation that are able to react to the collision with complex objects.\\nWhen a collision is detected, the vertices of the billboard are dis-\\nplaced and after a ﬁxed time the billboard regains its original state.\\nThe algorithm of Fan et al. follows a similar procedure. However,\\nthe blades of grass are represented as 3D objects and the collision\\ndetection is limited to spheres. As reaction to the collision, the\\nvertices of the corresponding blades are displaced and after a ﬁxed\\ntime period the blade resets to its initial state.\\n\\n\\nFigure 12: This ﬁgure shows grass growing on two complex 3D\\nmodels with different color textures.\\nFigure 13: This ﬁgure shows grass growing on a model of a M¨\\nobius\\nstrip.\\nIn contrast to these approaches, our technique is able to operate on\\neach single blade and can react to collisions with both spheres and\\ncomplex objects. In addition, each blade saves its individual an-\\nimation state, which allows that the time until a blade regains its\\ninitial state can depend on the collision that occurred and no ﬁxed\\ntime period has to be set. In comparison to the technique of Orth-\\nmann et al., we modeled a scene where a hand moves over a ﬁeld\\nof grass. As it is shown in Figure 14, the trails of the ﬁngers are\\nclearly visible where the blades were pushed down. The rendering\\nof Orthmann et al. shows the drawbacks of using billboards, be-\\ncause the trails are also visible, but the textures of the billboards\\nare heavily distorted due to the displacement. In comparison to Fan\\net al., we generated a scene with many balls being thrown over the\\nﬁeld of grass, which is shown in Figure 15. Since the meadow is\\nmuch denser in our rendering, the collision reaction is more visible.\\nTable 4 summarizes the differences of our method to Fan et al.’s\\nmethod.\\nThe work of Wang et al. [2005] represents realistic natural forces\\nthat are applied to each blade of grass. The technique is capable of\\nproducing special variants of wind inﬂuence that can simulate the\\neffect of a landing helicopter or even a tornado. For the calcula-\\ntion of the wind inﬂuence, the authors assume the blade to be in its\\nstraight up position and compute the displacement that is cause by\\nthe wind effect. In comparison, our physical model has a persistent\\nstate over more than a single frame, which allows the implementa-\\ntion of natural forces and collisions with one physical model. Fig-\\nure 16 represents two scenes with special wind effects that simulate\\na helicopter and a tornado.\\nJahrmann et al. [2013] use a similar rendering approach, which uses\\nthe tessellation pipeline to render smoothly shaped blades of grass.\\nThe shape of the blade is generated by an alpha texture and invisi-\\nFigure 14: This ﬁgure shows the comparison between the technique\\nof Orthmann et al. [2009] (left) and our technique (right). Both\\nscenes show a complex objects moving through a meadow. This\\nillustrates the advantage of drawing each blade as geometric object\\ninstead of using billboards.\\nFigure 15: This ﬁgure presents the comparison between the tech-\\nnique of Fan et al. [2015] (left) and our technique (right). Both\\nscenes show a ﬁeld of grass with hundreds of balls being thrown\\naround. The collsion effect is more visible in the right image, since\\nthe ﬁeld of grass has more density.\\nble fragments are discarded. This enables an easy way to generate\\ndifferent shapes. However, the resolution of the texture that is used\\nis crucial for the visual appearance, since texture sampling artifacts\\ncan appear if the resolution is too low. The higher the resolution\\nof the alpha, the higher is the memory footprint of the technique\\nand the method becomes slower. In comparison, we generate the\\nshape by modifying directly the geometry of a blade using ana-\\nlytic functions. This reduces the amount of fragments that has to\\nbe computed and the edges of the shape have the same smoothness\\nregardless of the distance to the camera. Figure 17 shows a closeup\\nview of a blade of grass of both techniques.\\n8\\nConclusion and Future Work\\nIn this paper, we have proposed a novel grass-rendering technique\\nthat is capable of rendering dense ﬁelds of grass in real time. In\\ncomparison to related work, the ﬁeld of grass can have any shape\\nor spatial alignment. In addition, our approach renders each blade\\nas geometric object that can react to its environment. This reaction\\nto its environment is performed by evaluating a physically based\\nmodel for each blade separately. This model includes the inﬂu-\\nence of gravity, wind, and collisions with both simple and complex\\nobjects. We use a sphere-packing approach to represent complex\\nobjects during the collision detection. In order to achieve real-time\\nperformance, we introduce culling methods that are able to cull sin-\\ngle blades based on occlusion and their orientation and distance to-\\nwards the camera. The culling methods are able to cull up to 75%\\nof all blades of grass in a standard frame without decreasing the\\ndensity of the ﬁeld of grass signiﬁcantly. However, the rendering of\\neach blade of grass is still the bottleneck for the performance. Dif-\\nferent level-of-detail representations like in the work of Boulanger\\net al. [Boulanger et al. 2009] can be introduced as future work to\\n\\n\\nFeature\\nProposed method\\nFan et al.\\ngrass ﬁeld\\narbitrary geometry\\nheight ﬁeld only\\nblade geometry\\nthree control points with dynamically tessellated quads\\nﬁxed number of quads\\nLOD\\ndynamic tessellation, culling based on orientation and distance\\ndistance culling only\\neffects\\nwind, gravity, collisions\\nwind, collisions\\nphysical model\\nintegrated model\\nseparate models for wind and collision\\ncolliders\\ncomplex objects using sphere packing\\nsingle spheres only\\ncollision recovery\\nrecovery time depends on original displacement\\nﬁxed recovery time\\nTable 4: This table shows the most important differences between the method of Fan et al. [2015] and ours.\\nFigure 16: This ﬁgure presents the comparison between the tech-\\nnique of Wang et al. [2005] (left) and our technique (right). Both\\ntechniques are capable of creating special wind effects that are\\nmore complex than calculating the inﬂuence by trigonometric func-\\ntions.\\nfurther reduce the rendering time.\\nReferences\\nBOULANGER, K., PATTANAIK, S. N., AND BOUATOUCH, K.\\n2009. Rendering grass in real time with dynamic lighting. IEEE\\nComput. Graph. Appl. 29, 1 (Jan.), 32–41.\\nCHEN, K., AND JOHAN, H. 2010. Real-time continuum grass. In\\n2010 IEEE Virtual Reality Conference (VR), 227–234.\\nCLINE, D., JESCHKE, S., RAZDAN, A., WHITE, K.,\\nAND\\nWONKA, P. 2009. Dart throwing on surfaces. Computer Graph-\\nics Forum 28, 4 (June), 1217–1226.\\nEVERITT, C., REGE, A., AND CEBENOYAN, C. 2001. Hardware\\nshadow mapping. White paper, nVIDIA 2.\\nFAN, Z., LI, H., HILLESLAND, K., AND SHENG, B. 2015. Simu-\\nlation and rendering for millions of grass blades. In Proceedings\\nof the 19th Symposium on Interactive 3D Graphics and Games,\\nACM, New York, NY, USA, i3D ’15, 55–60.\\nFARIN, G. E., AND HANSFORD, D.\\n2000.\\nThe essentials of\\nCAGD. AK Peters Natick.\\nGRAVESEN, J. 1993. Adaptive subdivision and the length of Bezier\\ncurves.\\nMathematical Institute, Technical University of Den-\\nmark.\\nFigure 17: This ﬁgure presents the comparison between the tech-\\nnique of Wang et al. [2005] (left) and our technique (right). Both\\nrenderings show a closeup view of a blade of grass. The shape\\ngenerated by an alpha texture shows texture sampling artifacts,\\nwhereas the analytic functions generate smooth edges.\\nHABEL, R., WIMMER, M., AND JESCHKE, S. 2007. Instant ani-\\nmated grass. Journal of WSCG 15, 1-3, 123–128.\\nJAHRMANN, K., AND WIMMER, M. 2013. Interactive grass ren-\\ndering using real-time tessellation. In WSCG 2013 Full Paper\\nProceedings, M. Oliveira and V. Skala, Eds., 114–122.\\nKLEBER, G., 2015. Ea sports madden nﬂ: Breakthroughs in real-\\ntime rendering for next-gen consoles. SIGGRAPH 2015 Talks.\\nLOOP, C., AND BLINN, J. 2005. Resolution independent curve\\nrendering using programmable graphics hardware. Transactions\\non Graphics 24, 3.\\nMALINEN, M. I., AND FR ¨\\nANTI, P. 2014. Balanced K-Means for\\nClustering. Springer Berlin Heidelberg, Berlin, Heidelberg, 32–\\n41.\\nORTHMANN, J., REZK-SALAMA, C., AND KOLB, A. 2009. Gpu-\\nbased responsive grass. Journal of WSCG 17, 65–72.\\nPELZER, K. 2004. Rendering countless blades of waving grass. In\\nGPU Gems, R. Fernando, Ed. Addison-Wesley, 107–121.\\nSTOLPNER, S., KRY, P., AND SIDDIQI, K. 2012. Medial spheres\\nfor shape approximation. IEEE Transactions on Pattern Analysis\\nand Machine Intelligence 34, 6 (June), 1234–1240.\\nWANG, C., WANG, Z., ZHOU, Q., SONG, C., GUAN, Y., AND\\nPENG, Q. 2005. Dynamic modeling and rendering of grass wag-\\nging in wind: Natural phenomena and special effects. Comput.\\nAnimat. Virtual Worlds 16, 3-4 (July), 377–389.\\nWELLER, R., AND ZACHMANN, G. 2010. Protosphere: A gpu-\\nassisted prototype guided sphere packing algorithm for arbitrary\\nobjects. In ACM SIGGRAPH ASIA 2010 Sketches, ACM, New\\nYork, NY, USA, SA ’10, 8:1–8:2.\\nWHATLEY, D. 2005. Toward photorealism in virtual botany. In\\nGPU Gems 2, M. Pharr, Ed. Addison-Wesley, 7–25.\\n\\n\\nCitation: Choi, N.; Sung, M.\\nCWD-Sim: Real-Time Simulation on\\nGrass Swaying with Controllable\\nWind Dynamics. Appl. Sci. 2024, 14,\\n548. https://doi.org/10.3390/\\napp14020548\\nAcademic Editor: João M.\\nF. Rodrigues\\nReceived: 29 November 2023\\nRevised: 1 January 2024\\nAccepted: 6 January 2024\\nPublished: 8 January 2024\\nCopyright: © 2024 by the authors.\\nLicensee MDPI, Basel, Switzerland.\\nThis article is an open access article\\ndistributed\\nunder\\nthe\\nterms\\nand\\nconditions of the Creative Commons\\nAttribution (CC BY) license (https://\\ncreativecommons.org/licenses/by/\\n4.0/).\\napplied  \\nsciences\\nArticle\\nCWD-Sim: Real-Time Simulation on Grass Swaying with\\nControllable Wind Dynamics\\nNamil Choi\\nand Mankyu Sung *\\nDepartment of Computer Engineering, Keimyung University, Daegu 42601, Republic of Korea;\\nchnamil21@gmail.com\\n* Correspondence: mksung@kmu.ac.kr\\nAbstract: In this paper, we propose algorithms for the real-time simulation of grass deformation\\nand wind flow in complex scenes based on the Navier–Stokes fluid. Grasses play an important role\\nin natural scenes. However, accurately simulating their deformation due to external forces such as\\nthe wind can be computationally challenging. We propose algorithms that minimize computational\\ncost while producing visually appealing results. We do this by grouping the grass blades and then\\napplying the same force to the group to reduce the computation time. We also use a quadratic\\nequation to deform the blades affected by the wind force rather than using a complicated spline\\ntechnique. Wind force is fully modeled by the Navier–Stokes fluid equation, and the blades react to\\nthis force as if they were being swept by the wind. We also propose the AGC interface (Arrow-Guided\\nwind flow Control), which allows the direction and intensity of the wind to be manipulated using an\\narrow-shaped interface. Through this interface, users can have grass sway in response to user-defined\\nwind forces in a real-time rate. We verified that the proposed algorithms can simulate 900% more\\ngrass blades than the compared paper’s algorithms.\\nKeywords:\\ninteractive visualization; natural scene visualization; grass animation; real-time\\nsimulation; fluid dynamics in graphics\\n1. Introduction\\nSimulating natural phenomena presents a significant challenge but is essential in\\ncomputer graphics, especially for creating realistic scenes in applications like video games\\nand virtual environments. Grass, ubiquitous in natural landscapes, plays a pivotal role. The\\naccurate simulation of grass swaying in the wind necessitates a detailed modeling of each\\nblade and an in-depth understanding of the wind flow dynamics. Achieving such realism\\nrequires sophisticated physics algorithms capable of simulating intricate wind patterns and\\nblade deformation along with substantial computing resources to simulate and render a\\nlarge number of blades effectively.\\nIn this paper, we introduce the Controllable Wind Dynamics (CWD) techniques, which\\nwere designed to facilitate the real-time simulation of numerous grass blades interacting\\nwith external forces. This approach leverages the parallel computation capabilities of GPUs\\nfor the simulation, deformation, and rendering of grass blades. To minimize unnecessary\\ntransfer overhead between the CPU and GPU, all data updates are confined to the GPU\\nmemory buffer. The computation of blade deformation is contingent upon the direction\\nand magnitude of the artificially generated wind. We achieve a precise representation\\nof wind force and its interaction with the blades through fluid simulation governed by\\nthe Navier–Stokes equations, which are fundamental to fluid dynamics. The methodol-\\nogy for implementing fluid simulation using the Navier–Stokes equations is extensively\\ndocumented. In our research, we have adopted the methods delineated in [1–5].\\nThe reason why the CWD-Sim algorithm uses minimal computational resources\\ncompared to previous methods is that it uses a combination of techniques specifically\\nAppl. Sci. 2024, 14, 548. https://doi.org/10.3390/app14020548\\nhttps://www.mdpi.com/journal/applsci\\n\\n\\nAppl. Sci. 2024, 14, 548\\n2 of 14\\ndesigned to optimize simulation steps. First, unlike the method proposed in [6], which uses\\nBezier curves to deform the grass blades, our method uses a simple quadratic equation to\\nstretch the grass blade model vertically and bend it in all directions. This approach requires\\nfewer operations than spline curves, although both produce similar results. Second, instead\\nof simulating individual blades, we group them based on their world positions and place\\nthem in a grid structure. All blades in a group can have different deformation effects,\\neven if they are exposed to the same wind force because they have slightly different initial\\nphysical properties. This grouping significantly reduces the computation time without\\ncausing any noticeable visual artifacts. Through experiments, we have found that the\\ncomputation speed remains almost constant regardless of the number of blades and objects.\\nEssentially, the value of a cell on the grid computed by the fluid simulation determines the\\ncurvature, orientation, and shadow of the blade through specific separate equations. In\\nparticular, we use the quadratic equation to deform the blade model into a curved shape,\\nas if it were under the influence of gravity. The curved shape of the blade model can also\\nbe bent or stretched by external wind forces.\\nAn important problem to be addressed is how to efficiently specify the direction and\\nforce of the wind in the environment. Our method proposes the AGC (Arrow-Guided wind\\nflow Control) interface, which allows users to intuitively control wind flow. The interface\\nadds a set of 2D arrows that represent wind directions for a given time period directly into\\nthe environment. These arrows are connected to control the flow. Using this interface, users\\ncan manage complex flows, such as branching and merging of the wind.\\nThe remaining sections consist of the following. Section 2 provides an overview of\\nrelated work and a comparison with the proposed algorithm. Section 3 describes the\\ntechnical details of the CWD-Sim algorithms. Section 4 presents the experimental results\\nand performance graphs. Finally, Section 5 concludes the paper with a discussion and\\noutlines future work that could improve our CWD method.\\n2. Related Works\\n2.1. Static Grasses\\nIn recent years, several methods have been proposed for real-time grass simulation.\\nFor example, ref. [7] proposed a non-dynamic method to render more than 627,000,000\\nvirtual grass blades in real time at 18 fps. However, this method could not simulate the\\ndeformation of grass by external forces, such as the wind or objects, and could only render\\na static grass model without dynamic grass deformation. Similarly, Deussen et al. proposed\\na method that did not focus on rendering time [8]. It showed the most colorful plant\\ncomposition among the papers referenced, but it could only render a static grass model\\nand takes 75 min to render the scene.\\n2.2. Grass Deformation with External Forces\\nHabel focused on real-time vegetation rendering and animation [9] but did not specif-\\nically address the aspects of wind interaction and manipulation in detail. Chen et al.\\npresented a 2D approach to animate 3D vegetation in real time [10]. While their previous\\nmethod proposed a simple method to animate vegetation with billboard images based\\non simulation-guided grid-based warping, the methods did not provide specific features\\nfor the wind interaction. Qiu et al. proposed a rendering system for large-scale grass [11].\\nThe three-layer framework separated the rendering task from the data logic, making it\\nconvenient to add new vegetation simulation methods on the data layer, but it did not\\npropose an interaction with external forces. Max et al. proposed a method for render-\\ning grasses blowing in the wind with global illumination [12] using a lattice Boltzmann\\nmodel, a mass-spring system and multiple scattering. However, since the simulation\\nand rendering were performed on the CPU, performance was limited. Fan et al. utilized\\nphysical laws to simulate the movement of grasses deformed by a rolling ball [13]. The\\nauthors were able to reduce the computational load by activating and deactivating tile\\ngroups, which is the subdivision of the environment, as the ball passes over them for a\\n\\n\\nAppl. Sci. 2024, 14, 548\\n3 of 14\\ncertain period of time. Although this approach showed highly dynamic grass interactions,\\nit did not account for interactions with the wind. Furthermore, if global wind affecting\\nthe entire scene or interactions with rigid body objects was required, then this method\\nwould result in a significant computational burden. Similarly, Wang et al. proposed a\\nGPU-based grass simulation with accurate blade reconstruction [14], which focused on im-\\nproving the grass blade representation. But it still did not address the wind interaction and\\nmanipulation extensively.\\n2.3. Grass Deformation with Fluid Dynamics\\nIn [6], Lo et al. used a 60 × 60 × 20 3D Navier–Stokes simulation for wind dynamics,\\nand each grass blade calculated four control points of the parametric spline to represent a\\ncurved shape swaying by the wind. Although their approach was able to produce highly\\nrealistic grass animation, simulating 3D fluids and finding four control points of each blade\\nof grass were computationally intensive for large scenes.\\nOur method proposes a 1000 × 1000 2D Navier–Stokes simulation for wind dynamics\\ninstead. Complex wind dynamics created by the proposed method and its interaction\\nwith grasses in Figure 1. Our method produces more detailed wind interaction than [6]\\nand is able to cover larger complex scenes due to a more detailed and highly optimized\\nwind dynamic control scheme. For instance, our quadratic equation for the deformation\\nof the grass blade offers an alternative approach that can represent natural movement in\\nall directions within a three-dimensional space while reducing the computational com-\\nplexity involved in deforming the blades. Please refer to the accompanying video clip\\n(Supplementary Materials) for more details.\\nAppl. Sci. 2024, 1, 0\\n3 of 14\\nperiod of time. Although this approach showed highly dynamic grass interactions, it\\ndid not account for interactions with the wind. Furthermore, if global wind affecting\\nthe entire scene or interactions with rigid body objects was required, then this method\\nwould result in a significant computational burden. Similarly, Wang et al. proposed a\\nGPU-based grass simulation with accurate blade reconstruction [14], which focused on\\nimproving the grass blade representation. But it still did not address the wind interaction\\nand manipulation extensively.\\n2.3. Grass Deformation with Fluid Dynamics\\nIn [6], Lo et al. used a 60 × 60 × 20 3D Navier–Stokes simulation for wind dynamics,\\nand each grass blade calculated four control points of the parametric spline to represent a\\ncurved shape swaying by the wind. Although their approach was able to produce highly\\nrealistic grass animation, simulating 3D fluids and finding four control points of each blade\\nof grass were computationally intensive for large scenes.\\nOur method proposes a 1000 × 1000 2D Navier–Stokes simulation for wind dynamics\\ninstead. Complex wind dynamics created by the proposed method and its interaction with\\ngrasses in Figure 1. Our method produces more detailed wind interaction than [6] and is\\nable to cover larger complex scenes due to a more detailed and highly optimized wind dy-\\nnamic control scheme. For instance, our quadratic equation for the deformation of the grass\\nblade offers an alternative approach that can represent natural movement in all directions\\nwithin a three-dimensional space while reducing the computational complexity involved\\nin deforming the blades. Please refer to the accompanying video clip (Supplementary\\nMaterials) for more details.\\nFigure 1. Complex wind dynamics created by the proposed method and its interaction with grasses.\\nThe blue arrows splat the wind and can be moved through the red colored control point.\\nAnother point that makes our approach different from all the other work is the wind\\nforce authoring technique. Our method includes the ability to control the flow of the\\nwind in a way that designers intend. All previous work [8,12,13,15–18] did not address\\nthe problem of wind authoring. For comparison, ref. [6] provides only a one-way wind\\ngenerator. However, in our proposed method, the designer can place and modify the wind\\nflow directly in the environment with the AGC interface. The designer can also adjust\\nthe strength of the wind and the area affected by the wind. To put a wind force, the AGC\\ninterface allows users to put a starting point and an arrow guideline in front and behind\\nthe starting point. It is also possible for multiple arrows to be branched out from a single\\nstarting point, showing that various wind dynamics can be designed according to the\\ndesigner’s intent.\\nFigure 1. Complex wind dynamics created by the proposed method and its interaction with grasses.\\nThe blue arrows splat the wind and can be moved through the red colored control point.\\nAnother point that makes our approach different from all the other work is the wind\\nforce authoring technique. Our method includes the ability to control the flow of the\\nwind in a way that designers intend. All previous work [8,12,13,15–18] did not address\\nthe problem of wind authoring. For comparison, ref. [6] provides only a one-way wind\\ngenerator. However, in our proposed method, the designer can place and modify the wind\\nflow directly in the environment with the AGC interface. The designer can also adjust\\nthe strength of the wind and the area affected by the wind. To put a wind force, the AGC\\ninterface allows users to put a starting point and an arrow guideline in front and behind\\nthe starting point. It is also possible for multiple arrows to be branched out from a single\\n\\n\\nAppl. Sci. 2024, 14, 548\\n4 of 14\\nstarting point, showing that various wind dynamics can be designed according to the\\ndesigner’s intent.\\n3. Proposed Algorithms\\nThe CWD-Sim method describes a computationally efficient technique to realistically\\nsimulate the sway of the grass by the wind. It involves grouping grass blades into a\\ntwo-dimensional grid, simplifying the forces affecting the grass, on the vertex shaders to\\ndeform the grass model, and allowing the designer to control the flow of wind using arrow\\nguides. We are going to explain all steps in detail in the following sections.\\n3.1. Grouping of Grasses\\nPerforming individual fluid simulation calculations for every grass blade increases the\\ncomputational load. It blocks the real-time performance required for interactive applica-\\ntions. To solve this problem, the grass blades are grouped and assigned to a grid structure.\\nTo do so, the world positions of the blade groups are converted to a group index. The group\\nindex, G ∈Z, is calculated in Equation (1).\\nG =\\n\\u0012 Px\\nw + 0.5, Pz\\nh + 0.5\\n\\u0013\\n(1)\\nwhere G ∈R2, w is the width of the grid, h is the height of the grid, Px and Pz are the x and\\nz world coordinates of the blade.\\nThis equation divides the whole world into a 2D grid with a fixed cell size. Each cell\\ncontains a group of grass blades within its range.\\nThe grid,\\nwhich has a\\n1000 × 1000 resolution in our case, is used for fluid simulation of wind dynamics. However,\\nthis grid resolution can be reduced to obtain faster simulation speeds. Our experiments\\nindicate that reducing it to 200 × 200 would not make a big difference in visual quality.\\nThe 1000 × 1000 grid size means that there would be a total of 1,000,000 groups of grass\\nblades. Using the instance ID, which is the ID number of the instance when we use the GPU\\nInstancing technique [19], we can calculate the appropriate grid position for each grass\\nblade based on its world coordinates and then assign it to the appropriate group. Once we\\ndetermine the cells of all blade groups, we can make all blades in a group receive the same\\nforce instead of applying a different force to each individual blade. This approach greatly\\nreduces the computational load because all blades within a group receive the same force.\\nHowever, the visual quality does not decrease because there are so many grasses with\\ndifferent sizes and orientations. Figure 2 represents the 2D grid structure and the positions\\nwhere the grass blades are placed. Note that the grass blades are randomly distributed on\\nthe cell.\\nAppl. Sci. 2024, 1, 0\\n4 of 14\\n3. Proposed Algorithms\\nThe CWD-Sim method describes a computationally efficient technique to realistically\\nsimulate the sway of the grass by the wind. It involves grouping grass blades into a\\ntwo-dimensional grid, simplifying the forces affecting the grass, on the vertex shaders to\\ndeform the grass model, and allowing the designer to control the flow of wind using arrow\\nguides. We are going to explain all steps in detail in the following sections.\\n3.1. Grouping of Grasses\\nPerforming individual fluid simulation calculations for every grass blade increases the\\ncomputational load. It blocks the real-time performance required for interactive applica-\\ntions. To solve this problem, the grass blades are grouped and assigned to a grid structure.\\nTo do so, the world positions of the blade groups are converted to a group index. The group\\nindex, G ∈Z, is calculated in Equation (1).\\nG = ( Px\\nw + 0.5, Pz\\nh + 0.5)\\n(1)\\nwhere G ∈R2, w is the width of the grid, h is the height of the grid, Px and Pz are the x and\\nz world coordinates of the blade.\\nThis equation divides the whole world into a 2D grid with a fixed cell size. Each\\ncell contains a group of grass blades within its range. The grid, which has a 1000 × 1000\\nresolution in our case, is used for fluid simulation of wind dynamics. However, this grid\\nresolution can be reduced to obtain faster simulation speeds. Our experiments indicate that\\nreducing it to 200 × 200 would not make a big difference in visual quality. The 1000 × 1000\\ngrid size means that there would be a total of 1,000,000 groups of grass blades. Using\\nthe instance ID, which is the ID number of the instance when we use the GPU Instancing\\ntechnique [19], we can calculate the appropriate grid position for each grass blade based on\\nits world coordinates and then assign it to the appropriate group. Once we determine the\\ncells of all blade groups, we can make all blades in a group receive the same force instead\\nof applying a different force to each individual blade. This approach greatly reduces the\\ncomputational load because all blades within a group receive the same force. However,\\nthe visual quality does not decrease because there are so many grasses with different sizes\\nand orientations. Figure 2 represents the 2D grid structure and the positions where the\\ngrass blades are placed. Note that the grass blades are randomly distributed on the cell.\\n(a)\\n(b)\\nFigure 2. (a): Visualization of the 2D grid. (b): Grass blades represented as black points in the (a) cell.\\n3.2. Wind Force Modeling\\nSimulating wind on a computer is commonly achieved using the Navier–Stokes equa-\\ntions. These can be effectively solved through computational fluid dynamics methods,\\nas detailed in [1]. The wind force in our simulation is modeled by a real-time fluid simula-\\nFigure 2. (a): Visualization of the 2D grid. (b): Grass blades represented as black points in the (a) cell.\\n\\n\\nAppl. Sci. 2024, 14, 548\\n5 of 14\\n3.2. Wind Force Modeling\\nSimulating wind on a computer is commonly achieved using the Navier–Stokes equa-\\ntions. These can be effectively solved through computational fluid dynamics methods, as\\ndetailed in [1]. The wind force in our simulation is modeled by a real-time fluid simulation\\nalgorithm grounded in the theory of Stable Fluid introduced by Jos Stam in [1,3]. In this\\nsection, we will briefly summarize the basic fluid simulation algorithms. This algorithm\\nprovides a stable numerical solution to solve the Navier–Stokes equation, which is denoted\\nin Equation (2).\\n∂u\\n∂t = −(u·∇)u −1\\nρ∇p + ν∇2u + F\\n(2)\\n∇·u = 0\\n(3)\\nwhere ∂is partial derivative, u is fluid velocity, t is time, ∇is gradient operator, ν is the\\nkinematic viscosity, ∇2 is the Laplacian operator quantifying the diffusion, p is pressure,\\n∂u\\n∂t is the local or temporal acceleration, reflecting the changes in velocity at a specific\\npoint over time, and the term (u·∇)u is the convective acceleration that represents the\\ntransport of momentum by the fluid. The term ν∇2u represents the viscous diffusion\\nof momentum. The term −∇p represents the pressure gradient, which is responsible\\nfor driving or opposing fluid motion. Finally, F represents any external forces acting\\non the fluid, such as the wind. Most air movement in the atmosphere is considered\\nincompressible, and Equation (3) embodies the assumption of incompressibility for the\\nfluid. Our implementation is based on the procedures proposed by Dobryakov et al. [3].\\nThe procedures consist of multiple steps given a 2D grid to obtain the velocity grid V,\\nwhere Vi,j ∈R2 is a cell in the ith row and the jth column. To obtain the final updated\\nvelocity grid V′′′, the algorithm performs the following processes from (4) to (9) in order.\\nFirst, we calculate the curl of the velocity field as shown in Equation (4) that provides a\\nquantification of the rotation at each point.\\nCi,j = Vi+1,j −Vi−1,j + Vi,j+1 −Vi,j−1\\n(4)\\nwhere Ci,j is a 2D curl value at the ith row and jth cell of the grid. The subtraction term,\\nVi+1,j −Vi−1,j, approximates the median difference for the derivative of the velocity. The\\nterm Vi+1,j represents a single step speed to the right cell from the current position and\\nVi−1,j represents a single step speed for the left cell. Also, Vi,j+1 −Vi,j−1 indicates the\\nvertical speed. The calculation of these two directions gives a rotation measurement at (i, j)\\npoints. Next, we apply the vorticity confinement as described in Equation (5). This process\\nhelps to improve the smaller swirls that are noticeable in the fluid flow.\\nfi,j =\\nCi,j+1 −Ci,j−1, Ci+1,j −Ci−1,j\\n\\u0001·λ\\nV′\\ni,j = Vi,j + fi,j·∆t\\n(5)\\nwhere V′\\ni,j is the first updated velocity, fi,j ∈R2 is the force at (i, j), ∆t is the time step and\\nλ is the vorticity confinement factor. The divergence of the velocity field is then computed\\nas in Equation (6) in the next step. In fluid dynamics, this calculation gauges the rate at\\nwhich the density leaves a specific region of space.\\nDi,j =\\n\\u0010\\nV′\\ni,j+1 −V′\\ni,j−1 + V′\\ni+1,j −V′\\ni−1,j\\n\\u0011\\n/2\\n(6)\\nwhere Di,j ∈R2 is the divergence value. This step is followed by the projection of the\\npressure, which is described in Equation (7). This step eliminates the component of the\\nvelocity that does not contribute to the advection along the vector field, leaving only the\\ndivergence-free component.\\nPi,j =\\nPi,j+1 + Pi,j−1 + Pi+1,j −Pi−1,j −Di,j\\n\\u0001\\n/4\\n(7)\\n\\n\\nAppl. Sci. 2024, 14, 548\\n6 of 14\\nwhere Pi,j ∈R2 is the pressure and Di,j is the divergence at the gi,j. Next, the pressure\\ngradient is subtracted from the velocity field as indicated in Equation (8). This step ensures\\nthe conservation of mass within our fluid system.\\nV′′\\ni,j = V′\\ni,j −\\nPi+1,j −Pi−1,j, Pi,j+1 −Pi,j−1\\n\\u0001\\n(8)\\nwhere V′′\\ni,j is the second updated velocity and V′\\ni,j the first updated velocity obtained in\\nEquation (5). In the final step, the velocity field is then advected along itself. This stage\\ncreates the illusion of motion and fluidity, which is a critical aspect of fluid dynamics\\nvisualization. Let us say that the 2D coordinates of cell is α = (i, j). Then, the updated\\ncoordinate α′ is first calculated from the second updated velocity and the grid size s. Note\\nthat the grid has a square shape where the width and height are equal to s.\\nα′ = α −V′′\\ni,j·s·∆t\\n(9)\\nOnce the advection is complete, the final velocity V′′′\\ni,j is obtained through Equation (10).\\nV′′′\\ni,j = V′′\\nα′/(1.0 + λ·∆t)\\n(10)\\nThe calculated V′′′ in Equation (9) is used to model the deformation of the grass group.\\nEach blade in a grass group calculates the deformation vector with Equation (12) based on\\nV′′′ in the next Section 3.3.\\n3.3. Deformation of the Grass Model\\nFrom real-world observations of grass swaying in the wind, we propose a basic grass\\ndeformation model. It replicates grass dynamics through a blend of the two most significant\\ngrass motions, as shown in Figure 3. Bending is due to the influence of gravity, and the\\nswaying of the grass is due to the wind force.\\nAppl. Sci. 2024, 1, 0\\n6 of 14\\nwhere Pi,j ∈R2 is the pressure and Di,j is the divergence at the gi,j. Next, the pressure\\ngradient is subtracted from the velocity field as indicated in Equation (8). This step ensures\\nthe conservation of mass within our fluid system.\\nV′′\\ni,j = V′\\ni,j −(Pi+1,j −Pi−1,j, Pi,j+1 −Pi,j−1)\\n(8)\\nwhere V′′\\ni,j is the second updated velocity and V′\\ni,j the first updated velocity obtained in\\nEquation (5). In the final step, the velocity field is then advected along itself. This stage\\ncreates the illusion of motion and fluidity, which is a critical aspect of fluid dynamics\\nvisualization. Let us say that the 2D coordinates of cell is α = (i, j). Then, the updated\\ncoordinate α′ is first calculated from the second updated velocity and the grid size s. Note\\nthat the grid has a square shape where the width and height are equal to s.\\nα′ = α −V′′\\ni,j · s · ∆t\\n(9)\\nOnce the advection is complete, the final velocity V′′′\\ni,j is obtained through Equation (10).\\nV′′′\\ni,j = V′′\\nα′/(1.0 + λ · ∆t)\\n(10)\\nThe calculated V′′′ in Equation (9) is used to model the deformation of the grass group.\\nEach blade in a grass group calculates the deformation vector with Equation (12) based on\\nV′′′ in the next Section 3.3.\\n3.3. Deformation of the Grass Model\\nFrom real-world observations of grass swaying in the wind, we propose a basic grass\\ndeformation model. It replicates grass dynamics through a blend of the two most significant\\ngrass motions, as shown in Figure 3. Bending is due to the influence of gravity, and the\\nswaying of the grass is due to the wind force.\\n(a)\\n(b)\\n(c)\\nFigure 3. Shows the detailed bending effect of a grass blade due to the wind force. (a): Default state.\\n(b): Only gravity. (c): Gravity with external wind force.\\nThe deformation of the grass is carried out in the vertex shader. Initially, before the\\nwind force is applied, the only force that acts on the grass is gravity. This force consistently\\nbends the blade downward, and the amount of bending depends on the weight of the blade\\nin the absence of wind force. This process is divided into gravity deformation and external\\nforce deformation. In the first step, we apply an initial deformation based on the elevation\\nvalue Py ∈R of the position of the vertex. This step modifies the original position of the\\nvertex P ∈R3 to a new position P′, as shown in Figure 4. The second step converts the\\nexternal force into a translation vector using a quadratic equation, as shown in Figure 5.\\nFigure 3. Shows the detailed bending effect of a grass blade due to the wind force. (a): Default state.\\n(b): Only gravity. (c): Gravity with external wind force.\\nThe deformation of the grass is carried out in the vertex shader. Initially, before the\\nwind force is applied, the only force that acts on the grass is gravity. This force consistently\\nbends the blade downward, and the amount of bending depends on the weight of the blade\\nin the absence of wind force. This process is divided into gravity deformation and external\\nforce deformation. In the first step, we apply an initial deformation based on the elevation\\nvalue Py ∈R of the position of the vertex. This step modifies the original position of the\\nvertex P ∈R3 to a new position P′, as shown in Figure 4. The second step converts the\\nexternal force into a translation vector using a quadratic equation, as shown in Figure 5.\\n\\n\\nAppl. Sci. 2024, 14, 548\\n7 of 14\\nThis calculation of a quadratic equation eliminates the computational overhead of using a\\nBezier curve in [6] and provides a similar translation result.\\nP′ =\\n\\u0010\\nPx, Py −k1·\\nPy\\n\\u00012, Pz + k2·\\nPy\\n\\u00012\\u0011\\n(11)\\nwhere k1 and k2 are parameters to control the shape of the curve.\\nFor comparison,\\nFigure 4a,b show an example of bending of a grass blade. Figure 4a is the result when we\\napply our simple quadratic equation, whereas Figure 4b shows the case when we apply the\\nBezier curve. For comparison, we put two graphs together to check the similarity for both\\nFigures 4a and 5a where the dotted curves are the Bezier curves and the green curves are\\nour proposed methods. We also show the red dots for control points for the Bezier curves.\\nAs we can see from the picture, the bending result is quite similar for both cases, although\\nour equation needs fewer computations. We also add numerical comparisons in Table 1.\\nAppl. Sci. 2024, 1, 0\\n7 of 14\\nThis calculation of a quadratic equation eliminates the computational overhead of using a\\nBezier curve in [6] and provides a similar translation result.\\nP′ = (Px, Py −k1 · (Py)2, Pz + k2 · (Py)2)\\n(11)\\nwhere k1 and k2 are parameters to control the shape of the curve.\\nFor comparison,\\nFigure 4a,b show an example of bending of a grass blade. Figure 4a is the result when we\\napply our simple quadratic equation, whereas Figure 4b shows the case when we apply\\nthe Bezier curve. For comparison, we put two graphs together to check the similarity for\\nboth Figures 4a and 5a where the dotted curves are the Bezier curves and the green curves\\nare our proposed methods. We also show the red dots for control points for the Bezier\\ncurves. As we can see from the picture, the bending result is quite similar for both cases,\\nalthough our equation needs fewer computations. We also add numerical comparisons in\\nTable 1.\\n(a)\\n(b)\\nFigure 4. Comparison of grass’s default state due to gravity. (a): Proposed deformation equa-\\ntion (11) is shown as a green line, the Bezier curve is shown as a red dotted line superim-\\nposed on our equation.\\n(b): Bezier curve equation (P = (1 −t)3P1 + 3(1 −t)2tP2 + 3(1 −t)\\nt2P3 + t3P4, 0 ≤t ≤1) proposed in [20].\\n(a)\\n(b)\\nFigure 5. Comparison of grass’s swaying state due to external force. (a): Proposed deformation\\nequations (11) and (12) applied are shown as a green line, the Bezier curve is shown as a red dotted\\nline superimposed on our equation. (b): Bezier curve equation (P = (1 −t)3P1 + 3(1 −t)2tP2 + 3(1 −\\nt)t2P3 + t3P4, 0 ≤t ≤1) proposed in [20].\\nFigure 4. Comparison of grass’s default state due to gravity. (a): Proposed deformation Equation (11)\\nis shown as a green line, the Bezier curve is shown as a red dotted line superimposed on our equation.\\n(b): Bezier curve equation\\n\\u0010\\nP = (1 −t)3P1 + 3(1 −t)2tP2 + 3(1 −t) t2P3 + t3P4 , 0 ≤t ≤1) proposed\\nin [20].\\nAppl. Sci. 2024, 1, 0\\n7 of 14\\nThis calculation of a quadratic equation eliminates the computational overhead of using a\\nBezier curve in [6] and provides a similar translation result.\\nP′ = (Px, Py −k1 · (Py)2, Pz + k2 · (Py)2)\\n(11)\\nwhere k1 and k2 are parameters to control the shape of the curve.\\nFor comparison,\\nFigure 4a,b show an example of bending of a grass blade. Figure 4a is the result when we\\napply our simple quadratic equation, whereas Figure 4b shows the case when we apply\\nthe Bezier curve. For comparison, we put two graphs together to check the similarity for\\nboth Figures 4a and 5a where the dotted curves are the Bezier curves and the green curves\\nare our proposed methods. We also show the red dots for control points for the Bezier\\ncurves. As we can see from the picture, the bending result is quite similar for both cases,\\nalthough our equation needs fewer computations. We also add numerical comparisons in\\nTable 1.\\n(a)\\n(b)\\nFigure 4. Comparison of grass’s default state due to gravity. (a): Proposed deformation equa-\\ntion (11) is shown as a green line, the Bezier curve is shown as a red dotted line superim-\\nposed on our equation.\\n(b): Bezier curve equation (P = (1 −t)3P1 + 3(1 −t)2tP2 + 3(1 −t)\\nt2P3 + t3P4, 0 ≤t ≤1) proposed in [20].\\n(a)\\n(b)\\nFigure 5. Comparison of grass’s swaying state due to external force. (a): Proposed deformation\\nequations (11) and (12) applied are shown as a green line, the Bezier curve is shown as a red dotted\\nline superimposed on our equation. (b): Bezier curve equation (P = (1 −t)3P1 + 3(1 −t)2tP2 + 3(1 −\\nt)t2P3 + t3P4, 0 ≤t ≤1) proposed in [20].\\nFigure 5.\\nComparison of grass’s swaying state due to external force.\\n(a):\\nProposed de-\\nformation Equations (11) and (12) applied are shown as a green line, the Bezier curve is\\nshown as a red dotted line superimposed on our equation.\\n(b):\\nBezier curve equation\\n\\u0010\\nP = (1 −t)3P1 + 3(1 −t)2tP2 + 3(1 −t)t2P3 + t3P4, 0 ≤t ≤1\\n\\u0011\\nproposed in [20].\\n\\n\\nAppl. Sci. 2024, 14, 548\\n8 of 14\\nTable 1. Comparative analysis of algorithmic efficiency in processing vertex points.\\n# of Vertex Points\\nComputation Time of\\nEquation (11) (ms)\\nComputation Time of Bezier\\nCurve (ms)\\n1000\\n1.9\\n6.8\\n5000\\n5.9\\n37.9\\n10,000\\n13.0\\n75.8\\nTable 1 shows the evaluation of up to 10,000 virtual vertex points. Our proposed\\nalgorithm (11) shows a speed faster than that of using the Bezier curve in terms of com-\\nputation times, which is approximately 82.8% faster, with a time savings of 62.8 ms. This\\nefficiency difference is quite important when we are dealing with a large set of vertex\\npoints such as grasses because it underscores the impact of computational complexity on\\nprocessing speed and therefore highlights the importance of choosing the right algorithm\\nfor time-sensitive computational tasks.\\nIn the second step of our process, we take into account the impact of the wind force on\\nthe grass blades. We calculate the wind translation vector T from the wind direction vector\\nW and its magnitude F. This vector T essentially quantifies how the wind force should alter\\nthe position of the grass blades. The elevation value of the deformed vertex P′\\ny is again\\nused to calculate the wind translation. Specifically, we calculate T, which encapsulates\\nboth the direction vector of the wind W and its magnitude F. The height of the deformed\\nvertex, which we refer to as P′\\ny, plays a critical role in this calculation. The effect of the\\nwind changes depending on the height of the blade, and this is captured in the height value.\\nFor example, the wind may have a stronger impact on the top of the blade than on the\\nlower base part. Therefore, we use P′\\ny to adjust the strength of the wind translation vector\\nT. Equation (12) describes how these computations are performed.\\nT = F·\\n\\u0012\\nV′′′\\nx\\n\\u0010\\nP′\\ny\\n\\u00112\\n, −\\n\\f\\n\\f\\n\\f\\n\\fV′′′\\n\\f\\n\\f\\n\\f\\n\\f\\n\\u0010\\nP′\\ny\\n\\u00112\\n, −V′′′\\ny\\n\\u0010\\nP′\\ny\\n\\u00112\\u0013\\n(12)\\nFigures 4 and 5 show another comparison between our equation proposed in (12) and\\nthe Bezier curve. As we can see, these two curves are almost identical, which proves that\\nour equation can be used to bend the grass blade influenced by wind force. The final step\\ninvolves updating the vertex positions by applying the wind translation T to the initial\\ndeformed positions P′. Transformation of the positions of the vertex positions is facilitated\\nby the model matrix M. As shown in Equation (13), the final position of the vertex, P′′,\\nis calculated.\\nP′′ = M\\n(1 −λ)T + λP′\\u0001\\n(13)\\nwhere λ is the weighting parameter. The λ is a weighting parameter that represents the\\ndegree of effect that wind translation T and initial deformation P′ have on the final position\\nP′′. When λ is closer to 0, the wind translation T has more influence on the final position,\\nand when λ is closer to 1, the initial deformation P′ has more influence.\\n3.4. Shadows between Grasses\\nWithout the shadows, realism is greatly reduced, and blade interaction is difficult\\nto perceive. However, calculating the shadows between all blades of grass can be com-\\nputationally expensive. In particular, if we use a conventional method such as shadow\\nmapping, which requires multi-pass rendering, it would not be effective to generate the\\nmap considering a large number of geometry data to render.\\nTo solve this problem, we propose a simplified self-shadow calculation technique, as\\nshown in Figure 6. We use a simplified equation to handle the shadows between all the\\ngrass blades. When a blade is in shadow, its color becomes dark. The brightness of the\\ngrass is adjusted based on the highest height of every group of grasses. The vertex of the\\nhighest position has the lightest color, while the color becomes dimmer as it goes down.\\nThis principle is based on the fact that when a blade of grass is pushed downward, it has a\\n\\n\\nAppl. Sci. 2024, 14, 548\\n9 of 14\\nhigh chance of being obscured by other blades of grass. Equation (14) represents the color\\nadjustment formula. Figure 3 shows the detailed bending effect of a grass blade due to the\\nwind force. Note that the x axis is the x or z offset from the local origin, while the y axis\\nindicates the y offset from the origin, which shows the amount of bending. The original\\nupright grass blade is also shown for comparison. As we can see in the figure, there were\\nno unnatural artifacts on the mesh. As shown in Figure 7, the difference in naturalness\\nwith and without shadows is significant.\\nc f = ct· max(mmin, min(P′′\\ny −|F|·c1 + c2, mmax))\\n(14)\\nwhere c f ∈R4 is the color of a vertex, ct ∈R3 is a diffuse color, mmin and mmax are the\\ndarkest and brightest values, c1 and c2 are control parameters and p′′\\ny is the height of the\\nblade. Through experimentation, we believe that this approach is sufficient for grasses in a\\nlarge meadow where a large number of homogeneous grasses are packed. We have shown\\nthe comparison results in Section 4.\\nAppl. Sci. 2024, 1, 0\\n9 of 14\\nhigh chance of being obscured by other blades of grass. Equation (14) represents the color\\nadjustment formula. Figure 3 shows the detailed bending effect of a grass blade due to the\\nwind force. Note that the x axis is the x or z offset from the local origin, while the y axis\\nindicates the y offset from the origin, which shows the amount of bending. The original\\nupright grass blade is also shown for comparison. As we can see in the figure, there were\\nno unnatural artifacts on the mesh. As shown in Figure 7, the difference in naturalness\\nwith and without shadows is significant.\\nc f = ct · max(mmin, min(P′′\\ny −|F| · c1 + c2, mmax))\\n(14)\\nwhere c f ∈R4 is the color of a vertex, ct ∈R3 is a diffuse color, mmin and mmax are the\\ndarkest and brightest values, c1 and c2 are control parameters and p′′\\ny is the height of the\\nblade. Through experimentation, we believe that this approach is sufficient for grasses in a\\nlarge meadow where a large number of homogeneous grasses are packed. We have shown\\nthe comparison results in Section 4.\\nFigure 6. As the bending of the blade goes deeper due to the wind force, vertex colors become darker.\\n(a)\\n(b)\\nFigure 7. (a): Without the shadow between grasses. (b): After applying the proposed shadow\\ngeneration technique to grasses.\\n3.5. Arrow-Guided Wind Flow Control\\nOne of the problems with using fluid for wind dynamics is how we can specify the\\nwind the way the designer wants. Our algorithm gives designers the ability to control\\nthe wind flow in a scene using the so-called AGC (Arrow-Guided wind flow Control)\\ninterface. These arrow guides consist of a root point and multiple ending points, which\\ncan be added or removed as needed. The root point acts as the starting point for the wind\\nflow. Clicking the points also opens the inspector window. In this window, the force\\nstrength can be adjusted by changing sliders or by entering a number. Setting an end point\\ndetermines the direction of the flow from the root point, which automatically changes to an\\nFigure 6. As the bending of the blade goes deeper due to the wind force, vertex colors become darker.\\nAppl. Sci. 2024, 1, 0\\n9 of 14\\nhigh chance of being obscured by other blades of grass. Equation (14) represents the color\\nadjustment formula. Figure 3 shows the detailed bending effect of a grass blade due to the\\nwind force. Note that the x axis is the x or z offset from the local origin, while the y axis\\nindicates the y offset from the origin, which shows the amount of bending. The original\\nupright grass blade is also shown for comparison. As we can see in the figure, there were\\nno unnatural artifacts on the mesh. As shown in Figure 7, the difference in naturalness\\nwith and without shadows is significant.\\nc f = ct · max(mmin, min(P′′\\ny −|F| · c1 + c2, mmax))\\n(14)\\nwhere c f ∈R4 is the color of a vertex, ct ∈R3 is a diffuse color, mmin and mmax are the\\ndarkest and brightest values, c1 and c2 are control parameters and p′′\\ny is the height of the\\nblade. Through experimentation, we believe that this approach is sufficient for grasses in a\\nlarge meadow where a large number of homogeneous grasses are packed. We have shown\\nthe comparison results in Section 4.\\nFigure 6. As the bending of the blade goes deeper due to the wind force, vertex colors become darker.\\n(a)\\n(b)\\nFigure 7. (a): Without the shadow between grasses. (b): After applying the proposed shadow\\ngeneration technique to grasses.\\n3.5. Arrow-Guided Wind Flow Control\\nOne of the problems with using fluid for wind dynamics is how we can specify the\\nwind the way the designer wants. Our algorithm gives designers the ability to control\\nthe wind flow in a scene using the so-called AGC (Arrow-Guided wind flow Control)\\ninterface. These arrow guides consist of a root point and multiple ending points, which\\ncan be added or removed as needed. The root point acts as the starting point for the wind\\nflow. Clicking the points also opens the inspector window. In this window, the force\\nstrength can be adjusted by changing sliders or by entering a number. Setting an end point\\ndetermines the direction of the flow from the root point, which automatically changes to an\\nFigure 7. (a): Without the shadow between grasses. (b): After applying the proposed shadow\\ngeneration technique to grasses.\\n3.5. Arrow-Guided Wind Flow Control\\nOne of the problems with using fluid for wind dynamics is how we can specify the\\nwind the way the designer wants. Our algorithm gives designers the ability to control the\\nwind flow in a scene using the so-called AGC (Arrow-Guided wind flow Control) interface.\\nThese arrow guides consist of a root point and multiple ending points, which can be added\\nor removed as needed. The root point acts as the starting point for the wind flow. Clicking\\nthe points also opens the inspector window. In this window, the force strength can be\\nadjusted by changing sliders or by entering a number. Setting an end point determines the\\n\\n\\nAppl. Sci. 2024, 14, 548\\n10 of 14\\ndirection of the flow from the root point, which automatically changes to an arrow. Because\\nall points can be added or removed directly anywhere in the environment, the designer has\\ncomplete control over editing the wind forces, as shown in Figure 8.\\nAppl. Sci. 2024, 1, 0\\n10 of 14\\narrow. Because all points can be added or removed directly anywhere in the environment,\\nthe designer has complete control over editing the wind forces, as shown in Figure 8.\\n(a)\\n(b)\\nFigure 8. Starting with the state of (a) and adding as shown in (b) using the controllable arrow guide\\nwind editing tool.\\nOne of advantages of our proposed AGC interface is that multiple arrows can be\\nconnected to build more complicated wind dynamics. Thus, the wind flow can be a simple\\nline or can be designed to resemble a tree structure or other complex patterns. By changing\\nthe position and length of the arrows, designers can adjust the direction of the wind flow.\\nOnce the design is complete, the wind forces are generated from the root to the end point\\nalong the series of arrows. Each point, which is the end point of the arrow, applies a force\\nto the fluid simulation in the direction of the arrow from the start point. In the case of a tree\\nstructure, the forces are applied in a sequence based on the direction of the arrow’s flow to\\nmake it appear continuous.\\n4. Experiments\\nTo verify our algorithms, we built a system and performed a set of experiments.\\nHardware specifications include an E3-1230 v2 CPU and GTX 660 2GB GPU. For 3D\\nrendering, we used the OpenGL and GLSL version 4.5. The grass model that we used in\\nthe experiments was in Autodesk’s FBX format. Please see the accompanying video clip\\nthat we submitted (Supplementary Materials) and the Youtube video (https://youtu.be/\\nuV0CFSqszJE (accessed on 5 January 2024)).\\nFor fluid simulation, we used a 2D texture grid size of 1000 × 1000 to simulate fluid dy-\\nnamics, applying Equations (4)–(10). In Equation (5), we set the vorticity confinement factor\\nλ to 50. Regarding grass deformation, in Equation (11), we set the deformation parameters\\nk1 to 0.05 and k2 to 0.1. These values were used to control the initial shape of the grass,\\nwhich represented the weight of a grass blade due to gravity. Furthermore, in Equation (13),\\nwe set 0.2 for λ to control the flexibility of the grass blade under external force.\\nIn the first experiment, we checked the performance of our algorithm. As we increase\\nthe number of grass blades, we checked its fps. Note that all computations and rendering are\\nperformed on the GPU side. The result is shown in Figure 9. As we can see in the figure, our\\nalgorithm maintained the real-time performance even if we increased the number of grasses\\nup to 1,200,000. For comparison with other algorithms, we picked [6], which we believe to\\nbe one of the complete solutions for grass rendering and animation. Figure 9 shows the\\nperformance comparison between our algorithm and [6]. Note that the narrow blue and\\norange bands represent the trends of the graph. For this test, we used the same GPU to\\nobtain an unbiased result. From this test, we knew that our algorithm did not significantly\\nreduce performance as we increase the number of grasses. On the contrary, the algorithm\\nproposed in [6] had a substantial decrease in fps. It turned out that our simulation can\\nachieve speeds 10× to 50× faster than [6] in a similar hardware environment.\\nFigure 8. Starting with the state of (a) and adding as shown in (b) using the controllable arrow guide\\nwind editing tool.\\nOne of advantages of our proposed AGC interface is that multiple arrows can be\\nconnected to build more complicated wind dynamics. Thus, the wind flow can be a simple\\nline or can be designed to resemble a tree structure or other complex patterns. By changing\\nthe position and length of the arrows, designers can adjust the direction of the wind flow.\\nOnce the design is complete, the wind forces are generated from the root to the end point\\nalong the series of arrows. Each point, which is the end point of the arrow, applies a force\\nto the fluid simulation in the direction of the arrow from the start point. In the case of a tree\\nstructure, the forces are applied in a sequence based on the direction of the arrow’s flow to\\nmake it appear continuous.\\n4. Experiments\\nTo verify our algorithms, we built a system and performed a set of experiments.\\nHardware specifications include an E3-1230 v2 CPU and GTX 660 2GB GPU. For 3D\\nrendering, we used the OpenGL and GLSL version 4.5. The grass model that we used in\\nthe experiments was in Autodesk’s FBX format. Please see the accompanying video clip\\nthat we submitted (Supplementary Materials) and the Youtube video (https://youtu.be/\\nuV0CFSqszJE (accessed on 5 January 2024)).\\nFor fluid simulation, we used a 2D texture grid size of 1000 × 1000 to simulate fluid dy-\\nnamics, applying Equations (4)–(10). In Equation (5), we set the vorticity confinement factor\\nλ to 50. Regarding grass deformation, in Equation (11), we set the deformation parameters\\nk1 to 0.05 and k2 to 0.1. These values were used to control the initial shape of the grass,\\nwhich represented the weight of a grass blade due to gravity. Furthermore, in Equation (13),\\nwe set 0.2 for λ to control the flexibility of the grass blade under external force.\\nIn the first experiment, we checked the performance of our algorithm. As we increase\\nthe number of grass blades, we checked its fps. Note that all computations and rendering\\nare performed on the GPU side. The result is shown in Figure 9. As we can see in the figure,\\nour algorithm maintained the real-time performance even if we increased the number of\\ngrasses up to 1,200,000. For comparison with other algorithms, we picked [6], which we\\nbelieve to be one of the complete solutions for grass rendering and animation. Figure 9\\nshows the performance comparison between our algorithm and [6]. Note that the narrow\\nblue and orange bands represent the trends of the graph. For this test, we used the same\\nGPU to obtain an unbiased result. From this test, we knew that our algorithm did not\\nsignificantly reduce performance as we increase the number of grasses. On the contrary, the\\nalgorithm proposed in [6] had a substantial decrease in fps. It turned out that our simulation\\ncan achieve speeds 10× to 50× faster than [6] in a similar hardware environment.\\n\\n\\nAppl. Sci. 2024, 14, 548\\n11 of 14\\nAppl. Sci. 2024, 1, 0\\n11 of 14\\nFigure 9. Performance comparison between our algorithms and the method proposed in [6].\\nIn the second experiment, we tested how efficient our algorithms are in designing\\ncomplicated wind dynamics. Figure 1 shows the case where winds coming from multiple\\nsources must interact with static obstacles. Our method could generate a realistic bump\\nand churn in a very realistic way between wind and obstacles. Figure 10 shows two winds\\ncolliding in the middle of the environment. You can see that the two winds are deflecting\\nand changing direction smoothly as shown in Figure 11. Please refer to the accompanying\\nvideo of the result for more details. Figure 7 compared two cases in which we applied\\nthe shadow generation technique proposed in Section 3.5 and not. We can easily tell that\\nshadowing between grasses improves visual quality. Finally, Figure 8 shows the wind-\\nediting process with the proposed AGC interface. Root points and end points are added\\ndirectly to the environment to form the arrow guides, and those guides are connected to\\neach other to create complicate tree-like wind forces, which improves controllability.\\n(a)\\n(b)\\nFigure 10. The two winds interact in the middle and then turn from the other direction (a) to (b).\\nFigure 9. Performance comparison between our algorithms and the method proposed in [6].\\nIn the second experiment, we tested how efficient our algorithms are in designing\\ncomplicated wind dynamics. Figure 1 shows the case where winds coming from multiple\\nsources must interact with static obstacles. Our method could generate a realistic bump\\nand churn in a very realistic way between wind and obstacles. Figure 10 shows two winds\\ncolliding in the middle of the environment. You can see that the two winds are deflecting\\nand changing direction smoothly as shown in Figure 11. Please refer to the accompanying\\nvideo of the result for more details. Figure 7 compared two cases in which we applied\\nthe shadow generation technique proposed in Section 3.5 and not. We can easily tell that\\nshadowing between grasses improves visual quality. Finally, Figure 8 shows the wind-\\nediting process with the proposed AGC interface. Root points and end points are added\\ndirectly to the environment to form the arrow guides, and those guides are connected to\\neach other to create complicate tree-like wind forces, which improves controllability.\\nAppl. Sci. 2024, 1, 0\\n11 of 14\\nFigure 9. Performance comparison between our algorithms and the method proposed in [6].\\nIn the second experiment, we tested how efficient our algorithms are in designing\\ncomplicated wind dynamics. Figure 1 shows the case where winds coming from multiple\\nsources must interact with static obstacles. Our method could generate a realistic bump\\nand churn in a very realistic way between wind and obstacles. Figure 10 shows two winds\\ncolliding in the middle of the environment. You can see that the two winds are deflecting\\nand changing direction smoothly as shown in Figure 11. Please refer to the accompanying\\nvideo of the result for more details. Figure 7 compared two cases in which we applied\\nthe shadow generation technique proposed in Section 3.5 and not. We can easily tell that\\nshadowing between grasses improves visual quality. Finally, Figure 8 shows the wind-\\nediting process with the proposed AGC interface. Root points and end points are added\\ndirectly to the environment to form the arrow guides, and those guides are connected to\\neach other to create complicate tree-like wind forces, which improves controllability.\\n(a)\\n(b)\\nFigure 10. The two winds interact in the middle and then turn from the other direction (a) to (b).\\nFigure 10. The two winds interact in the middle and then turn from the other direction (a) to (b).\\nThe data in Table 2 present additional performance metrics obtained using an Intel\\nCore i7-10700KF CPU and an NVIDIA RTX 2080 8 GB GPU. The simulations were conducted\\nwith a varying number of grass blades, up to a maximum of 7,000,000, to evaluate real-time\\nperformance. The optimal frame rate achieved under these conditions was 29 fps. The\\ngrid size for wind simulation was 1000 × 1000. The whole simulation time includes the\\nprocesses time described in Equations (11)–(13). The time for the grass shadow indicates\\nthe performance of the shading algorithm, as illustrated in Figure 7b. The grass rendering\\ntime includes both the grass simulation and shadow rendering step.\\n\\n\\nAppl. Sci. 2024, 14, 548\\n12 of 14\\nAppl. Sci. 2024, 1, 0\\n12 of 14\\n(a)\\n(b)\\nFigure 11. Two winds are changing direction over time after bending. (a) has been changed to (b).\\nThe data in Table 2 present additional performance metrics obtained using an Intel\\nCore i7-10700KF CPU and an NVIDIA RTX 2080 8 GB GPU. The simulations were conducted\\nwith a varying number of grass blades, up to a maximum of 7,000,000, to evaluate real-\\ntime performance. The optimal frame rate achieved under these conditions was 29 fps.\\nThe grid size for wind simulation was 1000 × 1000. The whole simulation time includes the\\nprocesses time described in Equations (11)–(13). The time for the grass shadow indicates\\nthe performance of the shading algorithm, as illustrated in Figure 7b. The grass rendering\\ntime includes both the grass simulation and shadow rendering step.\\nTable 2. Performance metrics of grass simulation.\\nGrass Count\\nWind\\nSimulation\\n(ms)\\nGrass\\nSimulation\\n(ms)\\nGrass\\nShadow (ms)\\nGrass\\nRendering\\n(ms)\\nFPS\\n1,000,000\\n5.9\\n0.1\\n0.1\\n3.3\\n87\\n2,000,000\\n5.9\\n0.1\\n0.1\\n7.5\\n69\\n3,000,000\\n5.9\\n0.1\\n0.1\\n11.4\\n51\\n4,000,000\\n5.9\\n0.3\\n0.2\\n15.6\\n42\\n5,000,000\\n5.9\\n0.6\\n0.4\\n19.4\\n36\\n6,000,000\\n5.9\\n0.7\\n0.5\\n23.2\\n32\\n7,000,000\\n5.9\\n0.7\\n0.5\\n27.4\\n29\\n5. Conclusions\\nIn this paper, we presented CWD-Sim, a real-time simulation algorithm for grass\\ndeformation and wind dynamic control in complex scenes. Our algorithm is capable of\\nnaturally simulating the effects of wind on grasses while allowing designers to have control\\nover the wind flow in complex scenes with obstacles or other structures. By grouping\\ngrass blades and simplifying the force calculation, our algorithm significantly reduces\\ncomputational load and achieves faster and more efficient simulations. Our method also\\nallows for grass-model variation and efficient shadowing, which further enhances the\\nrealism of the simulation.\\nHowever, we acknowledge some limitations of our method. While our algorithm is\\nwell suited for animating large numbers of homogeneous grass blades, it focuses on the\\naggregate behaviors, such as wind-induced swaying, and therefore may not be appropriate\\nfor real-world physics-based animation, which would require a physics-based simulation\\ntechnique. Another drawback of our method is 2D wind dynamics. Our proposed grass\\ndeformation is based on a 2D fluid simulation. Therefore, it is impossible to reproduce\\ncertain 3D fluid behaviors, such as the three-dimensional vortex observed in the real world.\\nHowever, we believe that the 3D deformation can be approximated with the 2D simulation\\nwith simple quadratic equations that we proposed.\\nAlso, our method did not take into account collisions between grass blades. To solve\\nthis problem, a more complex calculation method is needed. If our quadratic equation\\nis to reflect the deformation of the adjacent grass blades, the collision information can be\\nFigure 11. Two winds are changing direction over time after bending. (a) has been changed to (b).\\nTable 2. Performance metrics of grass simulation.\\nGrass Count\\nWind\\nSimulation (ms)\\nGrass\\nSimulation (ms)\\nGrass Shadow (ms)\\nGrass Rendering (ms)\\nFPS\\n1,000,000\\n5.9\\n0.1\\n0.1\\n3.3\\n87\\n2,000,000\\n5.9\\n0.1\\n0.1\\n7.5\\n69\\n3,000,000\\n5.9\\n0.1\\n0.1\\n11.4\\n51\\n4,000,000\\n5.9\\n0.3\\n0.2\\n15.6\\n42\\n5,000,000\\n5.9\\n0.6\\n0.4\\n19.4\\n36\\n6,000,000\\n5.9\\n0.7\\n0.5\\n23.2\\n32\\n7,000,000\\n5.9\\n0.7\\n0.5\\n27.4\\n29\\n5. Conclusions\\nIn this paper, we presented CWD-Sim, a real-time simulation algorithm for grass\\ndeformation and wind dynamic control in complex scenes. Our algorithm is capable of\\nnaturally simulating the effects of wind on grasses while allowing designers to have control\\nover the wind flow in complex scenes with obstacles or other structures. By grouping\\ngrass blades and simplifying the force calculation, our algorithm significantly reduces\\ncomputational load and achieves faster and more efficient simulations. Our method also\\nallows for grass-model variation and efficient shadowing, which further enhances the\\nrealism of the simulation.\\nHowever, we acknowledge some limitations of our method. While our algorithm is\\nwell suited for animating large numbers of homogeneous grass blades, it focuses on the\\naggregate behaviors, such as wind-induced swaying, and therefore may not be appropriate\\nfor real-world physics-based animation, which would require a physics-based simulation\\ntechnique. Another drawback of our method is 2D wind dynamics. Our proposed grass\\ndeformation is based on a 2D fluid simulation. Therefore, it is impossible to reproduce\\ncertain 3D fluid behaviors, such as the three-dimensional vortex observed in the real world.\\nHowever, we believe that the 3D deformation can be approximated with the 2D simulation\\nwith simple quadratic equations that we proposed.\\nAlso, our method did not take into account collisions between grass blades. To solve\\nthis problem, a more complex calculation method is needed. If our quadratic equation\\nis to reflect the deformation of the adjacent grass blades, the collision information can be\\nextracted and used. We will need to discuss this further in the future to incorporate the\\ncollision of many grasses into our processing simulations.\\nAccording to experiments, our methods appeared a little slower than certain prior\\nmethods such as [6] in performance, which had 43.5 fps for 50,000 grass blades compared to\\nour 35 fps. However, our method did not downgrade much in performance as the number\\nof blades increased. For example, while the [6] drops to 15.9 fps at 200,000 blades, our\\nmethod maintains a frame rate of 28 fps even with 500,000 blades as shown in Figure 9,\\nshowing its advantage in large-scale simulations.\\nAdditionally, we have also conducted experiments on the latest hardware specification\\nand can see that it shows excellent real-time performance at 29 fps at 7,000,000 of grass\\ncount as shown in Table 2.\\n\\n\\nAppl. Sci. 2024, 14, 548\\n13 of 14\\nIn future research, we would like to incorporate level of detail (LOD) and culling\\ntechniques for optimization and complement them with different types of models, such as\\nflowers, and different types of grasses.\\nIn the course of our current experiments, we have encountered a challenge in simulat-\\ning the effects of strong winds on grass blades. We found that too much wind can cause\\ngrass blades to become too dark and flat. Although allowing the user to adjust the wind\\nstrength could potentially mitigate this problem, it could also lead to tedious control by the\\nuser. An alternative approach was considered instead, such as limiting the maximum wind\\nstrength, but this may cause the grass blades to appear unnaturally rigid. We also carried\\nout an experiment with interpolation methods to smoothly limit the wind intensity, but\\nthis did not effectively solve the problem in the cases of very strong winds. Furthermore,\\nour attempts to use periodic functions such as cosine and sine to maintain constant motion\\nin grass blades were not successful, either. Identifying and solving this problem represents\\na significant opportunity for future research, as it is critical to achieving more realistic and\\ndynamic simulations of natural environments.\\nSupplementary Materials: The following supporting information can be downloaded at: https:\\n//www.mdpi.com/article/10.3390/app14020548/s1.\\nAuthor Contributions: Conceptualization and methodology, N.C. and M.S.; software, N.C.; valida-\\ntion, N.C. and M.S.; formal analysis, N.C. and M.S.; investigation, N.C.; resources, N.C. and M.S.;\\ndata curation, N.C.; writing—original draft preparation, N.C. and M.S.; writing—review and editing,\\nN.C. and M.S.; visualization, N.C.; supervision, M.S.; project administration, M.S. All authors have\\nread and agreed to the published version of the manuscript.\\nFunding: This work was supported by the National Research Foundation of Korea (NRF) grant\\nfunded by the Korea government (MSIT) (No. 2021R1A2C1012316) and was supported 2023 Cultural\\nHeritage Smart Preservation & Utilization R&D Program by Cultural Heritage Administration,\\nNational Research Institute of Cultural Heritage (Project Name: A smart H-BIM modeling technology\\nof wooden architecture for the conservation of Historical and Cultural Environment, Project Number:\\n2023A02P01-001, Contribution Rate: 50%).\\nInstitutional Review Board Statement: Not applicable.\\nInformed Consent Statement: Not applicable.\\nData Availability Statement: Data is contained within the article or Supplementary Materials.\\nConflicts of Interest: The authors declare no conflicts of interest.\\nReferences\\n1.\\nStam, J. Stable fluids. In Proceedings of the 26th Annual Conference on Computer Graphics and Interactive Techniques,\\nLos Angeles, CA, USA, 8–13 August 1999; pp. 121–128.\\n2.\\nHarris, M.J. Fast Fluid Dynamics Simulation on the GPU. GPU Gems. 2005; Chapter 38. Available online: https://developer.\\nnvidia.com/sites/all/modules/custom/gpugems/books/GPUGems/gpugems_ch38.html (accessed on 12 April 2023).\\n3.\\nDobryakov, P. WebGL Fluid Simulation.\\nAvailable online: https://github.com/PavelDoGreat/WebGL-Fluid-Simulation\\n(accessed on 12 April 2023).\\n4.\\nhaxiomic. Cross-Platform GPU Fluid Simulation. Available online: https://github.com/haxiomic/GPU-Fluid-Experiments\\n(accessed on 12 April 2023).\\n5.\\nangeluriot.\\n2D Fluid Simulation.\\nAvailable online: https://github.com/angeluriot/2D_fluid_simulation (accessed on\\n12 April 2023).\\n6.\\nLo, Y.; Chu, H.K.; Lee, R.R.; Chang, C.F. A simulation on grass swaying with dynamic wind force. In Proceedings of the 20th\\nACM SIGGRAPH Symposium on Interactive 3D Graphics and Games, Redmond, DC, USA, 27–28 February 2016; p. 181.\\n7.\\nBoulanger, K.; Pattanaik, S.N.; Bouatouch, K. Rendering Grass in Real Time with Dynamic Lighting. IEEE Comput. Graph. Appl.\\n2009, 29, 32–41. [CrossRef] [PubMed]\\n8.\\nDeussen, O.; Hanrahan, P.; Lintermann, B.; Mˇ\\nech, R.; Pharr, M.; Prusinkiewicz, P. Realistic modeling and rendering of plant\\necosystems. In Proceedings of the 25th Annual Conference on Computer Graphics and Interactive Techniques, Orlando, FL, USA,\\n19–24 July 1998; pp. 275–286.\\n9.\\nHabel, R. Real-Time Rendering and Animation of Vegetation. Ph.D. Thesis, Technischen Universität Wien, Vienna, Austria, 2010.\\n\\n\\nAppl. Sci. 2024, 14, 548\\n14 of 14\\n10.\\nChen, K.; Johan, H. Animating 3D vegetation in real-time using a 2D approach. In Proceedings of the 19th Symposium on\\nInteractive 3D Graphics and Games, San Francisco, CA, USA, 27 February–1 March 2015; pp. 69–76.\\n11.\\nQiu, H.; Chen, L. Rendering System for Large-Scale Grass. In Proceedings of the 2009 International Conference on Computational\\nIntelligence and Software Engineering, Wuhan, China, 11–13 December 2009; pp. 1–4. [CrossRef]\\n12.\\nMax, N.; Saito, S.; Watanabe, K.; Nakajima, M. Rendering grass blowing in the wind with global illumination. Tsinghua Sci.\\nTechnol. 2010, 15, 133–137. [CrossRef]\\n13.\\nFan, Z.; Li, H.; Hillesland, K.; Sheng, B. Simulation and Rendering for Millions of Grass Blades. In Proceedings of the 19th\\nSymposium on Interactive 3D Graphics and Games, i3D ’15, San Francisco, CA, USA, 27 February–1 March 2015; pp. 55–60.\\n[CrossRef]\\n14.\\nWang, S.; Ali, S.G.; Lu, P.; Li, Z.; Yang, P.; Sheng, B.; Mao, L. GPU-based Grass Simulation with Accurate Blade Reconstruc-\\ntion. In Proceedings of the Advances in Computer Graphics: 37th Computer Graphics International Conference, CGI 2020,\\nGeneva, Switzerland, 20–23 October 2020; pp. 288–300.\\n15.\\nJahrmann, K.; Wimmer, M. Interactive Grass Rendering Using Real-Time Tessellation. In WSCG 2013 Full Paper Proceedings;\\nTU Wien: Vienna, Austria, 2013.\\n16.\\nBakay, B.; Lalonde, P.; Heidrich, W. Real-Time Animated Grass. In Eurographics (Short Presentations); TU Wien: Vienna, Austria,\\n2002.\\n17.\\nJens, O.; Salama, C.R.; Kolb, A. GPU-based responsive grass. J. WSCG 2009, 17, 65–72.\\n18.\\nBelyaev, S.Y.; Laevsky, I.; Chukanov, V.V. Real-Time Animation, Collision and Rendering of Grassland. In Proceedings of the\\nGraphiCon2011, Moscow, Russia, 26–30 September 2011.\\n19.\\nJoeyDeVries. LearnOpenGL-Instancing. Available online: https://github.com/JoeyDeVries/LearnOpenGL/tree/master/src/\\n4.advanced_opengl/10.1.instancing_quads (accessed on 12 April 2023).\\n20.\\nDobryakov, P. NURBS Demo-Evaluator for Non Uniform Rational B-Splines. Available online: http://nurbscalculator.in (accessed\\non 12 April 2023).\\nDisclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual\\nauthor(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to\\npeople or property resulting from any ideas, methods, instructions or products referred to in the content.\",\"difficulty\":\"hard\",\"domain\":\"Multi-Document QA\",\"length\":\"short\",\"question\":\"These are two articles about grassland simulation. The first article is \\\"Responsive Real Time Grass Rendering for General 3D Scenes\\\", and the second article is \\\"CWD Sim: Real Time Simulation on Grass Swaying with Controllable Wind Dynamics”. Which of the following statements regarding the differences in content between the two articles is incorrect?\",\"sub_domain\":\"Academic\"}","display_format":"text","language":"","answer_status":"published","assets":[],"source_url":"https://huggingface.co/datasets/zai-org/LongBench-v2","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}