Adaptive error correction methods for fabric penetration, and their systems, electronic devices, and storage media
By employing an adaptive error correction method for fabric penetration, this method detects and corrects clothing penetration issues in real time, improving detection efficiency and reducing costs. It also enhances fabric simulation effects and is suitable for applications such as video games and virtual reality, especially on devices with limited performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 珠海剑心互动娱乐有限公司
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-26
AI Technical Summary
In modern video games and virtual reality applications, cloth simulation technology suffers from a penetration phenomenon, causing clothing to pass through the character's body incorrectly, affecting visual effects and user immersion, especially in low frame rate environments. Existing technologies that improve computational accuracy and frequency increase the processor burden and are inefficient.
An adaptive error correction method for fabric penetration is adopted. By acquiring initial data and simulation results, physical calculation, heuristic detection and adaptive error correction compensation are performed to detect and correct the penetration of fabric vertices in real time. Low-cost penetration compensation is achieved by using heuristic detection and dynamic recovery mechanisms.
It improves penetration detection efficiency, reduces detection costs, enhances real-time fabric simulation effects, ensures the natural dynamic performance and visual smoothness of the fabric, and is suitable for equipment with limited performance.
Smart Images

Figure CN122089923A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer graphics processing technology, and in particular to an adaptive error correction method for cloth penetration and its system, electronic device and storage medium. Background Technology
[0002] In modern video games, virtual reality, and digital human applications, providing realistic dynamic effects for virtual character clothing is a key technology to enhance visual realism and user immersion. This is typically achieved through real-time cloth physics simulation, which uses computer programs to simulate the natural movement and collision effects of clothing such as skirts and capes under the influence of character movement and external forces (such as wind). However, current cloth simulation technologies, especially on devices with limited computing power like mobile phones, suffer from a serious visual problem: the "penetration" phenomenon. Specifically, when a character performs fast movements such as running, a portion of their clothing (e.g., the hem of a long skirt) incorrectly passes through the character's body model (e.g., the legs) and gets stuck inside or in front of the body after the movement stops, creating an unnatural and erroneous visual effect that significantly disrupts the user's immersion. This problem is particularly severe in low frame rate (i.e., low screen refresh rate) environments because the simulation calculation step is too large, causing the system to fail to accurately capture the moment of contact between the cloth and the body.
[0003] The mainstream technical solutions to the aforementioned fabric penetration problem in existing technologies mainly include: The first solution is to improve the computational accuracy and frequency of physical simulation: by performing more iterative calculations per unit time, collisions can be detected more accurately, thereby reducing the occurrence of penetration. However, this solution will drastically increase the computational burden on the processor, resulting in high penetration detection costs and low penetration detection efficiency. For mobile devices that are already under performance constraints, this will seriously affect the overall smoothness of applications. Summary of the Invention
[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a fabric penetration adaptive error correction method and system, electronic device, and storage medium, which can improve penetration detection efficiency, reduce penetration detection cost, and improve the real-time simulation effect of fabric.
[0005] In a first aspect, embodiments of this application provide a fabric penetration adaptive error correction method, including: When simulating the current frame image, the first initial data of the current frame image and the first simulation result of the previous frame image are obtained; the first initial data includes: the cloth mesh data and character skeleton data of the current frame image, wherein the cloth mesh data includes each cloth vertex; The first initial data and the first simulation result are subjected to physical calculation processing to obtain the initial physical simulation position of each of the cloth vertices in the current frame image; Based on the initial physical simulation position and the character skeleton data, a state judgment process based on heuristic detection is performed on each of the cloth vertices to determine the penetration status of each cloth vertex; Adaptive error correction and compensation processing is performed based on the penetration status of each fabric vertex and the initial physical simulation position to obtain the target physical position of each fabric vertex; The rendering simulation is performed based on the target physical position of each cloth vertex, and the second simulation result of the current frame image is output.
[0006] Secondly, this application provides a fabric penetration adaptive error correction system, comprising: The data input module is used to acquire the first initial data of the current frame image and the first simulation result of the previous frame image when the simulation of the current frame image begins; the first initial data includes: cloth mesh data and character skeleton data of the current frame image, wherein the cloth mesh data includes each cloth vertex; The physics calculation module is used to perform physics calculation processing on the first initial data and the first simulation result to obtain the initial physical simulation position of each of the cloth vertices in the current frame image; The penetration detection module is used to perform heuristic detection-based state judgment processing on each of the cloth vertices based on the initial physical simulation position and the character skeleton data to determine the penetration status of each of the cloth vertices. The dynamic recovery module is used to perform adaptive error correction and compensation processing based on the penetration status of each fabric vertex and the initial physical simulation position to obtain the target physical position of each fabric vertex. The output module is used to perform rendering simulation processing based on the target physical position of each cloth vertex and output the second simulation result of the current frame image.
[0007] Thirdly, embodiments of this application provide an electronic device, including at least one processor and a memory for communicatively connecting to the at least one processor; the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the fabric penetration adaptive error correction method as described in any of the embodiments of the first aspect.
[0008] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the fabric penetration adaptive error correction method as described in any of the embodiments of the first aspect.
[0009] This application embodiment includes: in the process of simulating cloth using a cloth penetration adaptive error correction system, firstly, when simulating the current frame image, acquiring the first initial data of the current frame image and the first simulation result of the previous frame image; the first initial data includes: cloth mesh data and character skeleton data of the current frame image, wherein the cloth mesh data includes each cloth vertex; secondly, performing physical calculation processing on the first initial data and the first simulation result to obtain the initial physical simulation position of each cloth vertex in the current frame image; then, performing heuristic detection-based state judgment processing on each cloth vertex according to the initial physical simulation position and the character skeleton data to determine the state of each cloth vertex. The penetration status of vertices is assessed. During cloth simulation, heuristic-based state judgment processing is used to detect penetrating cloth vertices in real time and at low cost, improving penetration detection efficiency and reducing penetration detection costs. Then, adaptive error correction and compensation processing is performed based on the penetration status of each cloth vertex and the initial physical simulation position to obtain the target physical position of each cloth vertex. Penetration compensation is achieved through adaptive error correction and compensation, allowing the cloth to exhibit natural dynamic behavior, thus improving the real-time cloth simulation effect. Finally, rendering simulation processing is performed based on the target physical position of each cloth vertex, outputting the second simulation result of the current frame image, further improving the real-time cloth simulation effect. In other words, the embodiments of this application can improve penetration detection efficiency, reduce penetration detection costs, and improve the real-time cloth simulation effect. Attached Figure Description
[0010] Figure 1 This is a schematic diagram of a system architecture for performing an adaptive error correction method for fabric penetration according to an embodiment of this application; Figure 2 This is a flowchart illustrating an embodiment of the adaptive error correction method for fabric penetration provided in this application; Figure 3 This is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0011] 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.
[0012] It should be noted that although a logical order is shown in the flowcharts in this application, in some cases, the steps shown or described may be performed in a different order than that shown in the flowcharts. In the description of this application, "several" means one or more, and "more" means two or more. The terms "first" and "second" are used only to distinguish technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of technical features indicated, or implicitly indicating the order in which the technical features are indicated.
[0013] 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 embodiments of this application only and is not intended to limit this application.
[0014] This application provides a fabric penetration adaptive error correction method, a fabric penetration adaptive error correction system, an electronic device, and a computer-readable storage medium, which can improve penetration detection efficiency, reduce penetration detection cost, and improve the real-time simulation effect of fabric.
[0015] The embodiments of this application will be further described below with reference to the accompanying drawings.
[0016] like Figure 1 As shown, the fabric penetration adaptive error correction system 100 includes: a data input module 110, a physical calculation module 120, a penetration detection module 130, a dynamic recovery module 140, and an output module 150.
[0017] Specifically, during the cloth penetration adaptive error correction system 100's cloth simulation process, the data input module 110 is used to acquire the first initial data of the current frame image and the first simulation result of the previous frame image when the simulation of the current frame image begins; the first initial data includes: cloth mesh data and character skeleton data of the current frame image, and the cloth mesh data includes each cloth vertex; the physics calculation module 120 is used to perform physics calculation processing on the first initial data and the first simulation result to obtain the initial physical simulation position of each cloth vertex in the current frame image; the penetration detection module 130 is used to perform heuristic detection-based state judgment processing on each cloth vertex according to the initial physical simulation position and character skeleton data to determine the penetration status of each cloth vertex; the dynamic recovery module 140 is used to perform adaptive error correction compensation processing according to the penetration status of each cloth vertex and the initial physical simulation position to obtain the target physical position of each cloth vertex; the output module 150 is used to perform rendering simulation processing according to the target physical position of each cloth vertex to output the second simulation result of the current frame image.
[0018] According to the fabric penetration adaptive error correction system 100 provided in the embodiments of this application, the data input module 110, the physical calculation module 120, the penetration detection module 130, the dynamic recovery module 140 and the output module 150 cooperate to implement the fabric penetration adaptive error correction method provided in the embodiments of this application, which can improve penetration detection efficiency, reduce penetration detection cost and improve the real-time simulation effect of fabric.
[0019] It should be noted that the fabric penetration adaptive error correction system 100 provided in this application embodiment can exist as a functional enhancement module of an existing fabric simulation engine (such as a PBD-based, i.e., Position Based Dynamics, a method based on position dynamics).
[0020] It is understood that the fabric penetration adaptive error correction system 100 provided in this application embodiment achieves the following three beneficial effects: First, it achieves dynamic detection: that is, during the fabric simulation process, it detects the fabric vertices that have penetrated in real time and at low cost. Second, it achieves smooth recovery: that is, after detecting penetration, instead of forcibly removing the point, it introduces a progressive recovery mechanism based on animation guidance, so that the fabric can smoothly and naturally recover to the correct state outside the collision body over a period of time. Third, it balances effect and performance: it does not significantly increase the computational load of conventional physics simulation, and can effectively solve the penetration problem while maintaining the natural dynamic effect of the fabric, and can run stably on devices with limited performance such as mobile phones, thereby significantly improving the user's visual experience in various application scenarios.
[0021] The fabric penetration adaptive error correction system can perform fabric penetration adaptive error correction, integrating "heuristic penetration detection", "animation-guided dynamic weighting" and "controllable progressive recovery" into one, reducing computational costs and solving the penetration problem in real-time fabric simulation.
[0022] Those skilled in the art will understand that the system structure shown in the figures does not constitute a limitation on the embodiments of this application, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0023] It will be understood by those skilled in the art that the system architecture and application scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. It is known by those skilled in the art that with the evolution of system architecture and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0024] Based on the above system structure, various embodiments of the fabric penetration adaptive error correction method of this application are proposed below.
[0025] like Figure 2 As shown, this fabric penetration adaptive error correction method can be applied to, for example... Figure 1 The fabric penetration adaptive error correction system shown may include, but is not limited to, steps S100 to S500.
[0026] Step S100: When simulating the current frame image, obtain the first initial data of the current frame image and the first simulation result of the previous frame image; the first initial data includes: the cloth mesh data and character skeleton data of the current frame image, and the cloth mesh data includes each cloth vertex.
[0027] Specifically, the cloth mesh data includes: each cloth vertex, the initial vertex position and topological relationship of the cloth vertex; the character skeleton data includes: collider data and the character's skeletal animation pose data for the current frame; among which, the collider data is usually composed of multiple spheres and capsules, used to approximate the character's body outline.
[0028] Specifically, this step is implemented through the data input module of the fabric penetration adaptive error correction system. It can be understood that step S100 acquires necessary data before the fabric simulation begins or at the start of each frame of image simulation, laying the data foundation for subsequent physical calculation processing, state judgment processing, and adaptive error correction compensation processing.
[0029] Step S200: Perform physical calculation processing on the first initial data and the first simulation result to obtain the initial physical simulation position of each cloth vertex in the current frame image.
[0030] Understandably, this is the core processing of conventional cloth simulation. Based on the initial data and the first simulation result of the previous frame image, according to preset physical laws (such as gravity and air resistance) and constraints (such as tension and bending constraints), the preliminary physical position of each cloth vertex in the current frame image is calculated without being affected by penetration recovery, and is denoted as the physical simulation position P_phys.
[0031] Specifically, step S200 is implemented through a physics calculation module. Step S200 enables the physical simulation calculation of the initial physical simulation position of each cloth vertex, facilitating subsequent state judgment processing based on heuristic detection.
[0032] Understandably, after the physics calculation module completes the calculation to obtain the initial physical simulation position of each cloth vertex, it is still necessary to use the penetration detection module to execute step S300 to determine the penetration status of each cloth vertex.
[0033] Step S300: Based on the initial physical simulation position and character skeleton data, perform heuristic detection-based state judgment processing on each cloth vertex to determine the penetration status of each cloth vertex.
[0034] Specifically, the character skeleton data includes: collider data and skeletal animation pose data.
[0035] Specifically, the fabric vertices are divided into a first vertex in a penetrating state and a second vertex in a non-penetrating state.
[0036] Specifically, the penetration status includes: being in a penetrating state and not being in a penetrating state.
[0037] According to some embodiments of this application, step S300 includes, but is not limited to, steps S310 to S320.
[0038] Step S310: Traverse each cloth vertex, perform penetration detection calculation based on the initial physical simulation position of the cloth vertex, collision data and skeletal animation pose data, and obtain the reference value corresponding to each cloth vertex.
[0039] Specifically, in the penetration detection calculation process, firstly, the skinned animation position of each cloth vertex under the skeletal animation pose data is determined; then, all cloth vertices are traversed to obtain the initial physical simulation position of each cloth vertex, and the initial physical simulation position of the cloth vertex is geometrically compared with the collider set of the character's body. For example, it is determined whether the initial physical simulation position P_phys of a cloth vertex is located inside a capsule. If it is, that is, a cloth vertex that has completely penetrated the capsule is found, then the cloth vertex is marked as "in a penetrated state" and classified as the first vertex; if not, the cloth vertex is marked as "not in a penetrated state" and classified as the second vertex.
[0040] Specifically, the reference value corresponding to the fabric vertex obtained through penetration detection calculation is denoted as A, and the formula for calculating the reference value A is: A=[(P_anim-C_collider) / ||P_anim-C_collider||]·[(P_sim-C_collider) / ||P_sim-C_collider||]; Where P_sim is the initial physics simulation position obtained after physics processing of the cloth vertex to be detected; P_anim is the skinned animation position corresponding to the cloth vertex to be detected; C_collider is the center point position of the set of colliders (such as spheres or capsules) associated with the cloth vertex to be detected. The operator · indicates that a vector dot product operation is performed.
[0041] Step S320: Based on the comparison between the reference value and the sensitivity threshold, determine the penetration status of each fabric vertex and designate each fabric vertex as the first vertex or the second vertex.
[0042] According to some embodiments of this application, step S320 includes, but is not limited to, steps S321 to S322.
[0043] Step S321: If the comparison result is that the reference value is less than the preset sensitivity threshold, determine that the fabric vertex is in a penetrating state, and determine the fabric vertex in the penetrating state as the first vertex.
[0044] Step S322: If the comparison result is that the reference value is not less than the preset sensitivity threshold, determine that the fabric vertex is not in a penetrating state, and determine the fabric vertex that is not in a penetrating state as the second vertex.
[0045] Furthermore, it can be understood that steps S310 to S320 constitute a heuristic detection process with extremely low computational cost. The specific heuristic is as follows: [(P_anim-C_collider) / ||P_anim-C_collider||]*[(P_sim-C_collider) / ||P_sim-C_collider||] <T; Where P_sim is the initial physical simulation position obtained after physical processing of the cloth vertex to be detected; P_anim is the skinned animation position corresponding to the cloth vertex to be detected; C_collider is the center point position of the set of colliders (such as spheres or capsules) associated with the cloth vertex to be detected. T is a preset sensitivity threshold, which is a preset negative threshold (e.g., T = -0.1) used to define the sensitivity of penetration.
[0046] Step S300 determines the penetration status of each cloth vertex to facilitate the subsequent determination of the target physical location of each cloth vertex; and during the cloth simulation process, state judgment processing based on heuristic detection is performed to detect the cloth vertex that has penetrated in real time and at low cost, thereby improving the penetration detection efficiency and reducing the penetration detection cost.
[0047] Step S400: Perform adaptive error correction and compensation processing based on the penetration status of each cloth vertex and the initial physical simulation position to obtain the target physical position of each cloth vertex.
[0048] According to some embodiments of this application, step S400 includes, but is not limited to, steps S410 to S430.
[0049] Step S410: Based on the skeletal animation pose data and collision data, the initial physical simulation position of the first vertex is dynamically restored to obtain the first target position of the first vertex.
[0050] Understandably, step S410 is executed by the dynamic recovery module, which mainly processes the first vertex that is in a penetrated state.
[0051] According to some embodiments of this application, step S410: dynamically restore the initial physical simulation position of the first vertex based on the skeletal animation pose data and collision data to obtain the first target position of the first vertex, including but not limited to steps S411 to S413.
[0052] Step S411: Determine the skinned animation position of the first vertex under the skeletal animation pose data.
[0053] Specifically, in this step, the skinned animation position (P_anim) of the first vertex in the skeletal animation pose data is obtained to facilitate the subsequent determination of the safe restoration target position. The skinned animation position is used as a directional "ideal" reference, rather than a direct movement target.
[0054] Step S412: Determine the safe recovery target position on the collider surface included in the collider data based on the skin animation position; wherein the safe recovery target position is the closest to the skin animation position.
[0055] In this step, a geometric calculation is performed: using the skinned animation position (P_anim) as a reference point, the point closest to the skinned animation position (P_anim) on the surface of the character's collider is calculated and recorded as the safe recovery target position (P_closest). As defined, the safe recovery target position (P_closest) ensures that it is located on the surface of the collider and will never be penetrated.
[0056] Step S413: Perform weighted interpolation based on the preset first sensitivity coefficient, the safe recovery target position, and the initial physical simulation position of the first vertex to obtain the updated first target position.
[0057] In this step, specifically, the first sensitivity coefficient is denoted as S, which is a preset parameter that can be adjusted by the user.
[0058] This application makes the restoration process controllable by setting an adjustable first sensitivity coefficient. This first sensitivity coefficient is used to control the speed of the subsequent progressive restoration process, providing developers and artists with the flexibility to adjust effects according to different clothing and application scenarios.
[0059] According to some embodiments of this application, step S413: weighted interpolation is performed based on a preset first sensitivity coefficient, the safe recovery target position, and the initial physical simulation position of the first vertex to obtain an updated first target position, including but not limited to steps S4131 to S4134.
[0060] Step S4131: Calculate the second sensitivity coefficient based on the first sensitivity coefficient; wherein the sum of the first sensitivity coefficient and the second sensitivity coefficient is 1.
[0061] Specifically, the second sensitivity coefficient is denoted as M, where M = 1 - S.
[0062] Step S4132: Multiply the first sensitivity coefficient by the safe recovery target position to obtain the first weighted position.
[0063] Specifically, the first weighted position is S * P_closest.
[0064] Step S4133: Multiply the second sensitivity coefficient by the initial physical simulation position of the first vertex to obtain the second weighted position.
[0065] Specifically, the second weighted position is M * P_sim.
[0066] Step S4134: Add the first weighted position to the second weighted position to obtain the updated first target position.
[0067] Specifically, the formula for calculating the position of the first target is as follows: P_new= M * P_sim + S * P_closest=(1 - S) * P_sim + S * P_closest.
[0068] Specifically, through steps S4132 to S4134, a new first target position P_new is calculated by weighted interpolation of the initial physical simulation position (P_sim) of the first vertex currently erroneous and the safe recovery target position (P_closest). The first target position P_new is the final position of the first vertex after recovery processing. The first target position P_new is used to instruct the first vertex in the penetration state to move smoothly a small step along the direction towards the nearest safe surface to achieve penetration compensation.
[0069] Step S420: Determine the initial physical simulation position of the second vertex as the second target position of the second vertex.
[0070] In this step, it is understood that since the second vertex is not in a penetrating state, there is no need to dynamically restore the second vertex. The initial physical simulation position of the second vertex can be directly determined as the second target position of the second vertex.
[0071] Step S430: Obtain the physical location of the target based on the set of the first target location and the second target location.
[0072] In this step, it is understood that the target physical position of each cloth vertex needs to be used in the subsequent rendering simulation process. Therefore, the first target position and the second target position are obtained, which is the target physical position.
[0073] This application, through steps S410 to S430, introduces a preset, non-penetrating skinned animation position as a guide after penetration occurs. The first vertex, which was incorrectly positioned due to frame rate issues in the physical simulation, is then directionally guided back to its corresponding, considered correct, safe recovery target position through weighted calculation, thereby achieving penetration recovery. Furthermore, it implements a gradual, smooth recovery process: penetration is not resolved through a forced, single-frame "abrupt change" or "pullback," but rather by dynamically adjusting the weight coefficients (i.e., the first sensitivity coefficient), allowing the vertex to smoothly transition from a penetrated position to a non-penetrating position over several consecutive time steps (frames). This time-varying, gradual recovery algorithm ensures a smooth and natural visual effect, avoids abrupt changes, and does not affect the physical calculation process of vertices connected to these points.
[0074] Step S500: Perform rendering simulation processing based on the target physical position of each cloth vertex, and output the second simulation result of the current frame image.
[0075] In this step, the output module receives the set of target physical positions of all cloth vertices, and then outputs the set of target physical positions to the rendering engine to draw the current frame and obtain the second simulation result of the current frame image. At the same time, the second simulation result is used in the cloth simulation of the next frame image. The second simulation result is an initial state input for the cloth simulation process of a frame image.
[0076] According to some embodiments of this application, after outputting the second simulation result of the current frame image, i.e. after step S500, the fabric penetration adaptive error correction method further includes steps S600 to S1000.
[0077] Step S600: When starting to simulate the next frame image, obtain the second initial data of the current frame image and the second simulation result of the previous frame image; the second initial data includes: the cloth mesh data and character skeleton data of the current frame image, and the cloth mesh data includes each cloth vertex.
[0078] Step S700: Perform physical calculation processing on the second initial data and the second simulation results to obtain the initial physical simulation position of each cloth vertex in the current frame image.
[0079] Step S800: Based on the initial physical simulation position and character skeleton data, perform heuristic detection-based state judgment processing on each cloth vertex to determine the penetration status of each cloth vertex.
[0080] Step S900: Perform adaptive error correction and compensation processing based on the penetration status of each cloth vertex and the initial physical simulation position to obtain the target physical position of each cloth vertex.
[0081] Step S1000: Perform rendering simulation processing based on the target physical position of each cloth vertex, and output the third simulation result of the current frame image.
[0082] Understandably, in applications such as video games, virtual reality, and digital humans, cloth simulation is typically performed through animated videos. Therefore, after completing the cloth simulation for the current frame image through steps S100 to S500, the cloth simulation for the next frame image will be performed based on the second simulation result output in step S500. After obtaining the third simulation result through steps S600 to S1000, the cloth simulation for the next frame image will continue in this manner.
[0083] It is understood that the specific processes of steps S600 to S1000 are the same as those of steps S100 to S500 above, and the specific processes of steps S600 to S1000 will not be described again here.
[0084] In steps S100 to S500, during the cloth simulation using the cloth penetration adaptive error correction system, firstly, when simulating the current frame image, the first initial data of the current frame image and the first simulation result of the previous frame image are acquired; the first initial data includes: cloth mesh data and character skeleton data of the current frame image, and the cloth mesh data includes each cloth vertex; secondly, physical calculation processing is performed on the first initial data and the first simulation result to obtain the initial physical simulation position of each cloth vertex in the current frame image; then, based on the initial physical simulation position and the character skeleton data, heuristic detection-based state judgment processing is performed on each cloth vertex to determine the position of each cloth vertex. The paper investigates the penetration status of fabric vertices. During fabric simulation, a heuristic-based state judgment process is used to detect penetrating fabric vertices in real-time and at low cost, improving penetration detection efficiency and reducing penetration detection costs. Then, adaptive error correction and compensation processing is performed based on the penetration status of each fabric vertex and its initial physical simulation position to obtain the target physical position of each vertex. Penetration compensation is achieved through adaptive error correction and compensation, allowing the fabric to exhibit natural dynamic behavior, thus improving the real-time fabric simulation effect. Finally, rendering simulation processing is performed based on the target physical position of each fabric vertex, outputting the second simulation result of the current frame image, further improving the real-time fabric simulation effect. In other words, the embodiments of this application can improve penetration detection efficiency, reduce penetration detection costs, and improve the real-time fabric simulation effect.
[0085] It is important to emphasize that the mainstream technical solutions to the aforementioned fabric penetration problem in existing technologies mainly include: The first solution is to improve the computational accuracy and frequency of physical simulation: by performing more iterative calculations per unit time, collisions can be detected more accurately, thereby reducing penetration. However, this solution drastically increases the processor's computational burden, resulting in high penetration detection costs and low efficiency. For mobile devices already under performance constraints, this severely impacts the overall smoothness of applications. The second solution is to blend physical simulation results with pre-set skeletal animation. This technique pre-sets weights, allowing certain parts of the fabric (such as the top of the skirt near the waist) to follow the skeletal animation more, while allowing other parts (such as the hem) to be driven more by physics. This method can increase the stability of the fabric to some extent, preventing it from flying excessively. However, the solution of blending physical simulation results with pre-set skeletal animation cannot effectively solve the already occurring penetration problem. For a point of cloth that has already penetrated the body, simple physical calculations are insufficient to push it back into the correct position. The blending effect from skeletal animation is either too weak to free it, or the blending weight needs to be set too high, causing the cloth to appear too stiff and lose its flowing quality even in normal conditions. Therefore, this approach fails to achieve a good balance between resolving penetration and maintaining natural dynamics. Compared to the second approach in existing technologies, which involves a static blend of physics and animation, this application has the following significant advantages: First, it possesses intelligence and high targeting, shifting from "passive restriction" to "active error correction" when addressing fabric penetration issues: Existing technologies employ a passive, indiscriminate control strategy, failing to identify the specific error event of "penetration." This application introduces a heuristic detection mechanism, enabling it to proactively identify problems and activate the error correction and recovery mechanism only when a problem occurs. This on-demand intervention approach is more intelligent and efficient than continuous static mixing.
[0086] Secondly, this application resolves the dilemma of "stiff effects" and "failure to escape" in existing technologies: Existing technologies, in order to solve penetration, either increase animation weights, causing the cloth to appear stiff under normal conditions, or maintain physical weights, failing to allow the penetrating vertices to escape. This application resolves this contradiction. When not penetrating, the cloth can be entirely driven by physics, exhibiting the most natural dynamic effects; only at the moment of penetration is animation used to guide its recovery. This allows for both natural cloth dynamics and system stability.
[0087] Third, it achieves a smooth and natural visual restoration effect: Even if existing technologies attempt to solve the penetration problem through forced means (such as forcibly pulling the point back), it often causes visual positional abruptness and a sense of jump. This application uses progressive weighted restoration to distribute the error correction process across multiple consecutive frames, ensuring that the transition of the fabric from the penetrated state to the normal state is smooth and physically intuitive, greatly improving visual quality and user experience.
[0088] Fourth, it has extremely low computational cost and is suitable for performance-constrained platforms: The heuristic detection and dynamic weighted calculation in this application are both very lightweight operations, and are only invoked when a few vertices are penetrated. Compared with the "increase simulation frequency" solution that requires huge overhead, the performance loss of this application is almost negligible, making it very suitable for deployment on mobile devices with limited performance and power consumption, such as mobile phones, and has extremely high practical value.
[0089] like Figure 3 As shown, this application also provides an electronic device, including: The processor 301 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 302 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 302 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 302 and called and executed by the processor 301 using the fabric penetration adaptive error correction method of the embodiments of this application. Input / output interface 303 is used to implement information input and output; The communication interface 304 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 305 transmits information between various components of the device (e.g., processor 301, memory 302, input / output interface 303, and communication interface 304); The processor 301, memory 302, input / output interface 303, and communication interface 304 are connected to each other within the device via bus 305.
[0090] This application also provides a fabric calculation program based on the PDB framework. The fabric calculation program based on the PDB framework includes computer instructions, which, when executed by a processor, implement the above-mentioned adaptive error correction method for fabric penetration.
[0091] The fabric penetration dynamic recovery method and system provided in this application bring the following significant benefits: First, it implements a condition-triggered error correction mechanism, rather than continuous hybrid detection: The cloth penetration adaptive error correction system of this application is not a static, always-on physical / animation hybrid system. Instead, the cloth penetration adaptive error correction method and system include a "detect first, then recover" control mechanism: a heuristic method is used to determine the occurrence of a penetration event, and the subsequent recovery process is only initiated after penetration is detected; thus, an intelligent and efficient proactive error correction mechanism is achieved. Through the "detect first, then recover" mechanism, penetration errors that have occurred can be proactively and accurately identified, and targeted processing is performed only on the erroneous vertices. This completely changes the "one-size-fits-all" and passive static hybrid or restriction strategy in existing technologies, allowing system resources to be used only to solve actual problems, achieving a high degree of intelligence and computational efficiency.
[0092] Secondly, it ensures excellent visual smoothness: the core advantage of this application lies in its "progressive" recovery process. By smoothly and controllably shifting the penetration point towards the "nearest safe point on the colliding surface," the correction action is distributed across several consecutive rendering frames, thus completely avoiding the visual jump caused by abrupt position changes. This ensures that the cloth's dynamic performance remains smooth and natural during the automatic "escape" process, greatly enhancing the user's visual experience.
[0093] Third, it solves the problem of balancing effect and stability: existing technologies force developers to make difficult trade-offs between "natural cloth dynamics" and "avoiding penetration and jamming." This application, however, allows the cloth to fully follow physical calculations most of the time, displaying the richest and most realistic dynamic effects; only in the rare instances of penetration does it gracefully intervene to guide and restore the cloth. This allows for both dynamic expressiveness and physical stability of the cloth, fundamentally resolving the inherent contradictions of existing technologies.
[0094] Fourth, it has extremely low computational cost and high practical value: the heuristic detection (vector dot product) and recovery calculation (nearest point query and interpolation) on which the entire solution relies are both lightweight operations with extremely low computational cost. This enables this application to efficiently solve the penetration problem without sacrificing the overall frame rate of the application, and is especially suitable for mobile platforms such as mobile phones where performance and power consumption are strictly limited, making it highly practical for engineering and has great potential for widespread adoption.
[0095] This application embodiment also provides a storage medium, which is a computer-readable storage medium, storing a computer program that, when executed by a processor, implements the above-described fabric penetration adaptive error correction method.
[0096] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate, and 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 embodiment according to actual needs.
[0097] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0098] The above provides a detailed description of the preferred embodiments of this application. However, this application is not limited to the above-described embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by this application.
Claims
1. A fabric penetration adaptive error correction method, characterized in that, include: When simulating the current frame image, the first initial data of the current frame image and the first simulation result of the previous frame image are obtained; The first initial data includes: cloth mesh data of the current frame image and character skeleton data, wherein the cloth mesh data includes each cloth vertex; The first initial data and the first simulation result are subjected to physical calculation processing to obtain the initial physical simulation position of each of the cloth vertices in the current frame image; Based on the initial physical simulation position and the character skeleton data, a state judgment process based on heuristic detection is performed on each of the cloth vertices to determine the penetration status of each cloth vertex; Adaptive error correction and compensation processing is performed based on the penetration status of each fabric vertex and the initial physical simulation position to obtain the target physical position of each fabric vertex; The rendering simulation is performed based on the target physical position of each cloth vertex, and the second simulation result of the current frame image is output.
2. The fabric penetration adaptive error correction method according to claim 1, characterized in that, The character skeleton data includes: collider data and skeleton animation pose data; the cloth vertices are divided into first vertices in a penetrating state and second vertices in a non-penetrating state. The step of performing heuristic-based state judgment processing on each cloth vertex based on the initial physical simulation position and the character skeleton data to determine the penetration status of each cloth vertex includes: Traverse each of the cloth vertices, and perform penetration detection calculations based on the initial physical simulation position of the cloth vertex, the collider data, and the skeletal animation pose data to obtain a reference value corresponding to each cloth vertex; Based on the comparison between the reference value and the sensitivity threshold, the penetration status of each fabric vertex is determined, and each fabric vertex is identified as the first vertex or the second vertex.
3. The fabric penetration adaptive error correction method according to claim 2, characterized in that, The penetration status includes: being in a penetrating state and not being in a penetrating state; determining the penetration status of each fabric vertex based on the comparison result between the reference value and the preset sensitivity threshold, and identifying each fabric vertex as the first vertex or the second vertex, includes: If the comparison result shows that the reference value is less than the preset sensitivity threshold, it is determined that the fabric vertex is in a penetrating state, and the fabric vertex in the penetrating state is determined as the first vertex; If the comparison result is that the reference value is not less than the preset sensitivity threshold, it is determined that the fabric vertex is not in a penetrating state, and the fabric vertex that is not in a penetrating state is determined as the second vertex.
4. The fabric penetration adaptive error correction method according to claim 2, characterized in that, The adaptive error correction and compensation process, based on the penetration status of each fabric vertex and the initial physical simulation position, yields the target physical position of each fabric vertex, including: Based on the skeletal animation pose data and the collider data, the initial physical simulation position of the first vertex is dynamically restored to obtain the first target position of the first vertex; The initial physical simulation position of the second vertex is determined as the second target position of the second vertex; The physical location of the target is obtained based on the first target location and the second target location set.
5. The fabric penetration adaptive error correction method according to claim 4, characterized in that, The step of dynamically restoring the initial physical simulation position of the first vertex based on the skeletal animation pose data and the collider data to obtain the first target position of the first vertex includes: Determine the skinned animation position of the first vertex under the skeletal animation pose data; A safe recovery target position is determined on the surface of the collider included in the collider data based on the skin animation position; wherein the safe recovery target position is at the minimum distance from the skin animation position; The updated first target position is obtained by performing weighted interpolation based on the preset first sensitivity coefficient, the safe recovery target position, and the initial physical simulation position of the first vertex.
6. The fabric penetration adaptive error correction method according to claim 5, characterized in that, The step of performing weighted interpolation processing based on a preset first sensitivity coefficient, the safe recovery target position, and the initial physical simulation position of the first vertex to obtain the updated first target position includes: The second sensitivity coefficient is calculated based on the first sensitivity coefficient; wherein the sum of the first sensitivity coefficient and the second sensitivity coefficient is 1. Multiply the first sensitivity coefficient by the target location of safe recovery to obtain the first weighted location; The second sensitivity coefficient is multiplied by the initial physical simulation position of the first vertex to obtain the second weighted position; The first weighted position is added to the second weighted position to obtain the updated first target position.
7. The fabric penetration adaptive error correction method according to any one of claims 1 to 6, characterized in that, After outputting the second simulation result of the current frame image, the method further includes: When starting to simulate the next frame image, the second initial data of the current frame image and the second simulation result of the previous frame image are obtained; the second initial data includes: the cloth mesh data and character skeleton data of the current frame image, wherein the cloth mesh data includes each cloth vertex; The second initial data and the second simulation results are subjected to physical calculation processing to obtain the initial physical simulation position of each of the cloth vertices in the current frame image; Based on the initial physical simulation position and the character skeleton data, a state judgment process based on heuristic detection is performed on each of the cloth vertices to determine the penetration status of each cloth vertex; Adaptive error correction and compensation processing is performed based on the penetration status of each fabric vertex and the initial physical simulation position to obtain the target physical position of each fabric vertex; The rendering simulation is performed based on the target physical position of each cloth vertex, and the third simulation result of the current frame image is output.
8. A fabric penetration adaptive error correction system, characterized in that, include: The data input module is used to acquire the first initial data of the current frame image and the first simulation result of the previous frame image when the simulation of the current frame image begins; The first initial data includes: cloth mesh data of the current frame image and character skeleton data, wherein the cloth mesh data includes each cloth vertex; The physics calculation module is used to perform physics calculation processing on the first initial data and the first simulation result to obtain the initial physical simulation position of each of the cloth vertices in the current frame image; The penetration detection module is used to perform heuristic detection-based state judgment processing on each of the cloth vertices based on the initial physical simulation position and the character skeleton data to determine the penetration status of each of the cloth vertices. The dynamic recovery module is used to perform adaptive error correction and compensation processing based on the penetration status of each fabric vertex and the initial physical simulation position to obtain the target physical position of each fabric vertex. The output module is used to perform rendering simulation processing based on the target physical position of each cloth vertex and output the second simulation result of the current frame image.
9. An electronic device, characterized in that, It includes at least one processor and a memory for communicatively connecting to the at least one processor; the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the fabric penetration adaptive error correction method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the fabric penetration adaptive error correction method as described in any one of claims 1 to 7.