Online rendering method of flexible body

By mapping high-precision triangular meshes to low-precision tetrahedral meshes on mobile devices and performing FEM constraint solving on the GPU, combined with Isosurface Stuffing and Stable Neo-Hookean models, the problem of excessive computational load in rendering soft objects on mobile devices is solved, achieving efficient and stable rendering effects.

CN121600219APending Publication Date: 2026-03-03SHANGHAI WENDIE NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511806687.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-03
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Real-time and efficient rendering of soft objects on mobile devices faces the problem of excessive computation due to high-precision meshes, making traditional FEM algorithms ineffective.

Method used

By mapping high-precision triangular meshes to low-precision tetrahedral meshes and solving FEM constraints on a GPU, low-precision tetrahedral meshes are generated using the Isosurface Stuffing algorithm. Energy density function correction is performed using the Stable Neo-Hookean model, and parallel computation is achieved using ClusterGraphColoring and thread group optimization strategies.

Benefits of technology

While ensuring rendering accuracy, it significantly reduces the amount of computation, frees up CPU resources, and improves the rendering performance of mobile devices. It solves the problems of excessive computation and insufficient computing power in traditional methods and achieves stable soft body object rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121600219A_ABST
    Figure CN121600219A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of flexible body simulation, and particularly relates to an online rendering method of a flexible body, which is applied to a GPU (Graphics Processing Unit) of a mobile terminal and comprises the following steps: acquiring a relation mapping table of a high-precision triangular mesh of a flexible body object and a corresponding low-precision tetrahedral mesh from the CPU of the mobile terminal; wherein the relation mapping table records a tetrahedron unit bound with each vertex Vt of the high-precision triangular mesh and a function relation between the vertex Vt and all vertexes Ve of the tetrahedron unit; calculating the offset of each vertex Ve of the low-precision tetrahedral mesh converged to a constraint position based on an energy density function, and updating the position of each vertex Ve of the low-precision tetrahedral mesh according to the offset; adjusting the position of the vertex Vt by using the updated vertex Ve according to the function relationship between the vertex Vt of the high-precision triangular grid and the vertex Ve of the corresponding tetrahedron unit so as to correct the spatial form of the high-precision triangular grid; and rendering is carried out based on the high-precision triangular mesh after soft object correction so as to generate a picture of the current frame of the soft body.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of soft body simulation technology, specifically relating to an online rendering method for soft bodies, applied to mobile GPUs. Background Technology

[0002] The physical simulation of soft bodies (such as cloth, soft creatures, and elastic objects) is a key technology for enhancing game immersion, but how to render simulated soft body objects in real time and efficiently on mobile devices still faces significant challenges.

[0003] Currently, most solutions employ position dynamics-based methods (such as PBD / XPBD) and the finite element method (FEM) to simulate soft bodies and then render these soft body objects to generate corresponding game visuals. However, the following problems still exist: The FEM algorithm discretizes the object into a large number of tetrahedral elements with the precision of the original triangular mesh, resulting in an exponential increase in the number of tetrahedral elements. This greatly increases the number of FEM constraints that need to be solved, consuming too much computing power and making it virtually impossible to run on a mobile CPU. Summary of the Invention

[0004] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide an online rendering method for soft bodies. This method reduces the number of FEM constraints by mapping high-precision triangular meshes to low-precision tetrahedral meshes. Simultaneously, the FEM constraint solving is performed on the GPU to correct the triangular surface meshes and complete the rendering of the soft body object, thereby reducing CPU computational overhead.

[0005] This invention provides an online rendering method for soft bodies, applied to a mobile GPU, comprising: obtaining a mapping table of high-precision triangular meshes and corresponding low-precision tetrahedral meshes of a soft body object from the mobile CPU; wherein the low-precision tetrahedral mesh is generated based on the high-precision triangular mesh and contains several tetrahedral cells; the mapping table records the tetrahedral cells bound to each vertex Vt of the high-precision triangular mesh, and the functional relationship between the tetrahedral cells and all vertices Ve of the tetrahedral cells; for each low-precision tetrahedral mesh, calculating the offset of each vertex Ve of the low-precision tetrahedral mesh converging to the constraint position based on the energy density function, and updating the position of each vertex Ve of the low-precision tetrahedral mesh accordingly; for each vertex Vt in the high-precision triangular mesh, adjusting the position of vertex Vt using the updated vertex Ve of the tetrahedral cells according to the functional relationship between the vertex Vt and all vertices Ve of the tetrahedral cells bound to it, so as to correct the spatial shape of the high-precision triangular mesh; and rendering based on the corrected high-precision triangular mesh of the soft body object to generate the current frame of the soft body.

[0006] In one embodiment of the present invention, the step of generating a mapping table between a high-precision triangular mesh and a corresponding low-precision tetrahedral mesh of a soft body object includes: obtaining several high-precision triangular meshes of the soft body object in the current frame; generating a corresponding low-precision tetrahedral mesh for each high-precision triangular mesh using the Isosurface Stuffing algorithm; and binding each vertex Vt of the high-precision triangular mesh to a tetrahedral cell of the corresponding low-precision tetrahedral mesh to generate a corresponding mapping table.

[0007] In one embodiment of the present invention, the step of binding each vertex Vt of the high-precision triangular mesh with the tetrahedral cell of the corresponding low-precision tetrahedral mesh to generate a corresponding relational mapping table includes: for each vertex Vt of the high-precision triangular mesh, locating the tetrahedral cell containing the vertex Vt by ray detection or spatial hashing, and associating it with the vertex Vt.

[0008] In one embodiment of the present invention, the functional relationship between the vertex Vt of the high-precision triangular mesh and all vertices Ve of the corresponding tetrahedral element is expressed as follows: , in, , , , The four vertices Ve of the tetrahedral unit are represented. , , , They represent , , , The weights of the four vertices Ve are given, and the sum of the weights is 1.

[0009] In one embodiment of the present invention, the weight of a vertex Ve is one of the components of the centroid coordinates of the corresponding tetrahedral element.

[0010] In one embodiment of the present invention, the formula for calculating the weight of vertex Ve is as follows: , in, Let represent the spatial volume between the centroid coordinates of the tetrahedral element and the plane containing the i-th vertex Ve. This represents the total volume of a tetrahedral unit.

[0011] In one embodiment of the present invention, the offset The calculation formula is as follows: ,and , in, The derivative representing the mass of the i-th vertex of a tetrahedral element. Represents the energy density function, This represents the partial derivative of the energy density function with respect to the i-th vertex of the tetrahedral element. This represents the elastic modulus of a tetrahedral element. Indicates the time step of the current frame.

[0012] In one embodiment of the present invention, the updated vertex Ve of the low-precision tetrahedral mesh is represented as follows: ;in, This is the offset of vertex Ve.

[0013] In one embodiment of the present invention, the energy density function adopts the Stable Neo-Hookean model, and the energy density function C is expressed as: , in, For the Cauchy-Green tensor trace, For the deformable gradient determinant, , For Lamé parameters.

[0014] In one embodiment of the present invention, for each vertex Vt in the high-precision triangular mesh, the position of vertex Vt is adjusted by using the updated vertex Ve of the tetrahedral unit according to the functional relationship between all vertices Ve of the tetrahedral unit bound to it, so as to correct the spatial shape of the high-precision triangular mesh. The method further includes: after the high-precision triangular mesh is corrected, updating its corresponding normal and tangent.

[0015] The beneficial effects of this invention are as follows: This invention breaks through the traditional understanding that "high-precision simulation must require high-precision meshes". By binding and mapping "high-precision triangular mesh - low-precision tetrahedral mesh", the amount of computation is compressed to the range that mobile devices can bear while ensuring simulation accuracy.

[0016] Meanwhile, this invention also introduces the Stable Neo-Hookean model, which solves the three major pain points of traditional models in one go: "bounce failure", "numerical explosion" and "high performance overhead", providing stable core algorithm support for mobile soft body simulation.

[0017] This invention migrates the two computationally intensive steps of "constraint solving" and "mesh reconstruction" to the GPU, and maximizes the use of mobile GPU computing power through strategies such as ClusterGraphColoring and thread group optimization, while freeing up CPU resources for game logic processing. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0019] Figure 1 This is a flowchart illustrating an online rendering method for a soft body provided in one embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of an online rendering system for soft bodies provided in one embodiment of the present invention; Figure 3 This is a structural block diagram of an electronic device provided in one embodiment of the present invention. Detailed Implementation

[0020] To facilitate understanding of this application, a more complete description will be provided below with reference to the accompanying drawings, which illustrate embodiments of the present application. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that the disclosure of this application will be thorough and complete.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

[0022] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.

[0023] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.

[0024] Example 1 Please see Figure 1As shown, an online rendering method for soft bodies, applied to a mobile GPU, includes: Step S100: Obtain the relationship mapping table between the high-precision triangular mesh and the corresponding low-precision tetrahedral mesh of the soft body object from the CPU of the mobile terminal; wherein, the low-precision tetrahedral mesh is generated based on the high-precision triangular mesh and contains several tetrahedral units; the relationship mapping table records the tetrahedral units bound to each vertex Vt of the high-precision triangular mesh, as well as the functional relationship between the tetrahedral units and all vertices Ve of the tetrahedral units.

[0025] It should be noted that traditional FEM algorithms do not distinguish between the different accuracy requirements of the "internal volume" and "surface morphology" of soft objects. That is, the surface deformation of a soft object directly affects the visual effect and requires high accuracy, while the deformation of the internal volume has minimal impact on visual perception and does not require high-precision elements. Therefore, using a uniform discretization strategy to apply the same element density to the interior and surface of the soft object results in a large amount of redundancy in the high-precision tetrahedral elements obtained in the final discretization.

[0026] Furthermore, the amount of constraint solution required by the traditional FEM algorithm is directly proportional to the number of tetrahedral elements. That is, each tetrahedral element corresponds to a set of FEM constraint equations. The more elements there are, the more equations need to be solved. However, the computing power of mobile CPUs is limited and cannot support the iterative solution of a large number of constraint equations.

[0027] Specifically, in game scenes, the visual representation of soft objects (such as cloth and character clothing) relies on high-precision triangular meshes. These meshes typically have tens of thousands to hundreds of thousands of vertices to ensure clear display of surface wrinkles and detailed textures. To ensure the simulation results are consistent with the geometry of the triangular mesh, traditional FEM algorithms divide the internal tetrahedral units according to the precision standard of the triangular mesh (generating corresponding tetrahedral meshes). That is, the higher the vertex density of the triangular mesh, the higher the density of the tetrahedral units needs to be, resulting in a direct increase in the number of tetrahedral units as the precision of the triangular mesh increases. For example, if the triangular mesh contains 100,000 vertices, the number of tetrahedral units ultimately discretized by the traditional FEM algorithm may reach hundreds of thousands or even millions, far exceeding the computing power capacity of a mobile CPU.

[0028] Therefore, in this embodiment, by converting the high-precision triangular mesh into a low-precision tetrahedral mesh and establishing the corresponding mapping relationship, unnecessary FEM constraints are reduced and computational power consumption is alleviated.

[0029] To address this, the Isosurface Stuffing algorithm can be used to generate low-precision tetrahedral meshes. This algorithm can quickly generate tetrahedral element sets with far fewer vertices than the original triangular meshes, while maintaining "good dihedral angles" (avoiding extremely long or flat tetrahedral elements to prevent numerical ill-conditioning during subsequent constraint solving). Specifically, it can reduce the number of vertices in the tetrahedral mesh to 1%-10% of the number of vertices in the triangular mesh. For example, if the original triangular mesh contains 100,000 vertices, the number of vertices in the tetrahedral mesh generated by this algorithm can be reduced to less than 1,000, directly reducing the number of subsequent FEM constraints by approximately two orders of magnitude. Traditional FEM algorithms, however, do not employ this efficient mesh reduction technique and still rely on the traditional "mapping discretization" method, directly generating tetrahedral elements based on the vertex and facet information of the high-precision triangular mesh. This fails to achieve an effective conversion from "high-precision surface" to "low-precision interior," resulting in the inability to reduce the number of tetrahedral elements.

[0030] Correspondingly, several high-precision triangular meshes of the soft body object in the current frame are obtained, and a low-precision tetrahedral mesh is generated for each high-precision triangular mesh using the Isosurface Stuffing algorithm. That is, a tetrahedral mesh containing several vertices Ve and several tetrahedral units Te is generated based on the vertex Vt set and face Ft set of the triangular mesh.

[0031] Simultaneously, each vertex Vt of the high-precision triangular mesh is bound to its corresponding tetrahedral element Te to generate a mapping table between the high-precision triangular mesh and its corresponding low-precision tetrahedral mesh. Specifically, for each vertex Vt of the high-precision triangular mesh, the tetrahedral element Te containing vertex Vt is located more quickly using ray-mapping or spatial hashing, and the binding is completed based on the centroid coordinates of the tetrahedral element Te and vertex Vt, thus establishing a functional relationship between vertex Vt and vertex Ve of the tetrahedral element Te, as shown below: , in, , , , Denotes the four vertices Ve of the tetrahedral element Te. , , , They represent , , , The weights of the four vertices Ve are given, and the sum of the weights is 1.

[0032] It should be noted that the weight of vertex Ve corresponds to one component of the centroid coordinate of the tetrahedral element Te, and the weight of vertex Ve can be expressed as: , in, This represents the spatial volume between the barycenter coordinates of the tetrahedral element Te and the plane containing the i-th vertex Ve. This represents the total volume of the tetrahedral unit Te.

[0033] Based on the above, a high-precision triangular mesh vertex Vt-tetrahedral cell vertex Ve-weight relationship mapping can be constructed, and all mapping relationships can be integrated to obtain a soft body object relationship mapping table with respect to the high-precision triangular mesh and the corresponding low-precision tetrahedral mesh.

[0034] Furthermore, the above steps are processed by the mobile device's CPU, and the processed relational mapping table is then transferred to the GPU to complete subsequent processing operations and soft body object rendering.

[0035] Step S200: For each low-precision tetrahedral mesh, calculate the offset of each vertex Ve of the low-precision tetrahedral mesh converging to the constraint position based on the energy density function, and update the position of each vertex Ve of the low-precision tetrahedral mesh accordingly.

[0036] It should be noted that FEM constraint solving is the core computational step in soft body simulation. Traditional FEM algorithms suffer from problems such as "compression rebound failure" and "computational overload" due to defects in the energy density model and serial calculation. For example, the STVK energy density model cannot return to its original state after the tetrahedron is compressed to a certain extent, causing the soft body to "deform and freeze," which cannot meet the dynamic deformation requirements in the game. The Corotated linear energy density model requires matrix factorization operations, and the calculation time for a single calculation is 3-5 times that of ordinary models, resulting in a large performance overhead. When the tetrahedron is compressed too small, the Neo-Hookean model calculates force values ​​that tend to be infinite, causing vertex overflow (numerical explosion), which makes the simulation process prone to crashing, and so on.

[0037] Therefore, in this implementation, a two-pronged approach of "model innovation + parallel optimization" is adopted to achieve stable and efficient FEM constraint solving on mobile devices.

[0038] To address this, the Stable Neo-Hookean model is adopted to circumvent various shortcomings of traditional energy density models. Specifically, the Stable Neo-Hookean model modifies the energy function of the traditional Neo-Hookean model by introducing a "numerical stability term," thereby resolving the problems of "compression-springback failure" and "numerical explosion." The energy density function can be expressed as: , in, The Cauchy-Green tensor trace reflects the degree of stretching of the tetrahedral element, ensuring the rationality of the stretching deformation. The deformation gradient determinant reflects the volume change of the tetrahedral element, through... The introduction of this [mechanism] controls the increase in force during volume compression within a limited range, preventing numerical explosion. , The Lamé parameters, as adjustable elastic coefficients, control the "shear stiffness" and "volume stiffness" of the soft body, respectively. This allows for parameter adjustments based on different soft body types (such as softer fabrics or stiffer muscles), thereby enhancing the realism of the simulation.

[0039] Furthermore, the essence of FEM constraint solving is to iteratively solve multiple constraint equations. If serial computation is used, the soft body physics simulation calculation and rendering time for each frame will increase linearly with the number of constraints. However, the ClusterGraphColoring algorithm can divide "independent constraints" into the same "color group", allowing constraints in the same color group to be solved concurrently on the GPU.

[0040] Therefore, the number of constraints in each color group can be strictly controlled to within 64, thus deeply matching the "thread group scheduling mechanism" of mobile GPUs. For example, most mobile GPUs can accommodate 32-64 threads in a single thread group, and 64 constraints can just fill a thread group, avoiding waste of thread resources. At the same time, through the synchronization mechanism within the thread group, there is no need to repeatedly initiate the GPU kernel (kernel function). A single kernel can complete the constraint solving for all color groups multiple times, greatly reducing the communication overhead between the CPU and GPU. Compared to initiating a kernel for each set of constraints, the time consumed by communication overhead is reduced.

[0041] Specifically, for the mapping table of the relationship between the soft body object in the current frame and the corresponding low-precision tetrahedral mesh, since the soft body object is represented by several high-precision triangular meshes, for each set of high-precision triangular meshes and its corresponding low-precision tetrahedral mesh, by inputting the set of all vertices Ve of the low-precision tetrahedral mesh, the offset of each vertex Ve from converging to the constraint position is calculated. This refers to the changes in the current frame after physical calculation compared to the previous frame, as shown below: ,and , in, The derivative of the mass of the i-th vertex of the tetrahedral element (used to calculate acceleration, affecting the motion response speed of the soft body). Represents the Stable Neo-Hookean energy density function. This represents the partial derivative of the energy density function with respect to the i-th vertex of the tetrahedral element. It represents the elastic modulus of the tetrahedral element (controlling the stiffness of the flexible body). Indicates the time step of the current frame (matched to the game frame rate to ensure that the physics simulation and screen rendering are synchronized).

[0042] Finally, vertex Ve is updated to .

[0043] Step S300: For each vertex Vt in the high-precision triangular mesh, the position of vertex Vt is adjusted using the updated vertex Ve of the tetrahedral unit according to the functional relationship between all vertices Ve of the tetrahedral unit bound to it, so as to correct the spatial shape of the high-precision triangular mesh.

[0044] After the FEM constraint solution is completed, the deformation of the low-precision tetrahedral mesh needs to be transferred back to the high-precision triangular mesh in order to correct the spatial morphology of the high-precision triangular mesh.

[0045] Specifically, in this embodiment, GPU kernel functions are written using CUDA or OpenCL, allowing each thread to independently process a high-precision triangular mesh vertex Vt. The thread reads the function relationships bound to vertex Vt and its corresponding tetrahedral cell Te and vertex Ve through a binding relationship mapping table, and readjusts the position of vertex Vt based on the updated vertex Ve.

[0046] Understandably, the parallel computing capabilities of GPUs can process tens of thousands or even hundreds of thousands of triangle mesh vertices simultaneously, with actual speeds far exceeding the serial computing capabilities of CPUs, thus meeting the real-time requirements of games.

[0047] In addition, the normals, tangents and other data required for rendering will be updated simultaneously to ensure visual realism.

[0048] Understandably, the normals of the triangular mesh directly affect the lighting and shadow rendering effect. If only the vertex positions are updated without updating the normals, it will lead to "lighting and shadow mismatch". For example, after the soft body is bent, the lighting and shadow still show a flat effect.

[0049] Specifically, for each triangular facet, the cross product of its three vertices can be calculated to obtain the facet's normal. Furthermore, the facet normals of all faces sharing the same vertex can be weighted and averaged according to facet area or angle to obtain the vertex's normal, thus avoiding normal data conflicts during multi-threaded computation.

[0050] Tangents are used to support normal mapping, which can improve surface details in the game. Specifically, they are calculated by taking the difference between the UV coordinates of the triangle vertices and combining it with the difference between the vertex positions to solve for the tangent vector, ensuring that the lighting effects of the normal map are synchronized with the vertex deformation.

[0051] It is evident that traditional processing methods, executed on the CPU, consume significant computing power, leading to a drop in game frame rates. This embodiment, however, utilizes GPU parallel migration to free up CPU resources while maintaining rendering quality.

[0052] Step S400: Render based on the high-precision triangular mesh after the soft body object is corrected to generate the image of the soft body in the current frame.

[0053] It should be noted that the steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they contain the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.

[0054] Example 2 Please see Figure 2 As shown, this embodiment also provides an online rendering system for soft bodies, applied to a mobile GPU, including: The communication module 10 is used to obtain a mapping table of the relationship between the high-precision triangular mesh and the corresponding low-precision tetrahedral mesh of the soft body object from the CPU of the mobile terminal; wherein, the low-precision tetrahedral mesh is generated based on the high-precision triangular mesh and contains a number of tetrahedral cells; the mapping table records the tetrahedral cells bound to each vertex Vt of the high-precision triangular mesh, as well as the functional relationship between the high-precision triangular mesh and all vertices Ve of the tetrahedral cells.

[0055] The calculation module 20 is used to calculate, for each low-precision tetrahedral mesh, the offset of each vertex Ve of the low-precision tetrahedral mesh converging to the constraint position based on the energy density function, and update the position of each vertex Ve of the low-precision tetrahedral mesh accordingly; and, for each vertex Vt in the high-precision triangular mesh, adjust the position of vertex Vt using the updated vertex Ve of the tetrahedral cell according to the functional relationship between all vertices Ve of the tetrahedral cell bound to it, so as to correct the spatial shape of the high-precision triangular mesh.

[0056] The rendering module 30 is used to render based on the high-precision triangular mesh corrected by the soft body object to generate the image of the current frame of the soft body.

[0057] It should be noted that the online rendering system for soft bodies provided in the above embodiments and the online rendering method for soft bodies provided in Embodiment 1 belong to the same concept. The specific methods by which each module and unit performs operations have been described in detail in the method embodiments and will not be repeated here. In practical applications, the online rendering method for soft bodies provided in Embodiment 1 can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. This is not a limitation here.

[0058] Example 3 Please see Figure 3 As shown, embodiments of this application also provide an electronic device, including a memory 2, a processor 1, and a program stored in the memory and executable on the processor, wherein the processor executes the steps of any of the methods described above.

[0059] The memory includes at least one type of readable storage medium, such as flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory can be an internal storage unit of an electronic device, such as a portable hard drive. In other embodiments, the memory can be an external storage device of the electronic device, such as a plug-in portable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory can include both internal and external storage units of the electronic device. The memory can be used not only to store application software and various types of data installed on the electronic device, but also to temporarily store data that has been output or will be output.

[0060] In some embodiments, a processor may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits packaged with the same or different functions. This includes combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor is the control unit of the electronic device, connecting various components of the device via various interfaces and lines. It executes programs or modules stored in the memory and calls data stored in the memory to perform various functions and process data within the electronic device.

[0061] The processor executes the operating system of the electronic device and various installed applications. The processor executes the applications to implement the steps in the above method embodiments.

[0062] For example, the program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of program instruction segments capable of performing a specific function, which describe the execution process of the program in the electronic device.

[0063] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium. This software functional module, stored in a storage medium, includes several instructions to cause a computer device (which may be a personal computer, computer equipment, or network device, etc.) or processor to execute some of the functions of the various embodiments of the present invention.

[0064] In summary, this invention breaks through the traditional understanding that "high-precision simulation must require high-precision meshes". By binding and mapping "high-precision triangular mesh - low-precision tetrahedral mesh", the amount of computation is compressed to the range that mobile devices can bear while ensuring simulation accuracy.

[0065] Meanwhile, this invention also introduces the Stable Neo-Hookean model, which solves the three major pain points of traditional models in one go: "bounce failure", "numerical explosion" and "high performance overhead", providing stable core algorithm support for mobile soft body simulation.

[0066] This invention migrates the two computationally intensive steps of "constraint solving" and "mesh reconstruction" to the GPU, and maximizes the use of mobile GPU computing power through strategies such as ClusterGraphColoring and thread group optimization, while freeing up CPU resources for game logic processing.

[0067] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.

Claims

1. An online rendering method for soft bodies, characterized in that, GPUs used in mobile devices include: The CPU of the mobile device obtains a mapping table of the relationship between the high-precision triangular mesh and the corresponding low-precision tetrahedral mesh of the soft body object; wherein, the low-precision tetrahedral mesh is generated based on the high-precision triangular mesh and contains several tetrahedral elements; the mapping table records the tetrahedral elements bound to each vertex Vt of the high-precision triangular mesh, as well as the functional relationship between the high-precision triangular mesh and all vertices Ve of the tetrahedral elements. For each low-precision tetrahedral mesh, the offset of each vertex Ve of the low-precision tetrahedral mesh converging to the constraint position is calculated based on the energy density function, and the position of each vertex Ve of the low-precision tetrahedral mesh is updated accordingly. For each vertex Vt in the high-precision triangular mesh, the position of vertex Vt is adjusted using the updated vertex Ve of the tetrahedral cell according to the functional relationship between all vertices Ve of the tetrahedral cell bound to it, so as to correct the spatial shape of the high-precision triangular mesh. Rendering is performed based on a high-precision triangular mesh corrected from the soft body object to generate the current frame of the soft body.

2. The online rendering method for soft bodies according to claim 1, characterized in that, The steps for generating the mapping table between high-precision triangular meshes and corresponding low-precision tetrahedral meshes of soft-body objects include: Obtain several high-precision triangular meshes of the soft body object in the current frame; For each high-precision triangular mesh, the corresponding low-precision tetrahedral mesh is generated using the Isosurface Stuffing algorithm. Each vertex Vt of the high-precision triangular mesh is bound to a tetrahedral cell of the corresponding low-precision tetrahedral mesh to generate a corresponding relational mapping table.

3. The online rendering method for soft bodies according to claim 2, characterized in that, The steps of binding each vertex Vt of the high-precision triangular mesh with the tetrahedral element of the corresponding low-precision tetrahedral mesh to generate the corresponding relational mapping table include: For each vertex Vt of the high-precision triangular mesh, the tetrahedral cell containing vertex Vt is located using ray detection or spatial hashing, and then associated with vertex Vt.

4. The online rendering method for soft bodies according to claim 1, characterized in that, The functional relationship between the vertices Vt of the high-precision triangular mesh and all vertices Ve of the corresponding tetrahedral elements is expressed as follows: , in, , , , The four vertices Ve of the tetrahedral unit are represented. , , , They represent , , , The weights of the four vertices Ve are given, and the sum of the weights is 1.

5. The online rendering method for soft bodies according to claim 4, characterized in that, The weight of a vertex Ve is one of the components of the centroid coordinates of the corresponding tetrahedral element.

6. The online rendering method for soft bodies according to claim 4, characterized in that, The formula for calculating the weight of vertex Ve is as follows: , in, Let represent the spatial volume between the centroid coordinates of the tetrahedral element and the plane containing the i-th vertex Ve. This represents the total volume of a tetrahedral unit.

7. The online rendering method for soft bodies according to claim 1, characterized in that, offset The calculation formula is as follows: ,and , in, The derivative representing the mass of the i-th vertex of a tetrahedral element. Represents the energy density function, This represents the partial derivative of the energy density function with respect to the i-th vertex of the tetrahedral element. This represents the elastic modulus of a tetrahedral element. Indicates the time step of the current frame.

8. The online rendering method for soft bodies according to claim 1, characterized in that, The updated vertex Ve of the low-precision tetrahedral mesh is represented as: ; in, This is the offset of vertex Ve.

9. The online rendering method for soft bodies according to claim 1, characterized in that, The energy density function adopts the Stable Neo-Hookean model, and the energy density function C is expressed as: , in, For the Cauchy-Green tensor trace, For the deformable gradient determinant, , For Lamé parameters.

10. The online rendering method for soft bodies according to claim 1, characterized in that, For each vertex Vt in the high-precision triangular mesh, based on the functional relationship between all vertices Ve of the tetrahedral cells bound to it, the position of vertex Vt is adjusted using the updated vertex Ve of the tetrahedral cells to correct the spatial shape of the high-precision triangular mesh, and the method further includes: After the high-precision triangular mesh is corrected, its corresponding normals and tangents are updated.