A dynamic vegetation rendering method, system, device, and medium

CN122530401APending Publication Date: 2026-08-07SHANGHAI ZHULONG INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI ZHULONG INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-05-08
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

结合Nanite技术后,三角面数量不再成为渲染性能的瓶颈,但全实体面建模直接导致数据体积的爆炸式增长,例如一株结构精细的树木可能包含数百万甚至数千万三角面,不仅使游戏包体急剧膨胀,更对存储系统的输入输出带宽构成严峻挑战

Benefits of technology

[0023]上述的一种动态植被渲染方法、系统、设备及介质,通过将植被拆解为多个组件并构建骨骼系统,将运动驱动从传统的顶点动画转换为骨骼蒙皮;在此基础上,将骨骼影响信息和风动响应参数组编码至纹理坐标通道,生成通用场景描述格式资产,进而转化为骨骼程序集资产,实现了资产体积的大幅缩减和运动数据的预结构化;在运行时,通过将交互区的物理参数打包至第一缓冲区,并将全局风场向量场作为输入,在图形处理器中为每块骨骼求解运动方程,生成蒙皮矩阵并写入第二缓冲区,从而将海量植被实例的动画计算从中央处理器卸载至图形处理器并行执行;最后根据骨骼索引从第二缓冲区中提取蒙皮矩阵对顶点进行蒙皮变换,完成渲染,由此解决了传统遮罩方案导致的过度绘制问题、顶点动画方案导致的包围盒膨胀和中央处理器负载过高问题,以及全实体面建模导致的文件体积过大问题,实现了大规模高精度植被场景的高性能动态渲染。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122530401A_ABST
    Figure CN122530401A_ABST
Patent Text Reader

Abstract

The application relates to a dynamic vegetation rendering method, system, device and medium. The method disassembles vegetation into components and constructs a skeleton system, converts motion driving from vertex animation into skinning, encodes skeleton influence information and wind motion parameters into a texture coordinate channel, generates a general scene description format asset and combines the asset into a skeleton program set asset to realize asset volume reduction, packs interactive area parameters into a first buffer at runtime, combines a global wind field, solves a motion equation for each piece of skeleton in a graphics processor to generate a skinning matrix and write the skinning matrix into a second buffer, offloads animation calculation from a central processing unit to the graphics processor for parallel execution, extracts the skinning matrix according to a skeleton index to perform skinning transformation on a vertex, solves problems of excessive drawing caused by a mask, bounding box expansion caused by vertex animation, excessively high central processing unit load and excessively large file volume caused by full solid modeling, and realizes high-performance dynamic rendering of large-scale high-precision vegetation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of real-time rendering technology, and in particular relates to a dynamic vegetation rendering method, system, device and medium. Background Technology

[0002] In the fields of real-time rendering and video games, constructing large-scale, high-precision natural scenes has always been a core pursuit of technological development. Vegetation, as the largest and most complex element in open worlds, directly impacts the immersion of the virtual world through its realistic rendering and dynamic performance. Currently, mainstream vegetation rendering solutions typically combine masking techniques with vertex animation: masking techniques draw the complex outlines of vegetation through transparency testing, while vertex animation simulates wind swaying by changing vertex positions. However, with the advent of micropolygon rendering technology, especially after Unreal Engine adopted Nanite virtual geometry technology, this traditional combination has revealed fundamental performance deficiencies.

[0003] Masking techniques can lead to severe overdraw issues when rendering vegetation. When rendering trees composed of intersecting facets, depth testing cannot completely cull masked pixels before the pixel shader executes, causing the same pixel on the screen to undergo shading calculations multiple times, with only one result being used. The higher the vegetation density on the screen, the more severe this inefficient shading calculation becomes, resulting in significant performance waste in the graphics pipeline and directly limiting the amount of vegetation that can be rendered simultaneously in a scene.

[0004] Vertex animation technology brings a double performance penalty. On the one hand, vertex animation forces the model's axial bounding box to expand significantly to reserve space for the maximum displacement of vertices, causing a large number of objects that should be outside the view frustum to be incorrectly judged as visible and sent into the rendering pipeline; on the other hand, vertex animation itself means that massive amounts of vertex data need to be updated and transformed every frame. When tens of thousands of vegetation instances in the scene are animated at the same time, the instruction overhead of the central processing unit and the vertex shading computation overhead of the graphics processing unit both increase sharply.

[0005] To alleviate over-rendering issues, the industry tends to adopt full solid-face vegetation modeling, which involves constructing complete, thick 3D models. With Nanite technology, the number of triangles is no longer a bottleneck for rendering performance. However, full solid-face modeling directly leads to an explosive increase in data volume. For example, a finely structured tree may contain millions or even tens of millions of triangles, not only causing a dramatic increase in game file size but also posing a severe challenge to the input / output bandwidth of the storage system. Furthermore, modern games place higher demands on real-time interaction between vegetation and characters. In traditional instantiated rendering systems, performing interaction detection and skeletal animation updates on thousands of instances one by one quickly exhausts central processing unit resources, making it difficult to achieve fine, dynamic local physical feedback. Summary of the Invention

[0006] Therefore, it is necessary to provide a dynamic vegetation rendering method, system, device, and medium to address the aforementioned technical problems.

[0007] Firstly, this application provides a dynamic vegetation rendering method, including:

[0008] S1. Decompose the full solid surface mesh of vegetation into multiple components, construct a skeleton system for each component and define attachment point information;

[0009] S2. Based on the hierarchical relationship of the skeletal system, transform the vertices of each component to the bound pose space to generate a base mesh; assign bone influence information to the vertices of the base mesh, and encode the wind response parameter group defined in the attachment point information to the texture coordinate channel of the base mesh to generate a general scene description format asset carrying bone influence information and wind response parameter group;

[0010] S3. Import the general scene description format asset into the rendering engine, generate bone mesh data based on the bone influence information carried in the general scene description format asset, generate runtime parameters based on the wind response parameter group carried in the general scene description format asset, and combine the bone mesh data and runtime parameters into a bone assembly asset.

[0011] S4. Detect the interaction area that overlaps with the vegetation instance, pack the physical parameters of the interaction area into the first buffer, and upload the global wind field vector field on the scene terrain to the graphics processor.

[0012] S5. In the computation shader of the graphics processor, based on the global wind field vector field, the physical parameters in the first buffer, and the skeleton assembly assets, solve the motion equation for each bone of each vegetation instance to generate a skinning matrix; write the skinning matrix into the second buffer.

[0013] S6. In the vertex shader of the graphics processor, the corresponding skinning matrix is ​​extracted from the second buffer based on the bone index stored in the vertex data of the bone mesh data in the bone assembly asset; the skinning transformation is performed on the vertex data according to the skinning matrix to obtain the transformed vertex position, and the transformed vertex position is rendered.

[0014] Secondly, this application also provides a dynamic vegetation rendering system for implementing the method described in the first aspect, the system comprising:

[0015] The vegetation structure initialization module is used to decompose the full solid surface mesh of vegetation into multiple components, build a skeleton system for each component and define attachment point information;

[0016] The feature parameter mapping module is used to transform the vertices of each component to the bound pose space according to the hierarchical relationship of the skeleton system to generate a base mesh; it assigns bone influence information to the vertices of the base mesh and encodes the wind response parameter group defined in the attachment point information to the texture coordinate channel of the base mesh to generate a general scene description format asset carrying bone influence information and wind response parameter group;

[0017] The asset compositing optimization module is used to import general scene description format assets into the rendering engine, generate skeletal mesh data based on the skeletal influence information carried in the general scene description format assets, generate runtime parameters based on the wind response parameter group carried in the general scene description format assets, and combine the skeletal mesh data and runtime parameters into a skeletal assembly asset.

[0018] The interaction impact detection module is used to detect the interaction area that overlaps with the vegetation instance, pack the physical parameters of the interaction area into the first buffer, and upload the global wind field vector field on the scene terrain to the graphics processor.

[0019] The dynamic motion solver module is used to solve the motion equations for each bone of each vegetation instance in the compute shader of the graphics processor, based on the global wind field vector field, the physical parameters in the first buffer, and the skeleton assembly assets, and generate the skin matrix; and write the skin matrix into the second buffer.

[0020] The rendering execution output module is used to extract the corresponding skinning matrix from the second buffer in the vertex shader of the graphics processor based on the bone index stored in the vertex data of the bone mesh data in the bone assembly asset; perform skinning transformation on the vertex data according to the skinning matrix to obtain the transformed vertex position, and render the transformed vertex position.

[0021] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement a dynamic vegetation rendering method as described in the first aspect.

[0022] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a dynamic vegetation rendering method as described in the first aspect.

[0023] The aforementioned dynamic vegetation rendering method, system, device, and medium decompose vegetation into multiple components and construct a skeletal system, transforming motion-driven animation from traditional vertex animation to skeletal skinning. Based on this, skeletal influence information and wind response parameters are encoded into texture coordinate channels to generate a general scene description format asset, which is then transformed into a skeletal assembly asset, achieving a significant reduction in asset size and pre-structuring of motion data. At runtime, by packaging the physical parameters of the interaction area into a first buffer and using the global wind field vector as input, motion equations are solved for each bone in the graphics processor, generating a skinning matrix and writing it into a second buffer. This offloads the animation calculation of massive vegetation instances from the central processing unit to the graphics processor for parallel execution. Finally, the skinning matrix is ​​extracted from the second buffer based on the bone index to perform skinning transformation on the vertices, completing the rendering. This solves the overdraw problem caused by traditional masking schemes, the bounding box inflation and excessive central processing unit load caused by vertex animation schemes, and the excessively large file size caused by full solid surface modeling, achieving high-performance dynamic rendering of large-scale, high-precision vegetation scenes. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 A flowchart illustrating a dynamic vegetation rendering method provided by the present invention;

[0026] Figure 2 This is a schematic diagram of the process of generating a skin matrix in one optional embodiment of the present invention;

[0027] Figure 3 This is a schematic diagram of the structure of a dynamic vegetation rendering system provided by the present invention. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0029] refer to Figure 1 The document presents a flowchart illustrating a dynamic vegetation rendering method provided in this application, which includes the following steps:

[0030] S1. Decompose the full solid surface mesh of vegetation into multiple components, construct a skeleton system for each component and define attachment point information.

[0031] Specifically, the full solid surface mesh is a vegetation mesh with three-dimensional spatial thickness built based on Nanite virtual geometry technology, without transparency masking. The decomposition process adopts a two-dimensional decomposition principle of structural correlation and motion independence. Through the mesh decomposition plugin of the 3D modeling software, a hybrid decomposition of automatic recognition and manual calibration is achieved, which decomposes the complete vegetation mesh into independent components such as tree trunks, main branches, lateral branches, leaf clusters, and flower clusters. Among them, geometric surfaces with strong motion correlation are grouped into the same component, which not only ensures the structural coordination during vegetation movement, but also realizes the standardized reuse of components, effectively reducing the file size expansion problem caused by full solid surface modeling.

[0032] For each disassembled component, a hierarchical skeleton system is constructed based on its geometric topology and motion requirements related to wind and interaction. The hierarchical relationship of the skeleton system follows the natural growth structure of vegetation, exhibiting a tree-like hierarchical distribution. The number of levels from the root skeleton to the terminal skeleton is positively correlated with the component's motion precision. The initial position, rotation angle, and scaling ratio of the skeleton are pre-calculated and aligned with the component's mesh vertices using skinning weights. The spatial coordinates of the skeleton are mapped to the component's local coordinate system, ensuring that the relative position of the skeleton and the mesh is fixed.

[0033] After the skeletal system is constructed, standardized attachment point information is defined for each component. Attachment points are precise connection nodes between components and serve as the basis for subsequent vegetation instance assembly. This information includes spatial 3D coordinates, normal vectors, parent component bone index, child component bone binding index, and assembly constraint parameters. The spatial coordinates are mapped to the corresponding bone's local binding coordinate system. Assembly constraint parameters include assembly rotation range, scaling threshold, and fitting error threshold, ensuring that different components, after assembly through attachment points, conform to the natural morphology of the vegetation without structural offset or distortion. Attachment point information is parameterized using a custom modeling plugin. This plugin automatically extracts the geometric connection feature points of components, generates a structured attachment point parameter set, and stores it as binary data that can be parsed by a common scene description format. Simultaneously, the attachment point information is linked hierarchically with the skeletal system to ensure skeletal spatial consistency during component assembly.

[0034] S2. Based on the hierarchical relationship of the skeletal system, transform the vertices of each component to the bound pose space to generate a base mesh. Assign bone influence information to the vertices of the base mesh and encode the wind response parameter group defined in the attachment point information to the texture coordinate channel of the base mesh to generate a general scene description format asset carrying bone influence information and wind response parameter group.

[0035] Specifically, the rigging pose space is the local coordinate system of the skeleton in its initial rigging state. The core purpose of transforming component vertices to this space is to eliminate the spatial offset of the skeleton's initial pose, fixing the relative positions of the vertices and the skeleton, and providing a unified coordinate reference for subsequent skinning transformations. The transformation process is a matrix transformation across multiple coordinate systems. For any vertex V in the component, its coordinates in the rigging pose space are calculated using the following formula: .in Let be the coordinates of the vertex in the bound pose space. This is the inverse matrix of the skeleton's pose, used to counteract the influence of the initial skeleton pose on the vertex coordinates. The model matrix of the component is used to transform vertices from the model coordinate system to the world coordinate system. These are the world coordinates of the vertices, used to represent the spatial position of the vertices in the scene world. During transformation, matrix operations are performed sequentially from parent node to child node according to the bone hierarchy. After completion, the mesh is topologically optimized. Redundant vertices are removed by vertex fusion, mesh topological breaks are repaired, and a standardized basic mesh containing position, normal vector, tangent space vector, and basic texture coordinates is generated.

[0036] After the basic mesh is generated, bone influence information is assigned to each vertex. This information serves as the basis for the association between vertices and bones, including a list of bone indices affecting the vertex and their corresponding skinning weight values. The assignment process employs a distance-weighted method and a smooth interpolation algorithm. Skinning weights are calculated based on the spatial Euclidean distance and geometric affinity between the vertex and bones, while adhering to the sparsity principle to limit the influence of each vertex on a finite number of bones, minimizing subsequent computational overhead while ensuring smooth motion. After the skinning weights are calculated, they are normalized to ensure that the sum of all skinning weights for a single vertex is 1. The normalization formula is as follows: ,in Here, n is the skinning weight value of the i-th bone to the vertex, and n is the number of bones affecting the vertex. This normalization process can avoid vertex position distortion in subsequent skinning transformations. The bone influence information is finally stored in the custom vertex attributes of the base mesh, which correspond one-to-one with the vertex data to form bone-vertex association data that can be recognized by the rendering engine.

[0037] The wind response parameter set comprises the differentiated response characteristics of vegetation components to wind fields. It includes core dimensions such as skeleton stiffness coefficient, resilience coefficient, bending angle threshold, wind frequency, and damping coefficient. The parameter sets for different components are set differently according to their motion characteristics. When encoding this parameter set into the texture coordinate channel of the basic mesh, each parameter must first be normalized, linearly mapping the actual value range of the parameters to the standard numerical range [0,1] of the texture coordinates. The normalization formula is as follows: ,in For the normalized quantized value of the parameter, For the actual value of the parameter, This is the minimum preset value for the parameter. This represents the maximum preset value for the parameters. After normalization, a floating-point data quantization and packaging strategy is adopted, allocating and packaging multi-dimensional parameters according to the bit width of the texture coordinate additional channels. The quantization error is controlled within a preset range to ensure the accuracy of subsequent parameter parsing. The encoding process is implemented through a custom shader, which deeply binds the parameter values ​​to the texture coordinate channel data, allowing the parameters to be synchronously accessed along with the mesh vertex data.

[0038] The preferred format for generating general scene description assets is USD format. This format has cross-engine parsing capability and scene-level organization capability. During the generation process, the geometric data of the basic mesh, the skeleton influence information, the encoded wind response parameter group, and the attachment point information are organized according to the scene node structure of USD. The hierarchical relationship of the skeleton system is stored as the skeleton level node of USD, the basic mesh is stored as the geometric node, the vertex custom attributes and texture coordinate encoding parameters are the additional attributes of the geometric node, and the attachment point information is stored as the associated parameters of the reference node. The final generated USD asset contains all the core information of the vegetation component, including geometry, skeleton, wind, and assembly, and has completed the standardization and lightweight processing of data.

[0039] S3. Import the general scene description format asset into the rendering engine, generate skeletal mesh data based on the skeletal influence information carried in the general scene description format asset, generate runtime parameters based on the wind response parameter group carried in the general scene description format asset, and combine the skeletal mesh data and runtime parameters into a skeletal assembly asset.

[0040] Specifically, this step involves adapting and converting assets from a general format to the rendering engine's native format, providing asset data that the engine can directly call for subsequent real-time rendering. The preferred rendering engine is Unreal Engine, which integrates Nanite virtual geometry technology, natively supports skeletal mesh rendering and large-scale instantiation rendering, and is adapted to the micro-polygon optimization features of Nanite technology.

[0041] The asset import process is implemented through a custom USD parsing plugin for the engine. This plugin has complete USD format node recognition and data extraction capabilities. It can automatically parse skeleton-level nodes, geometric nodes, vertex custom attributes, and texture coordinate encoding parameters in USD assets. At the same time, it completes format adaptation and conversion, converting USD geometric data into the engine's native triangular mesh data format and skeleton-level data into the engine's skeletal data format. During the import process, a multi-dimensional data validity verification mechanism is set up to automatically remove invalid vertex data, out-of-range skeletal indexes, and abnormal parameter values ​​to ensure the integrity and correctness of the imported data. In response to the performance requirements of large-scale vegetation rendering, the mesh data will also undergo preliminary view frustum clipping optimization during import to remove geometric face sets that have no rendering significance.

[0042] The generation of skeletal mesh data is based on the bone influence information in USD assets. It deeply correlates the vertex data of the basic mesh with bone indexes and skinning weights to generate Skeletal Mesh data recognizable by the rendering engine. This data includes four core modules: mesh topology, vertex attribute sets, bone binding information, and skinning weight table. Simultaneously, Nanite technology is used to optimize the skeletal mesh data through micro-polygonal hierarchical processing. The triangular faces of the mesh are divided into blocks according to view distance accuracy requirements, generating multi-level Nanite mesh data. This allows the mesh to dynamically adjust rendering accuracy at different view distances, balancing rendering realism and performance. The skeletal mesh data is ultimately stored in the engine's native binary format, optimizing data memory read and retrieval efficiency, while also supporting memory-resident storage to ensure fast access by the graphics processor.

[0043] The core of generating runtime parameters is to complete the inverse normalization analysis of the wind response parameter set. After extracting the encoded quantized parameter values ​​from the texture coordinate channels of the basic mesh, the quantized values ​​in the [0,1] interval are restored to the actual values ​​of the parameters using the inverse normalization formula, which is as follows: .in These are the actual values ​​of the parameters, used for solving the subsequent skeletal motion equations. These are the normalized quantized values ​​extracted from the texture coordinate channels. and The preset value range for the parameters is consistent with the value range used in the normalization process to ensure the accuracy of parameter restoration.

[0044] After parsing, the wind response parameters are structured and organized, generating runtime parameter tables according to bone hierarchy and component type. These tables contain the wind response parameters for each bone, and a visual adjustment interface is provided in the engine editor panel to allow real-time adjustment of parameter values ​​within the engine to optimize wind simulation effects. Runtime parameters are stored in a structured buffer residing in video memory, with address mapping based on bone indexes to ensure fast random access by the graphics processor.

[0045] The skeletal assembly asset is the final product of this step and the core asset for vegetation rendering. Its assembly process involves uniquely binding the generated skeletal mesh data with the runtime parameter table, while integrating component assembly information. Based on the attachment point information in the USD asset, standardized assembly rules between components are defined, allowing multiple components to be quickly assembled into a complete vegetation instance through instantiation within the engine. The core feature of this asset is component reuse; the skeletal assembly of the same component can be called by a large number of vegetation instances in the scene without repeatedly storing mesh, skeleton, and parameter data. This significantly reduces the storage size of vegetation assets and completely solves the file size expansion problem caused by full solid surface modeling. The skeletal assembly asset is ultimately stored in the engine's native asset format, supporting batch instantiation loading and dynamic parameter updates, providing a foundation for rendering large-scale vegetation scenes.

[0046] S4. Detect the interaction area that overlaps with the vegetation instance, pack the physical parameters of the interaction area into the first buffer, and upload the global wind field vector field on the scene terrain to the graphics processor.

[0047] Specifically, this step is the preliminary data preparation stage for realizing the dynamic response of vegetation, providing real-time external force data for subsequent skeleton motion solving on the graphics processing unit (GPU). All data processing in this step follows the principle of CPU pre-computation and high-speed GPU access, minimizing data transfer overhead between the CPU and GPU and improving real-time rendering efficiency.

[0048] The interaction zone detection is based on the rendering engine's spatial partitioning collision detection system, employing an octree spatial partitioning algorithm combined with hierarchical bounding box detection. First, view frustum pruning is used to quickly remove vegetation instances far from the interaction source, reducing invalid detections. Then, refined collision detection is performed on the remaining vegetation instances. The interaction zone is defined as the spatial overlap area between the collider of the interaction source and the skeletal mesh of the vegetation instance. The detection process performs collision judgment at the skeletal level of the vegetation instance, i.e., detecting collisions between the interaction source and components such as the trunk, branches, and leaves of the vegetation instance, accurately determining the overlap area of ​​each component, and recording physical characteristics such as the type, speed, collision force, and direction of the interaction source. To balance detection accuracy and performance, a multi-precision collider adaptation strategy is adopted, using colliders of different precision for interactions at different distances. The collision detection results are structured and stored using the unique identifier of the vegetation instance and the skeletal index as keys, accurately mapping the specific skeleton affected by the interaction.

[0049] The extraction of physical parameters in the interaction area is based on collision detection results. The core parameters extracted include the spatial three-dimensional coordinates of the collision location, the motion vector of the interaction source, the collision force coefficient, the interaction influence radius, the physical attenuation coefficient, and the skeleton influence weight. The skeleton influence weight is calculated using an exponential decay algorithm, decreasing exponentially with increasing spatial distance from the collision point. Its calculation formula is as follows: .in The influence weights for skeletons are used to characterize the degree of influence of interactive forces on that skeleton. The base weights are the initial influence weights of the bones at the collision point. This is the attenuation coefficient, used to adjust the rate at which the weights decay. The Euclidean distance between the skeleton and the collision point is used to measure the spatial positional relationship between the skeleton and the collision source. This algorithm ensures the physical realism of the interaction effects, meaning that bones near the collision point are greatly affected, while the effect on bones farther away from the collision point gradually decays to zero.

[0050] After the physical parameters are extracted, they are structured according to the two-dimensional indexing rule of unique vegetation instance identifier - skeleton index. Then, the structured physical parameters are packaged into the first buffer through the underlying API of the graphics processor. The first buffer is preferably the unified buffer or storage buffer of the graphics processor, which uses continuous floating-point memory address storage to support random fast access of the graphics processor. At the same time, an incremental update mechanism is set for the buffer, which updates the buffer data only when the position, intensity, and influence range of the interaction area change, thus avoiding invalid data transmission between the central processing unit and the graphics processor.

[0051] The global wind field vector field is a three-dimensional vector data describing the wind direction, speed, and frequency at different spatial locations on the scene's terrain. It is generated using a wind field simulation algorithm based on fluid dynamics, incorporating geographical features such as height, slope, and obstructions to calculate wind field disturbances. Furthermore, a dynamic time dimension is added to the wind field vector field, simulating different wind effects such as gusts and light breezes using a sine function, giving the wind field natural dynamic characteristics. Its time-varying dynamic formula is as follows: .in, Let be the wind field vector at time t. This is the basic wind field vector, used to characterize the basic direction and speed of the wind field. This is the amplitude coefficient, used to adjust the fluctuation range of wind field intensity. Angular frequency, used to determine the frequency of wind field fluctuations. For time parameters, This is the initial phase, used to adjust the initial state of wind field fluctuations.

[0052] The generated global wind field vector field is a 3D sparse vector field, stored according to the scene's octree spatial partitioning. Each partition stores the wind field vector parameters for that region, reducing data storage requirements. The wind field vector field is uploaded to the graphics processor using a memory-mapped batch transfer method. After wind field calculations are completed in the central processing unit (CPU), the data is directly mapped to a specified address in the GPU's memory, eliminating the need for traditional copy transfers and significantly reducing data transfer overhead. The uploaded wind field vector field is stored as a texture buffer or structured buffer accessible to the GPU's compute shaders, with address mapping based on spatial partition indices. This ensures that wind field parameters at corresponding locations can be quickly extracted during subsequent skeleton motion solving.

[0053] S5. In the computation shader of the graphics processor, based on the global wind field vector field, the physical parameters in the first buffer, and the skeleton assembly assets, solve the motion equation for each bone of each vegetation instance to generate a skin matrix; write the skin matrix into the second buffer.

[0054] Specifically, this step is the core of realizing graphics processor-driven skeletal motion. It utilizes the parallel computing capabilities of the graphics processor to complete the motion solution of large-scale skeletons, replacing the vertex animation calculations on the traditional central processing unit, thus solving the performance overhead problem caused by vertex animation. The execution of the computation shader is decoupled from the vertex shading stage of the rendering pipeline and completed in an independent calculation stage, avoiding the occupation of vertex shading computational resources.

[0055] The task scheduling of the computation shader employs a grouped parallel computing strategy. The rendering engine divides the skeletal motion solving task into multiple computational workgroups based on the number of vegetation instances in the scene and the number of bones in a single vegetation stalk. Each workgroup is responsible for solving the skeletons of one or more vegetation instances, utilizing multiple computing cores of the graphics processor to achieve simultaneous parallel solving of large-scale skeletons. Simultaneously, a view distance priority scheduling mechanism is implemented for computational tasks, allocating more computing resources and using higher solution accuracy to near-distance vegetation instances that occupy a large portion of the screen space, while appropriately reducing solution accuracy for far-distance vegetation instances, maximizing the utilization of graphics processor computing resources while ensuring visual quality.

[0056] For each bone, a second-order ordinary differential equation of motion needs to be constructed by combining the wind dynamics of the global wind field, the physical forces in the interaction zone, and the physical properties of the bone itself. This equation is the core mathematical model describing the angular motion of the bone, and its core form is: .in, This is the equivalent mass of the skeleton, used to characterize the magnitude of its inertia. Angular acceleration of the skeleton, used to describe the rate of change of the skeleton's angular velocity. The damping coefficient, taken from the aerodynamic response parameter set, is used to characterize the damping resistance experienced by the skeleton during movement. Angular velocity of the bone, used to describe how fast and in what direction the bone rotates. This is the stiffness coefficient, which is positively correlated with the stiffness coefficient in the aerodynamic response parameter set. It is used to characterize the skeleton's ability to resist bending deformation. This represents the angular displacement of the bone, used to describe the rotation angle of the bone relative to its initial position. The force exerted by the wind on the skeleton is used to drive the skeleton to produce wind-induced swaying. This refers to the force exerted on the skeleton by interactive physics, which drives the skeleton to produce interactive response movements.

[0057] The wind field vector at the corresponding skeleton position in the global wind field vector field and the aerodynamic response parameters of the skeleton are obtained through quantitative calculation. The specific calculation formula is as follows: .in, The spatial location of the skeleton in the global wind field vector field. The wind field vector at the location is extracted through the wind field vector spatial partition index and contains information on the wind field direction and speed. is the unit normal vector along the axis of the bone, used to characterize the bone's growth direction; its value is determined by the bone's initial orientation in the rigging pose space. " is the vector dot product operation, used to calculate the cosine of the angle between the wind field vector and the axial normal vector of the skeleton, and thus determine the direction of the effective force of the wind field on the skeleton. When the dot product is positive, the wind field produces a positive bending force on the skeleton; when the dot product is negative, it produces a reverse force; when the dot product is 0, the wind field has no effective force on the skeleton. This represents the aerodynamic coefficient of the skeleton, taken from the aerodynamic response parameter set. It is negatively correlated with the skeleton's stiffness coefficient; the smaller the stiffness coefficient, the better. The higher the value, the more sensitive the skeleton is to the wind field. The effective force-bearing area of ​​the skeleton is calculated from the geometric dimensions (length and thickness) of the skeleton. The thicker and longer the skeleton, the larger the effective force-bearing area, and the stronger the wind force on it. The wind damping coefficient of the skeleton is taken from the wind response parameter set. It is used to reduce the intensity of the wind force and prevent the skeleton from swaying excessively due to the wind. The larger the damping coefficient, the more significant the reduction of the wind force. This coefficient is calculated using this formula. As a vector force, its direction is consistent with the resultant direction of the axial normal vector of the skeleton and the wind field vector, and its magnitude comprehensively reflects the influence of wind field intensity and the skeleton's own characteristics on wind-driven response, ensuring the physical reality of wind-driven skeleton movement.

[0058] The calculation is obtained by combining the physical parameters in the first buffer with the hierarchical relationship of the skeleton through layered superposition. The specific calculation formula is as follows: .in, The basic collision force of the interaction source on the collision point skeleton is extracted from the physical parameters of the first buffer zone and is obtained by multiplying the collision force coefficient and the collision area. The larger the collision force coefficient and the larger the collision area, the stronger the basic collision force. The weights for the skeletal influence are calculated using the exponential decay algorithm. This is used to characterize the degree to which the bone is affected by collision interactions; The interaction response coefficient of the skeleton is set according to the hierarchical characteristics of the skeleton. The interaction response coefficient of the parent skeleton is greater than that of the child skeleton to ensure the rationality of the transmission of interaction force. This represents the number of layers from the current bone to the bone at the collision point. This is the interaction transfer weight of the j-th level parent bone. The value ranges from 0 to 1. The higher the level, the smaller the transfer weight. It is used to simulate the attenuation effect of interaction force between bone levels. That is, when the collision force is transferred from the collision point bone to its parent bone and then to the grandparent bone in sequence, the intensity of the force gradually decreases. This is the product of the interaction weights of each parent bone, used to calculate the total attenuation coefficient of collision force transmission between bone levels. For bones with hierarchical relationships, the motion of the parent bone serves as the initial motion condition for the child bone. The motion equation of the child bone needs to be superimposed with the displacement and rotation of the parent bone, i.e., the child bone's... The interaction force of the parent bone needs to be additionally superimposed, and the specific superposition formula is as follows: ,in The interaction forces of the sub-skeletons, The interaction forces of the parent skeleton, Weights are transferred between parent and child skeletons through this superposition calculation to ensure the coordination of bone-level movement and avoid structural disconnection.

[0059] Since the second-order ordinary differential equation has no analytical solution, a semi-implicit Euler method can be used for numerical solution. This method balances solution accuracy and computational efficiency, and is adapted to the parallel computing characteristics of graphics processors. The solution process is performed frame by frame according to the time step of the rendering frame. The numerical solution formula is as follows: .in, Let ω be the angular velocity of the skeleton at time t+1. Let be the angular velocity of the skeleton at time t. Let be the angular acceleration of the skeleton at time t. The time step for rendering frames. Let t+1 be the angular displacement of the skeleton. Let t be the angular displacement of the skeleton. Each frame first calculates the net external force on the skeleton based on the current wind force and interaction force, then solves for the angular acceleration of the skeleton using the net external force, and then updates the angular velocity and angular displacement of the skeleton accordingly.

[0060] A bending angle threshold constraint is incorporated into the solution process. When the angular displacement of the skeleton exceeds the threshold defined in the wind response parameter set, the stiffness coefficient is automatically increased. To limit excessive bending of the skeleton, ensure the naturalness of vegetation movement, and avoid abnormal swaying that violates the laws of physics, the solution results are smoothed using a moving average to remove abrupt changes in the movement and prevent jittering during skeletal movement. The smoothing formula is as follows: ,in This is the smoothed angular displacement. To smooth window size, Let t be the angular displacement of the bone at time ti.

[0061] The skinning matrix is ​​the core transformation matrix that maps the motion transformations of bones to the mesh vertices. For each bone whose motion state is solved, the transformation matrix in the world coordinate system is first calculated based on its angular displacement and angular velocity. This matrix includes translation, rotation, and scaling transformations, and is combined with the inverse matrix of the skeleton's rigging pose. The skin matrix is ​​calculated using the following formula: .in, The skinning matrix is ​​used to transform vertices from the bound pose space to the world space after skeletal motion. Let be the transformation matrix of the skeleton in the world coordinate system. This is the inverse matrix of the skeleton's pose. The function of this formula is to convert the world space motion transformation of the skeleton into a transformation that can be applied to the vertices of the pose space, providing a basis for subsequent vertex skinning transformations.

[0062] The skinning matrices are organized into a set according to a two-dimensional rule of unique vegetation instance identifier - bone index. This allows the skinning matrix corresponding to each bone of all vegetation instances in the scene to be stored with a unified index, forming a two-dimensional matrix set. The row index corresponds to the unique identifier of the vegetation instance, and the column index corresponds to the layer index of the bone, ensuring that the subsequent vertex shader can quickly extract the corresponding skinning matrix through the bone index. All skinning matrices are stored using 4×4 floating-point matrices to ensure the precision of transformations.

[0063] The second buffer is preferably a texture or structured buffer stored in the graphics processor, featuring high bandwidth and random access. Writing the skin matrix set is achieved through the graphics processor's memory operation instructions. The skin matrices are sequentially written to consecutive memory addresses in the buffer according to a two-dimensional indexing rule. Each 4×4 floating-point matrix occupies a fixed memory space, ensuring a one-to-one correspondence between the index and the memory address. After the writing process is complete, a synchronization flag is set for the second buffer to ensure that the data in the skin matrix set has been completely written when the vertex shader reads data, avoiding data reading errors or incompleteness.

[0064] S6. In the vertex shader of the graphics processor, the corresponding skinning matrix is ​​extracted from the second buffer based on the bone index stored in the vertex data of the bone mesh data in the bone assembly asset; the skinning transformation is performed on the vertex data according to the skinning matrix to obtain the transformed vertex position, and the transformed vertex position is rendered.

[0065] Specifically, this step is the final step in realizing the transformation of skeletal motion into the visual representation of vegetation mesh, in order to solve the over-drawing problem caused by traditional masking techniques and achieve large-scale, high-precision dynamic vegetation rendering.

[0066] The vertex shader is executed in a single-vertex, single-threaded parallel manner. The graphics processor allocates an independent vertex shader thread for each vertex to be rendered. Each thread reads the complete data of the corresponding vertex from the bone mesh data of the bone assembly asset, including the vertex's bound pose space coordinates, normals, tangents, bone index list, skinning weights, texture coordinates, and other core information. The bone index list corresponds one-to-one with the indices of the skinning matrix set in the second buffer. To improve the efficiency of vertex data reading, a multi-level caching strategy is adopted, caching frequently used vertex data in the graphics processor's high-speed cache to reduce direct access to video memory and lower memory access latency. At the same time, vertex data is read in blocks, leveraging the graphics processor's memory bandwidth advantage to improve data reading speed.

[0067] The skinning matrix extraction is based on direct index addressing using the vertex's bone index list. For each vertex, the corresponding memory address in the second buffer is directly accessed according to the bone index value in its bone index list to extract the corresponding 4×4 skinning matrix. The number of extracted skinning matrices is consistent with the number of bone influences of the vertex. A data validity verification mechanism is set during the extraction process to automatically remove invalid matrix data, ensuring the correctness of subsequent skinning transformations. The extracted skinning matrices are temporarily stored in the vertex shader's temporary register to prepare for skinning transformations.

[0068] Skinning transformation is the process of converting the bound pose space coordinates of vertices into coordinates in the world coordinate system after skeletal motion. It is achieved using a skinning weighted fusion method. For the bound pose space 3D coordinates of vertices, they are first expanded into homogeneous coordinates. In homogeneous coordinates, the w component is set to 1—the w component distinguishes between spatial points and vectors. Vertices are fixed points in space, and a w component of 1 ensures that translation, rotation, and scaling transformations of the skinning matrix apply correctly to vertex coordinates, avoiding coordinate distortion during transformation. Based on the extended homogeneous coordinates, the formula... Calculate the transformed world coordinates. Wherein, These are the world coordinates after the vertex transformation, used for subsequent rendering processing; The skin weight value of the i-th bone is used for weighted fusion of motion transformations of multiple bones; Let be the skinning matrix corresponding to the i-th bone, used to implement the motion transformation of that bone with respect to its vertices. Let the pose space homogeneous coordinates of the vertices be bound. To influence the number of bones at a vertex, this formula uses skinning weights to weight and fuse the motion transformations of multiple bones, resulting in a smooth transition between the vertex's motion and the bone motion, avoiding any discontinuities in vertex motion.

[0069] While performing skinning transformation on the vertex positions, the vertex normals and tangents are simultaneously transformed to ensure realistic lighting rendering of the vegetation surface. The transformation of the normals is achieved using the inverse of the skinning matrix, calculated using the following formula: .in, This is the transformed world coordinate system normal vector, used to ensure the accuracy of lighting calculations; This is the transpose of the skinning matrix. This is the inverse of the transpose matrix, used to correct the effect of skinning transformation on the direction of the normal vector. To bind the normal vectors in the pose space, this transformation ensures that the normal vectors remain perpendicular to the vegetation surface after the skeleton moves, thus avoiding problems such as distortion and light leakage in lighting rendering.

[0070] The vertex positions obtained after skinning transformation are in world coordinates. Further coordinate system transformation and view frustum clipping are then performed, first through the view matrix of the rendering engine. The formula for converting world coordinates to observation coordinates is as follows: ,in Let be the view coordinates of the vertex. This is the view matrix, used to convert the world coordinate system to a viewing coordinate system with the camera as the origin. These are the world coordinates of the vertices. Then, using the projection matrix... The conversion formula for transforming the observation coordinate system coordinates to the clipping coordinate system coordinates is as follows: ,in The coordinates of the vertex are in the clipping coordinate system. This is the projection matrix, used to convert the three-dimensional viewing space into a two-dimensional clipping space.

[0071] The clipping coordinate system coordinates are used for view frustum clipping, removing vertices outside the view frustum to reduce computational overhead in subsequent pixel shading stages. After clipping, perspective division is performed on the vertex coordinates to obtain normalized device coordinates, preparing for the rasterization stage. The final rendering of the transformed vertex positions follows the principles of Nanite micropolygon rendering and depth testing. The vertex data, after coordinate system transformation and clipping, is passed to the rasterization stage of the rendering pipeline. The rasterization stage converts the vertex data into pixel fragments in screen space, and then processes them through lighting calculations, texture sampling, and color blending in the pixel shader to generate the final pixel colors of the vegetation.

[0072] Leveraging Nanite's micro-polygon rendering capabilities, the rendering precision of the mesh is dynamically adjusted based on the screen-space pixel size of the vertices. Close-up vegetation is rendered with fine triangular facet details, while distant vegetation has its triangular faces merged to reduce rendering overhead. Simultaneously, depth testing and stencil testing are enabled during rendering. Depth testing culls occluded pixel fragments before the pixel shader executes, completely resolving the overdraw problem caused by traditional masking techniques, avoiding invalid shading calculations, and significantly improving rendering performance. Finally, through the rendering engine's output merging stage, the dynamic rendering results of vegetation are mixed with the rendering results of other elements in the scene and output to the screen, achieving large-scale, high-precision real-time dynamic vegetation rendering. Furthermore, the performance overhead of the entire rendering process is far lower than traditional masking and vertex animation solutions, supporting the placement of large numbers of vegetation instances in the scene.

[0073] The aforementioned dynamic vegetation rendering method decomposes vegetation into multiple components and constructs a skeletal system, transforming motion-driven animation from traditional vertex animation to skeletal skinning. Based on this, skeletal influence information and wind response parameters are encoded into texture coordinate channels to generate a general scene description format asset, which is then transformed into a skeletal assembly asset, achieving a significant reduction in asset size and pre-structuring of motion data. At runtime, by packaging the physical parameters of the interaction area into a first buffer and using the global wind field vector as input, motion equations are solved for each bone in the graphics processor, generating a skinning matrix set and writing it to a second buffer. This offloads the animation calculation of massive vegetation instances from the central processing unit (CPU) to the GPU for parallel execution. Finally, the skinning matrix is ​​extracted from the second buffer based on the bone index to perform skinning transformation on the vertices, completing the rendering. This solves the overdraw problem caused by traditional masking schemes, the bounding box inflation and excessive CPU load caused by vertex animation schemes, and the excessively large file size caused by full solid surface modeling, achieving high-performance dynamic rendering of large-scale, high-precision vegetation scenes.

[0074] In one optional embodiment, the vertices of each component are transformed to the bound pose space according to the hierarchical relationship of the skeletal system to generate a base mesh; skeletal influence information is assigned to the vertices of the base mesh, and the wind response parameter set defined in the attachment point information is encoded into the texture coordinate channel of the base mesh to generate a general scene description format asset carrying skeletal influence information and wind response parameter set, including the following steps:

[0075] S11. Extract the local binding pose matrix of each joint in the model's local space from the skeletal system; based on the local binding pose matrix and the hierarchical relationship, recursively calculate the global binding pose matrix of each joint in the model's local space using hierarchical chain multiplication.

[0076] Wherein, the model local space represents a three-dimensional space with the root joints of the skeletal system as the origin; the formula for calculating the global binding pose matrix is: ;in, This represents the global binding pose matrix of joint j in the local space of the model. This represents the set of indices of all joints along the path from the root joint to joint j. This represents the local binding pose matrix of joint k in the path within the corresponding parent joint space.

[0077] Specifically, the local rigging pose matrix of each joint in the skeletal system is extracted in the model's local space. This local rigging pose matrix is ​​the transformation matrix of a joint in its parent joint's local space when it is initially rigging, containing initial translation, rotation, and scaling information to characterize the joint's initial spatial position and orientation relative to its parent joint. The model's local space is defined as a three-dimensional space with the root joint of the skeletal system as its origin. The global spatial position of all joints is calculated based on this coordinate system, ensuring a unified spatial coordinate reference for the entire skeletal system.

[0078] Based on the extracted local rigging pose matrix and the hierarchical relationship of the skeleton system, the global rigging pose matrix of each joint in the local space of the model is calculated recursively using hierarchical chain multiplication. The calculation formula includes... This represents the global binding pose matrix of joint j in the local space of the model. It is used to characterize the absolute spatial pose and position of joint j in the entire skeletal system and is the core matrix for subsequent vertex coordinate transformation. This represents the set of indices of all joints along the path from the root joint to joint j. This set is arranged sequentially from the root joint to joint j according to the bone hierarchy to ensure the correct order of recursive calculation. This represents the local bound pose matrix of joint k in the path within the space of its corresponding parent joint, providing local transformation information of joint k relative to its parent joint. The recursive calculation process starts from the root joint, whose global bound pose matrix is ​​equal to its local bound pose matrix. The global bound pose matrix of each subsequent joint is the product of the local bound pose matrices of all joints on its path. Through this hierarchical chain multiplication, the accurate calculation of the global bound pose matrix of all joints is achieved, ensuring the consistency between the hierarchical relationship of the skeletal system and the spatial pose.

[0079] S12. For components attached to a specified joint, read the coordinates of the component's vertices in the local coordinate system as vertex coordinates; multiply the vertex coordinates by the global binding pose matrix of the specified joint to obtain the position coordinates of the vertices in the binding pose space; construct the basic mesh based on the position coordinates of all vertices in the binding pose space.

[0080] The formula for calculating the position coordinates of a vertex in the bound pose space is as follows: ;in, This represents the position coordinate vector of a vertex in the bound pose space. This represents the global binding pose matrix for a specified joint. This represents the coordinate vector of the vertex in the component's local coordinate system.

[0081] Specifically, for a component attached to a specified joint, the coordinates of its vertices in its local coordinate system are read as the initial coordinates of the vertices. The component's local coordinate system is a three-dimensional coordinate system established with the component's own geometric center as the origin, used to represent the relative positional relationships of vertices within the component. To transform these vertex coordinates to a unified rigging pose space, the vertex coordinates need to be multiplied by the global rigging pose matrix of the specified joint to obtain the vertex's position coordinates in the rigging pose space. The calculation formula is as follows: This represents the position coordinate vector of a vertex in the bound pose space, and is the base coordinate for the vertex to participate in subsequent skinning transformations; Represents the global binding pose matrix for a specified joint, used to transform vertices from the component's local coordinate system to the binding pose space of the model's local space; This represents the coordinate vector of a vertex in the component's local coordinate system, containing the vertex's three-dimensional x, y, and z coordinates within the component. Through this matrix multiplication operation, the coordinates of all component vertices attached to different joints are uniformly normalized, ensuring that all vertices are in the same bound pose space. Based on the position coordinates of all vertices in the bound pose space, combined with basic attributes such as vertex normals and tangents, a standardized basic mesh is constructed. This mesh provides a unified geometric carrier for subsequent bone influence information allocation and parameter encoding.

[0082] S13. For vertices in the flexible deformation region of the basic mesh, calculate the initial weights of the vertex affected by multiple bones using the Gaussian kernel function based on the shortest distance from the vertex to the bone segment; normalize the initial weights to obtain the multi-bone mixed weights of the vertex, and use the multi-bone mixed weights as part of the bone influence information.

[0083] The formula for calculating the initial weights is as follows: ;in, This represents the initial weight value of the vertex affected by bone j. This represents the shortest distance from the vertex to the bone segment of bone j. This represents an adjustable attenuation factor that controls the radius of the area affected by the skeleton.

[0084] Specifically, this step focuses on vertices within the flexible deformation region of the basic mesh, calculating the multi-bone hybrid weights in the bone influence information to achieve a smooth deformation effect in the flexible region. Flexible deformation regions are typically areas like leaves and twigs of vegetation, easily affected by wind and interaction, requiring natural bending deformation. Vertices in these regions are driven by the coordinated action of multiple bones; therefore, it's necessary to calculate the weight value of each bone's influence on the vertex. The calculation process is based on the shortest distance from the vertex to the bone segment, using a Gaussian kernel function to calculate the initial weights of the vertex's influence from multiple bones. The calculation formula includes... This represents the initial weight value of the vertex affected by bone j. The larger the weight value, the stronger the driving effect of bone j on the vertex. This represents the shortest distance from the vertex to the bone segment of bone j. This distance is calculated through spatial geometry. The closer the distance, the larger the initial weight value, which conforms to the physical law of the driving effect of bones on vertices. This represents an adjustable attenuation factor that controls the radius of the area affected by the skeleton. The higher the value, the wider the influence range of the skeleton, and the smoother the weight decay. The smaller the value, the more concentrated the influence range of the skeleton, and the more severe the weight decay. It can be flexibly adjusted according to the deformation requirements of the vegetation component.

[0085] After the initial weights are calculated, the initial weights of all bones affecting the vertex are normalized to ensure that the sum of the weights of all bones affecting a single vertex is 1. This normalization process avoids vertex position distortion in subsequent skinning transformations. The normalized weights are the multi-bone hybrid weights of the vertex, which are used as part of the bone influence information for weighted fusion driven by multiple bones in subsequent skinning transformations.

[0086] S14. For vertices in the rigidly attached region of the base mesh, assign the index of the specified joint as a single bone index to the vertex; set the weight value of the bone corresponding to the single bone index to be fully controlled so that the vertex is driven only by the bone corresponding to the single bone index during the skinning transformation; and use the single bone index and its weight value as part of the bone influence information.

[0087] Specifically, this step assigns weights to individual bones in the skeletal influence information for vertices belonging to rigid attachment regions within the basic mesh, achieving stable motion in these regions. Rigid attachment regions are typically areas like tree trunks, main branches, and joint connections—regions that are not easily deformed and need to move synchronously with the joints. Vertices in these regions do not require multi-bone collaborative driving; they are driven solely by the bone corresponding to the designated joint. During processing, the index of the designated joint is first assigned as a single bone index to the vertices in this region, ensuring a unique correspondence between vertices and driving bones. Then, the weight value of the bone corresponding to this single bone index is set to a fully controlled state (i.e., a weight value of 1), ensuring that the vertex is driven only by the bone corresponding to this single bone index during subsequent skinning transformations, unaffected by other bones. This ensures that the motion of the rigid region is completely synchronized with the motion of the corresponding joint, avoiding deformation or motion disconnection. This single bone index and its corresponding weight value are used as part of the skeletal influence information, together with the multi-bone mixed weights obtained in S13, to constitute the complete skeletal influence information.

[0088] S15. Extract the wind dynamic response parameter set including stiffness coefficient, damping coefficient and wind phase offset from the attachment point information, and combine the stiffness coefficient, damping coefficient and wind phase offset into a multi-dimensional vector.

[0089] Specifically, a set of wind response parameters is extracted from the attachment point information. This set includes three key parameters: stiffness coefficient, damping coefficient, and wind phase offset. The stiffness coefficient characterizes the skeleton's ability to resist bending deformation; a larger stiffness coefficient means the skeleton is less prone to bending, resulting in smaller deformation amplitude under wind and interaction. The damping coefficient characterizes the damping resistance experienced by the skeleton during movement; a larger damping coefficient means the skeleton's movement decays faster, preventing excessive swaying or shaking. The wind phase offset adjusts the synchronicity of wind-driven movements of different skeletons. By setting different wind phase offsets, the wind-driven effect of vegetation can present a natural sense of layering, avoiding the stiffness caused by all skeletons swaying synchronously. After extraction, the stiffness coefficient, damping coefficient, and wind phase offset are combined into a multi-dimensional vector in a preset order. The dimensions of the multi-dimensional vector are consistent with the number of parameters, achieving a structured organization of parameters through vector form, which facilitates subsequent encoding and storage.

[0090] S16. Write the multi-dimensional vector into the texture coordinate channel of the base mesh, and associate the bone influence information with the base mesh to generate a general scene description format asset.

[0091] Specifically, the multidimensional vector obtained by combining S15 is written into the texture coordinate channel of the base mesh. The texture coordinate channel is an inherent property of the base mesh. This channel is used to store the wind response parameter set, eliminating the need for additional memory and effectively controlling data volume. During the writing process, each parameter in the multidimensional vector is first normalized, mapping the parameter value range to the standard interval [0,1] of the texture coordinates to ensure compatibility between the parameters and the texture coordinate data. The normalization formula is as follows: ,in For parameter normalization values, The actual value of the parameter. , Preset the value range for the parameter.

[0092] After the parameters are written, the skeletal influence information obtained in S13 and S14 is associated with the base mesh. This association is achieved by treating the skeletal influence information as a custom vertex attribute of the base mesh, corresponding one-to-one with the vertex data. This ensures that the corresponding skeletal influence information can be quickly accessed through vertices during subsequent rendering. Finally, the base mesh, skeletal influence information, and coded wind response parameter sets are integrated to generate a general scene description format asset. This asset is cross-engine resolvable and can be directly imported into the rendering engine for further processing, providing standardized asset support for large-scale, high-precision dynamic rendering of vegetation.

[0093] In one optional embodiment, skeletal mesh data is generated based on skeletal influence information carried in a general scene description format asset, including the following steps:

[0094] S21. Identify the vertices of the flexible deformation region based on the multi-bone hybrid weights carried in the bone influence information, and import the vertices of the flexible deformation region into bone mesh volume data containing the flexible deformation mesh.

[0095] Specifically, this step identifies the vertices of the flexible deformation region and imports them into a flexible deformation mesh, providing a mesh carrier for the dynamic deformation of the flexible region. The skeletal influence information carried in the general scene description format asset includes multi-bone hybrid weights corresponding to the vertices of the flexible deformation region. This weight is the core identifier that distinguishes the flexible deformation region from the rigid attachment region—the vertices of the flexible deformation region need to be driven by multiple bones working together, and their skeletal influence information all contain multi-bone hybrid weights, and the weight values ​​are distributed in multiple dimensions, rather than a single fixed value. Based on this feature, by traversing the skeletal influence information of all vertices in the general scene description format asset and filtering out the vertices carrying multi-bone hybrid weights, all vertices of the flexible deformation region can be accurately identified.

[0096] The identified vertices of the flexible deformation region are imported as skeletal mesh data containing a flexible deformation mesh. The flexible deformation mesh is a mesh structure with skin deformation capabilities. Its mesh topology is consistent with the topology of the flexible deformation region in the base mesh, while retaining the multi-bone blending weights, normals, tangents, and other attributes of the vertices. During the import process, the multi-bone blending weights of the vertices are associated with the bone indices in the skeletal mesh data to ensure that each vertex can accurately match its corresponding driving bone, laying the foundation for multi-bone collaborative flexible deformation in subsequent skin transformations. The flexible deformation mesh is imported using the rendering engine's native skeletal mesh format, ensuring that it can be directly recognized by the engine's skin rendering module, and is also compatible with Nanite micro-polygon technology, supporting dynamic adjustment of rendering precision based on view distance.

[0097] S22. Based on the single bone index carried in the bone influence information, identify the component parts of the rigid attachment area and import the component parts as independent static mesh parts.

[0098] Specifically, this step processes the components of the rigidly attached region, importing them as independent static mesh parts to reduce rendering performance overhead. The single bone index carried in the bone influence information is the key basis for identifying the components of the rigidly attached region—the vertices of the rigidly attached region are driven by only a single bone, and its bone influence information contains only a single bone index and weight information with a weight value of 1. Based on this feature, the components of the rigidly attached region can be located by filtering vertices that carry a single bone index in the bone influence information.

[0099] Unlike flexible deformation regions, components in rigid attachment regions do not require flexible deformation; they only need to move synchronously with their corresponding joints. Therefore, they are imported as independent static mesh components. Static mesh components do not have skin deformation capabilities; their mesh topology is fixed, eliminating the need for real-time vertex data updates and significantly reducing computational overhead during rendering. During import, the geometric data, texture coordinates, and association markers with corresponding joints of the static mesh components are preserved to ensure accurate association with joints in subsequent skeletal mesh data. Furthermore, the engine's native static mesh format is used for storage, optimizing memory access efficiency and adapting to the performance requirements of large-scale instantiation rendering.

[0100] S23. By establishing a relationship between the static mesh components and the corresponding joints in the skeletal mesh data, skeletal mesh data containing skeletal mesh data and static mesh components is obtained.

[0101] Specifically, this step establishes the association between static mesh components and corresponding joints in the skeletal mesh data, integrating them to obtain complete skeletal mesh data and achieving coordinated unity between flexible deformation and rigid motion. The association process is based on skeletal influence information. The single bone index corresponding to the component part of the rigid attachment area is the joint index to be associated—each static mesh component corresponds to a unique single bone index, which perfectly matches the index of a certain joint in the skeletal mesh data. Based on this index, precise binding between the static mesh component and the corresponding joint can be achieved.

[0102] The association operation is implemented through the rendering engine's mesh association interface. It aligns the spatial coordinates of static mesh components with the spatial coordinates of their corresponding joints, ensuring that the initial positions of the static mesh components and joints are completely coincident. Simultaneously, association constraints are set to ensure that the static mesh components translate and rotate synchronously with the movement of the corresponding joints, maintaining a fixed relative position and preventing disjointness in movement. After association, the static mesh components are integrated into the skeletal mesh data, forming a complete skeletal mesh data containing both flexible deformable meshes and static mesh components. This data possesses the dynamic deformation capabilities of flexible deformable meshes, enabling natural wind movement and interactive responses in flexible vegetation areas, while the use of static mesh components reduces rendering overhead, providing a dual guarantee of performance and effect for subsequent real-time rendering of large-scale vegetation.

[0103] In one optional embodiment, detecting interaction areas that overlap with vegetation instances and packing the physical parameters of the interaction areas into a first buffer includes the following steps:

[0104] S31. Define interaction areas of various shapes in the game engine's physics system, and configure physical parameters for each interaction area, including the magnitude of the force, the direction of the force, and the attenuation radius.

[0105] Specifically, in the game engine's physics system, based on the actual needs of vegetation interaction scenarios, various shapes of interaction areas are defined. The shape of the interaction area must be adapted to the physical form of the interaction source. Common shapes include spheres, cylinders, cubes, and irregular polyhedra. Among them, spherical interaction areas are suitable for point-based interaction sources (such as character hand touch), cylindrical interaction areas are suitable for linear interaction sources (such as object sliding), and cube interaction areas are suitable for surface-based interaction sources (such as character body collision). Through the adaptation of various shapes, it is ensured that accurate detection can be achieved for different types of interaction scenarios.

[0106] Each interaction zone is configured with corresponding physical parameters, including the magnitude of the force, the direction of the force, and the attenuation radius. These three parameters jointly determine the impact of the interaction on the vegetation instance. The magnitude of the force characterizes the intensity of the force applied by the interaction source to the vegetation instance; its value is related to the speed and mass of the interaction source. The faster the interaction source moves and the greater its mass, the larger the magnitude of the force. The direction of the force characterizes the direction of application of the interaction force, which is consistent with the direction of movement of the interaction source or the normal vector of the interaction surface, ensuring that the application of the interaction force conforms to physical laws. The attenuation radius defines the range of influence of the interaction force. Within the attenuation radius, the interaction force gradually decreases with increasing distance from the center of the interaction zone; beyond the attenuation radius, the interaction force is zero. By configuring the attenuation radius, ineffective effects of the interaction on distant vegetation instances can be avoided, reducing detection and computational overhead. All physical parameters use standardized floating-point data storage, ensuring that they can be directly recognized and accessed by the game engine's physics system and subsequent graphics processor calculation modules.

[0107] S32. Detect vegetation instances that overlap with the interaction area using the physical query system.

[0108] Specifically, the game engine's built-in physics query system performs phased overlap detection between the interactive area and vegetation instances, accurately locating vegetation instances affected by the interaction. The core of this approach is a layered detection strategy of "coarse screening - fine inspection," ensuring detection accuracy while controlling computational overhead. The physics query system starts synchronously with the interactive area, responding in real-time to changes in the area's position and shape. Its detection process is based on spatial partitioning technology. First, the entire rendered scene is spatially divided using an octree algorithm, resulting in multiple uniformly sized spatial partitions. Each partition corresponds to an independent collision detection unit, and the index information of all vegetation instances within that partition is pre-stored.

[0109] The detection process begins with a coarse screening: the physics query system calculates the spatial boundary of the interaction area and compares it with the boundaries of all scene partitions. Partitions with no spatial intersection with the interaction area are quickly eliminated, retaining only target partitions where vegetation instances may overlap. This significantly reduces the number of objects to be detected subsequently, minimizing unnecessary computational overhead. After coarse screening, a fine screening is performed on the vegetation instances within the target partitions: first, a simplified axial-aligned bounding box (AABB) is used to construct axial bounding boxes for both the interaction area and each vegetation instance. By comparing the boundary coordinates of these bounding boxes, vegetation instances with overlapping bounding boxes are quickly identified, while obviously non-overlapping instances are excluded. Then, for the selected candidate vegetation instances, a high-precision mesh collider with the same geometric topology as the vegetation instance is used to perform face-by-face collision detection with the collider in the interaction area. This accurately determines whether there is actual geometric overlap between the two, avoiding misjudgments caused by the coarse bounding box screening. After the detection is completed, all vegetation instances that actually overlap with the interaction area are recorded in real time, and the coordinates of the overlapping area between each instance and the interaction area are marked, providing a spatial basis for the accurate association of physical parameters in S33.

[0110] S33. Associate the instance identifiers of overlapping vegetation instances with the physical parameters of the corresponding interaction areas to obtain associated data, and pack the associated data into the first buffer.

[0111] Specifically, for vegetation instances detected by S32 that overlap with the interaction area, the instance identifier of each vegetation instance is first extracted. The instance identifier is a unique identifier of the vegetation instance in the scene. It is automatically assigned by the rendering engine during instantiation and is used to distinguish different vegetation instances to ensure the accurate correspondence between subsequent physical parameters and vegetation instances.

[0112] The instance identifiers of vegetation instances are associated with the physical parameters of their corresponding interaction areas to construct associated data. This associated data is organized in a structured data format, and each piece of associated data includes information such as the vegetation instance identifier, interaction area identifier, force magnitude, force direction, attenuation radius, and coordinates of the overlapping area. The interaction area identifier is used to distinguish different interaction sources, and the coordinates of the overlapping area are used for subsequent calculations of the skeleton's influence weights. After the associated data is constructed, it is packaged into the first buffer according to preset memory storage rules. The first buffer adopts a structured buffer format that can be directly accessed by the graphics processor, and the data is stored at consecutive memory addresses. Each piece of associated data occupies a fixed amount of memory space, ensuring that the graphics processor can quickly index the corresponding physical parameters through the vegetation instance identifier during subsequent calculations. At the same time, the buffer is set with a data update flag, and the data is updated only when the physical parameters of the interaction area or the overlapping vegetation instances change, avoiding invalid data transmission and storage overhead, and providing efficient and accurate interactive physical parameter support for subsequent skeletal motion equation solving.

[0113] refer to Figure 2 In one optional embodiment, based on the global wind field vector field on the scene terrain, the physical parameters in the first buffer, and the skeleton assembly assets, the motion equations for each bone of each vegetation instance are solved to generate a skinning matrix, including the following steps:

[0114] S41. For each bone j of each vegetation instance, query the current frame wind vector in the corresponding global wind field vector field according to the position of bone j in world space; based on the current frame wind vector, combine the stiffness coefficient of bone j in the corresponding runtime parameters and the depth factor in the bone level to calculate the rotational torque vector generated by the global wind field on bone j.

[0115] The formula for calculating the rotational torque vector is as follows: ;in, This represents the rotational torque vector generated by the global wind field on skeleton j. Represents the wind vector of the current frame. Let represent the unit vector along the axis of bone j. The depth factor represents the increase in depth of skeleton j within the hierarchical relationship of the skeletal system. This represents the stiffness coefficient of bone j.

[0116] Specifically, for each skeleton j of each vegetation instance, firstly, based on the 3D coordinates of skeleton j in world space, the current frame wind vector is obtained by querying the global wind field vector field through spatial partition index. This wind vector corresponds to the real-time wind field state at the location of skeleton j, including wind direction and speed information. Based on this current frame wind vector, combined with the runtime parameters of skeleton j and skeleton hierarchy features, the rotational torque vector generated by the global wind field on skeleton j is calculated. The calculation formula is as follows: The vector of rotational torque generated by the global wind field on skeleton j is used to drive skeleton j to rotate around its own axis. The direction of the vector determines the direction of rotation, and the magnitude determines the rotational force. The wind vector of the current frame directly determines the direction and intensity of the wind field's force on the skeleton; is the axial unit vector of bone j, determined by the initial orientation of bone j in the binding pose space, used to characterize the growth direction of the bone; × represents the vector cross product operation, used to calculate the perpendicular component of the wind vector and the bone axis, which is the core of generating rotational torque. The depth factor increases with the depth of skeleton j in the skeleton system hierarchy. That is, the deeper the hierarchy (such as the skeleton corresponding to branches and leaves), the larger the depth factor and the stronger the torque generated by the wind field. This is consistent with the natural wind movement law of vegetation and can be obtained through preset mapping rules. denoted as the stiffness coefficient of bone j, taken from runtime parameters. The larger the stiffness coefficient, the stronger the bone's resistance to rotation. This is used to weaken the inhibitory effect of the stiffness coefficient on torque, so that skeletons with lower stiffness can obtain stronger wind torque.

[0117] S42. For vegetation instances that overlap with the interaction area, traverse each interaction area associated with the vegetation instance in the first buffer, determine the vector from the center of the interaction area to the root of the vegetation instance based on the center position of the interaction area and the root position of the vegetation instance, and determine the vector from the root of the vegetation instance to the centroid of the bone j based on the centroid position of the bone j and the root position of the vegetation instance.

[0118] Specifically, for vegetation instances overlapping with interaction zones, all interaction zones associated with that vegetation instance in the first buffer are first traversed to ensure no interaction is missed. For each interaction zone, two core vectors are calculated: one is the vector from the center of the interaction zone to the root of the vegetation instance, obtained by subtracting the spatial coordinates of the root of the vegetation instance from the spatial coordinates of the center of the interaction zone, used to characterize the relative positional relationship between the interaction source and the root of the vegetation; the other is the vector from the root of the vegetation instance to the centroid of skeleton j, obtained by subtracting the spatial coordinates of the root of the vegetation instance from the spatial coordinates of the centroid of skeleton j, used to characterize the position of skeleton j in the overall vegetation structure, providing a spatial reference for subsequent calculation of interaction torque. Both vectors are stored in three dimensions, and their coordinates are based on the world coordinate system to ensure the consistency and accuracy of the calculation.

[0119] S43. Based on the physical parameters of the interaction area, the vector from the center of the interaction area to the root of the vegetation instance, and the vector from the root of the vegetation instance to the centroid of bone j, calculate the additional rotational torque vector generated by the interaction area on bone j.

[0120] The formula for calculating the additional rotational torque vector generated by the interaction zone on bone j is as follows: ;in, This represents the additional rotational torque vector generated by the interaction area on bone j; The attenuation coefficient is calculated based on the vector from the center of the interaction zone to the root of the vegetation instance and the attenuation radius of the interaction zone. This represents the force vector constructed based on the magnitude and direction of the force applied in the interaction area. This represents the vector from the root of the vegetation instance to the centroid of the skeleton j.

[0121] Specifically, this step, based on the vector obtained in S42 and the physical parameters of the interaction area, calculates the additional rotational torque vector generated by the interaction area on bone j, thereby achieving precise driving of bone movement through interaction. The calculation formula includes... The additional rotational torque vector generated by the interaction area on the skeleton j is used to superimpose the wind field torque and jointly determine the motion state of the skeleton j; α is the attenuation coefficient, which is calculated from the vector magnitude from the center of the interaction area to the root of the vegetation instance and the attenuation radius of the interaction area. When the vector magnitude is less than the attenuation radius, the attenuation coefficient decreases as the magnitude increases. When it exceeds the attenuation radius, the attenuation coefficient is 0, realizing the distance attenuation effect of the interaction force. The force vector is constructed based on the magnitude and direction of the force in the interaction zone. The magnitude of the force determines the vector magnitude, and the direction of the force determines the vector direction, representing the force state of the interaction source on the vegetation. The vector from the root of the vegetation instance to the centroid of skeleton j is taken from the calculation result of S42, using the vector cross product operation. The torque is used to calculate the rotational torque generated by the interaction force on bone j, and then the torque intensity is adjusted by the attenuation coefficient α to ensure that the interaction torque conforms to the physical attenuation law.

[0122] S44. Superimpose the rotational torque vector generated by the global wind field with the additional rotational torque vector generated by the interaction zone to obtain the total external torque vector; read the corresponding damping coefficient and wind phase offset from the runtime parameters according to the index of skeleton j.

[0123] Specifically, the global wind field rotational torque vector calculated in S41 is superimposed with the additional rotational torque vector obtained in S43 to obtain the total external torque vector. Simultaneously, based on the unique index of bone j, the corresponding damping coefficient and wind phase offset are read from the runtime parameters of the bone assembly asset. The damping coefficient is used to adjust the decay rate of bone motion, and the wind phase offset is used to distinguish the wind synchronicity of different bones; both are key parameters for solving the subsequent second-order dynamic system equations.

[0124] S45. Input the total external torque, damping coefficient, stiffness coefficient, and wind phase offset into the second-order dynamic system equation. Solve the second-order dynamic system equation by numerical integration to obtain the rotation angle and angular velocity of bone j in the current frame. Generate the local rotation quaternion of bone j based on the rotation angle and angular velocity.

[0125] The expression for the second-order dynamical system equations is as follows:

[0126]

[0127] in, This represents the rotation angle of bone j. Indicates time, This represents the damping ratio, which is determined by the damping coefficient. This represents the natural frequency determined by the stiffness coefficient. This represents the magnitude of the total external torque vector. This represents the preset moment of inertia of bone j. This represents the wind phase offset of skeleton j.

[0128] Specifically, the total external torque vector, damping coefficient, stiffness coefficient, and wind phase offset are substituted into the second-order dynamic system equation, which describes the angular motion of the skeleton j. In its expression, ζ is the rotation angle of bone j, used to characterize the rotation magnitude of bone j relative to the initial position; t is the time parameter, corresponding to the timestamp of the rendering frame, to ensure that the motion solution is synchronized with the rendering frame; ζ is the damping ratio, which is directly determined by the damping coefficient. The larger the damping coefficient, the larger the damping ratio, and the faster the bone motion decays, which can avoid excessive swaying. The natural frequency is determined by the stiffness coefficient. The larger the stiffness coefficient, the higher the natural frequency, and the faster the bone rotation response speed. The modulus of the total external torque vector is used to characterize the strength of the total external force. The larger the modulus, the stronger the bone rotation force. The preset moment of inertia of bone j is determined by the geometric dimensions and mass distribution of bone j. The larger the moment of inertia, the stronger the rotational inertia of the bone. The wind phase offset of bone j is used to adjust the starting phase of bone wind motion and achieve differentiated effects of different bone wind motions. The term is used to simulate the periodic changes in wind, making the skeletal movement more in line with natural laws. The second-order differential equation is solved numerically by semi-implicit Euler method to obtain the rotation angle and angular velocity of bone j in the current frame. Based on the rotation angle and angular velocity, a local rotation quaternion is generated. The quaternion is used to represent the rotational attitude of the bone, which can effectively avoid the gimbal lock problem during the rotation process and ensure the smoothness of the skeletal movement.

[0129] S46. Based on the local rotation quaternion of bone j and the local translation of bone j relative to the parent bone, construct the local transformation matrix of bone j; based on the local transformation matrix, calculate the world space transformation matrix of bone j through bone hierarchy chain multiplication; multiply the world space transformation matrix with the binding pose inverse matrix of bone j to generate the skinning matrix.

[0130] Specifically, firstly, based on the local rotation quaternion of bone j generated by S45... Combined with the local translation vector of bone j relative to its parent bone Construct the local transformation matrix of skeleton j Its calculation formula is .in, For local rotation quaternions The resulting 3×3 rotation matrix is ​​used to characterize the rotational posture of bone j relative to its parent bone. The quaternion to rotation matrix conversion can avoid gimbal lock and ensure the smoothness of bone rotation. Let be the local translation vector of bone j relative to its parent bone, used to characterize the positional offset of bone j in the local space of the parent bone; the [0,1] in the lower right corner of the matrix is ​​the homogeneous coordinate identifier, ensuring that the matrix can be used for subsequent homogeneous coordinate transformations. This local transformation matrix fully contains the rotation and translation information of bone j relative to its parent bone, accurately describing its local spatial pose.

[0131] Based on local transformation matrix The world space transformation matrix of bone j is calculated using the bone hierarchy chain multiplication method. Its calculation formula is .in, Let J be the world space transformation matrix of the parent bone of bone j. The hierarchical chain multiplication is performed sequentially along the path from the root bone to bone j in the skeletal system. The world space transformation matrix of the root bone is equal to its local transformation matrix. The world space transformation matrix of each subsequent bone is the product of the world space transformation matrix of its parent bone and its own local transformation matrix. Through this operation, the local pose of bone j is converted into the absolute pose and position in the world coordinate system, ensuring the consistency between bone motion and scene space.

[0132] The core of skinning matrix generation is to convert the world-space motion transformation of skeleton j into a transformation that can be applied to the pose space of the vertices. Its calculation formula is as follows: .in, Let be the skinning matrix of bone j, which is the core matrix for subsequent vertex skinning transformations; Let be the world space transformation matrix of bone j, representing the current real-time motion state of the bone; is the inverse of the binding pose matrix for bone j, used to transform vertices from the binding pose space to the world space. Then, by multiplying it with the world space transformation matrix, the vertices are transformed synchronously with the bone movement, ensuring the accuracy of the vertex transformation.

[0133] After the skinning matrices for all bones of all vegetation instances are calculated, they are organized according to the two-dimensional rule of vegetation instance identifier - bone index to generate a skinning matrix set. The row index corresponds to the unique identifier of the vegetation instance, the column index corresponds to the hierarchical index of the bone in the skeletal system, and each index position stores the skinning matrix of the corresponding bone. Its organizational format can be represented as (Where i is the vegetation instance identifier and j is the bone index). This set is stored using contiguous memory addresses, ensuring that subsequent vertex shaders can quickly index the corresponding skinning matrix through the bone index carried by the vertex, providing efficient and accurate matrix support for vertex skinning transformation.

[0134] The aforementioned dynamic vegetation rendering method decomposes vegetation into multiple components and constructs a skeletal system, transforming motion-driven animation from traditional vertex animation to skeletal skinning. Based on this, skeletal influence information and wind response parameters are encoded into texture coordinate channels to generate a general scene description format asset, which is then transformed into a skeletal assembly asset, achieving a significant reduction in asset size and pre-structuring of motion data. At runtime, by packaging the physical parameters of the interaction area into a first buffer and using the global wind field vector as input, motion equations are solved for each bone in the graphics processor, generating a skinning matrix and writing it to a second buffer. This offloads the animation calculations of massive vegetation instances from the central processing unit (CPU) to the GPU for parallel execution. Finally, the skinning matrix is ​​extracted from the second buffer based on the bone index to perform skinning transformations on the vertices, completing the rendering. This solves the overdraw problem caused by traditional masking schemes, the bounding box inflation and excessive CPU load caused by vertex animation schemes, and the excessively large file size caused by full solid surface modeling, achieving high-performance dynamic rendering of large-scale, high-precision vegetation scenes.

[0135] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0136] Based on the same inventive concept, this application also provides a system for implementing the dynamic vegetation rendering method described above. The solution provided by this system is similar to the implementation scheme described in the above method; therefore, the specific limitations of one or more dynamic vegetation rendering system embodiments provided below can be found in the limitations of the dynamic vegetation rendering method described above, and will not be repeated here.

[0137] In one exemplary embodiment, such as Figure 3 As shown, a dynamic vegetation rendering system 30 is provided to implement the methods in the above-described method embodiments. The system includes:

[0138] The vegetation structure initialization module 31 is used to decompose the full solid surface mesh of vegetation into multiple components, construct a skeleton system for each component and define attachment point information.

[0139] The feature parameter mapping module 32 is used to transform the vertices of each component to the bound pose space according to the hierarchical relationship of the skeleton system to generate a basic mesh; assign bone influence information to the vertices of the basic mesh, and encode the wind response parameter group defined in the attachment point information to the texture coordinate channel of the basic mesh to generate a general scene description format asset carrying bone influence information and wind response parameter group.

[0140] The asset compositing optimization module 33 is used to import general scene description format assets into the rendering engine, generate skeletal mesh data based on the skeletal influence information carried in the general scene description format assets, generate runtime parameters based on the wind response parameter group carried in the general scene description format assets, and combine the skeletal mesh data and runtime parameters into a skeletal assembly asset.

[0141] The interaction impact detection module 34 is used to detect the interaction area that overlaps with the vegetation instance, pack the physical parameters of the interaction area into the first buffer, and upload the global wind field vector field on the scene terrain to the graphics processor.

[0142] The dynamic motion solver module 35 is used to solve the motion equations for each bone of each vegetation instance in the computation shader of the graphics processor, based on the global wind field vector field, the physical parameters in the first buffer, and the skeleton assembly assets, and generate a skin matrix; and write the skin matrix into the second buffer.

[0143] The rendering execution output module 36 is used to extract the corresponding skinning matrix from the second buffer in the vertex shader of the graphics processor according to the bone index stored in the vertex data of the bone mesh data in the bone assembly asset; perform skinning transformation on the vertex data according to the skinning matrix to obtain the transformed vertex position, and render the transformed vertex position.

[0144] Embodiments of this application also provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the aforementioned method embodiments.

[0145] Embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.

[0146] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0147] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.

Claims

1. A dynamic vegetation rendering method, characterized in that, The method includes: S1. Decompose the full solid surface mesh of the vegetation into multiple components, construct a skeleton system for each component and define attachment point information; S2. Based on the hierarchical relationship of the skeleton system, transform the vertices of each component to the bound pose space to generate a basic mesh; assign bone influence information to the vertices of the basic mesh, and encode the wind response parameter group defined in the attachment point information to the texture coordinate channel of the basic mesh to generate a general scene description format asset carrying the bone influence information and the wind response parameter group; S3. Import the general scene description format asset into the rendering engine, generate bone mesh data according to the bone influence information carried in the general scene description format asset, generate runtime parameters according to the wind response parameter group carried in the general scene description format asset, and combine the bone mesh data and the runtime parameters into a bone assembly asset. S4. Detect the interaction area that overlaps with the vegetation instance, pack the physical parameters of the interaction area into the first buffer, and upload the global wind field vector field on the scene terrain to the graphics processor. S5. In the computation shader of the graphics processor, based on the global wind field vector field, the physical parameters in the first buffer, and the skeleton assembly assets, the motion equations are solved for each bone of each vegetation instance to generate a skinning matrix; the skinning matrix is ​​written into the second buffer. S6. In the vertex shader of the graphics processor, the corresponding skinning matrix is ​​extracted from the second buffer according to the bone index stored in the vertex data of the bone mesh data in the bone assembly asset; the skinning transformation is performed on the vertex data according to the skinning matrix to obtain the transformed vertex position, and the transformed vertex position is rendered.

2. The method according to claim 1, characterized in that, The process involves transforming the vertices of each component to the bound pose space according to the hierarchical relationship of the skeletal system to generate a base mesh; assigning skeletal influence information to the vertices of the base mesh; and encoding the wind response parameter group defined in the attachment point information into the texture coordinate channel of the base mesh to generate a general scene description format asset carrying the skeletal influence information and the wind response parameter group, including: S11. Extract the local binding pose matrix of each joint in the model local space of the skeletal system; based on the local binding pose matrix and the hierarchical relationship, recursively calculate the global binding pose matrix of each joint in the model local space by hierarchical chain multiplication. Wherein, the model local space represents a three-dimensional space with the root joints of the skeletal system as the origin; the calculation formula for the global binding pose matrix is: ;in, This represents the global binding pose matrix of joint j in the local space of the model. This represents the set of indices of all joints along the path from the root joint to joint j. This represents the local binding pose matrix of joint k in the path within the corresponding parent joint space; S12. For the component attached to the specified joint, read the coordinates of the component's vertices in the local coordinate system as vertex coordinates; multiply the vertex coordinates by the global binding pose matrix of the specified joint to obtain the position coordinates of the vertex in the binding pose space; construct the basic mesh based on the position coordinates of all vertices in the binding pose space. The formula for calculating the position coordinates of the vertex in the bound pose space is as follows: ;in, This represents the position coordinate vector of the vertex in the bound pose space. This represents the global binding pose matrix of the specified joint. This represents the coordinate vector of the vertex in the local coordinate system of the component; S13. For vertices in the basic mesh that belong to the flexible deformation region, the initial weights of the influence of multiple bones on the vertex are calculated using the Gaussian kernel function based on the shortest distance from the vertex to the bone segment; the initial weights are normalized to obtain the multi-bone mixed weights of the vertex, and the multi-bone mixed weights are used as part of the bone influence information. The formula for calculating the initial weight is as follows: ;in, The initial weight value represents the influence of bone j on the vertex. This represents the shortest distance from the vertex to the skeletal line segment of bone j. This represents an adjustable attenuation factor that controls the radius of the area affected by the skeleton. S14. For vertices belonging to rigid attachment regions in the basic mesh, assign the index of the specified joint as a single bone index to the vertex; set the weight value of the bone corresponding to the single bone index to be fully controlled, so that the vertex is driven only by the bone corresponding to the single bone index in the skinning transformation; and use the single bone index and its weight value as part of the bone influence information. S15. Extract the wind dynamic response parameter group including stiffness coefficient, damping coefficient and wind phase offset from the attachment point information, and combine the stiffness coefficient, the damping coefficient and the wind phase offset into a multi-dimensional vector. S16. Write the multidimensional vector into the texture coordinate channel of the base mesh, and associate the bone influence information with the base mesh to generate the general scene description format asset.

3. The method according to claim 2, characterized in that, The step of generating skeletal mesh data based on the skeletal influence information carried in the general scene description format asset includes: S21. Identify the vertices of the flexible deformation region based on the multi-bone hybrid weight carried in the bone influence information, and import the vertices of the flexible deformation region into the bone mesh data containing the flexible deformation mesh. S22. Based on the single bone index carried in the bone influence information, identify the component part of the rigid attachment region and import the component part as an independent static mesh component. S23. By establishing an association between the static mesh component and the corresponding joint in the skeletal mesh data, the skeletal mesh data containing the skeletal mesh data and the static mesh component is obtained.

4. The method according to claim 3, characterized in that, The detection of interaction areas that overlap with vegetation instances, and the packaging of the physical parameters of the interaction areas into a first buffer, including: S31. Define the interaction areas of various shapes in the physics system of the game engine, and configure the physical parameters including the magnitude of the force, the direction of the force, and the attenuation radius for each interaction area; S32. Detect vegetation instances that overlap with the interaction area using a physical query system; S33. Associate the instance identifiers of the overlapping vegetation instances with the physical parameters of the corresponding interaction areas to obtain associated data, and pack the associated data into the first buffer.

5. The method according to claim 4, characterized in that, The step of solving the motion equations for each bone of each vegetation instance and generating a skinning matrix based on the global wind field vector field on the scene terrain, the physical parameters in the first buffer, and the skeleton assembly assets includes: S41. For each bone j of each vegetation instance, query the current frame wind vector in the corresponding global wind field vector field according to the position of bone j in world space; calculate the rotational torque vector generated by the global wind field on bone j according to the current frame wind vector, combined with the stiffness coefficient of bone j in the corresponding runtime parameters and the depth factor in the bone level. The formula for calculating the rotational torque vector is as follows: ;in, This represents the rotational torque vector generated by the global wind field on skeleton j. This represents the wind vector of the current frame. Let represent the unit vector along the axis of bone j. The depth factor represents the factor that increases with the depth of bone j in the hierarchical relationship of the skeletal system. The stiffness coefficient of bone j represents the stiffness coefficient of bone j. S42. For the vegetation instance that overlaps with the interaction area, traverse each interaction area associated with the vegetation instance in the first buffer, determine the vector from the center of the interaction area to the root of the vegetation instance based on the center position of the interaction area and the root position of the vegetation instance, and determine the vector from the root of the vegetation instance to the centroid of the bone j based on the centroid position of the bone j and the root position of the vegetation instance. S43. Calculate the additional rotational torque vector generated by the interaction area on the bone j based on the physical parameters of the interaction area, the vector from the center of the interaction area to the root of the vegetation instance, and the vector from the root of the vegetation instance to the centroid of the bone j. The formula for calculating the additional rotational torque vector generated by the interaction area on bone j is as follows: ;in, This represents the additional rotational torque vector generated by the interaction area on bone j; The attenuation coefficient is calculated based on the vector from the center of the interaction zone to the root of the vegetation instance and the attenuation radius of the interaction zone. This represents the force vector constructed based on the magnitude and direction of the force in the interaction area. This represents the vector from the root of the vegetation instance to the centroid of the skeleton j; S44. The rotational torque vector generated by the global wind field is superimposed with the additional rotational torque vector generated by the interaction zone to obtain the total external torque vector; the corresponding damping coefficient and wind phase offset are read from the runtime parameters according to the index of the skeleton j. S45. Input the total external torque, the damping coefficient, the stiffness coefficient, and the wind phase offset into the second-order dynamic system equation, solve the second-order dynamic system equation by numerical integration, and obtain the rotation angle and angular velocity of the skeleton j in the current frame; generate the local rotation quaternion of the skeleton j based on the rotation angle and the angular velocity. The expression for the second-order dynamic system equations is as follows: in, This represents the rotation angle of bone j. Indicates time, This represents the damping ratio determined by the damping coefficient. This represents the natural frequency determined by the stiffness coefficient. This represents the magnitude of the total external torque vector. This represents the preset moment of inertia of bone j. The wind phase offset represents the bone j; S46. Based on the local rotation quaternion of bone j and the local translation of bone j relative to the parent bone, construct the local transformation matrix of bone j; based on the local transformation matrix, calculate the world space transformation matrix of bone j through bone hierarchy chain multiplication; multiply the world space transformation matrix with the binding pose inverse matrix of bone j to generate the skinning matrix.

6. A dynamic vegetation rendering system for implementing the method according to any one of claims 1 to 5, characterized in that, The system includes: The vegetation structure initialization module is used to decompose the full solid surface mesh of vegetation into multiple components, construct a skeleton system for each component and define attachment point information; The feature parameter mapping module is used to transform the vertices of each component to the bound pose space according to the hierarchical relationship of the skeleton system to generate a base mesh; assign bone influence information to the vertices of the base mesh, and encode the wind response parameter group defined in the attachment point information to the texture coordinate channel of the base mesh to generate a general scene description format asset carrying the bone influence information and the wind response parameter group; The asset compositing and optimization module is used to import the general scene description format asset into the rendering engine, generate skeletal mesh data based on the skeletal influence information carried in the general scene description format asset, generate runtime parameters based on the wind response parameter group carried in the general scene description format asset, and combine the skeletal mesh data and the runtime parameters into a skeletal assembly asset. The interaction impact detection module is used to detect the interaction area that overlaps with the vegetation instance, pack the physical parameters of the interaction area into the first buffer, and upload the global wind field vector field on the scene terrain to the graphics processor. The dynamic motion solving module is used to solve the motion equations for each bone of each vegetation instance in the computation shader of the graphics processor, based on the global wind field vector field, the physical parameters in the first buffer, and the skeleton assembly assets, and generate a skinning matrix; and write the skinning matrix into the second buffer. The rendering execution output module is used to extract the corresponding skinning matrix from the second buffer in the vertex shader of the graphics processor according to the bone index stored in the vertex data of the bone mesh data in the bone assembly asset; perform skinning transformation on the vertex data according to the skinning matrix to obtain the transformed vertex position, and render the transformed vertex position.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 5.