Soft object rendering method and device, equipment, storage medium and program product

By dividing molecular frames in a virtual scene and using the XPBD method to solve the motion calibration parameter, the problem of poor simulation effect of complex soft body objects is solved, and the simulation accuracy and authenticity are improved.

CN120339479APending Publication Date: 2025-07-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410067082.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-16
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

When simulating complex soft body objects, the prior art has problems such as poor simulation effect, low accuracy and edge-breaking defects, especially in the collision detection and response of multi-layer clothing and complex fabrics.

Method used

Using the XPBD-based soft object rendering method, by dividing molecular frames in adjacent video frames, using the pre-constructed constraint data set to solve motion calibration parameters, improve the efficiency and accuracy of collision detection and response, and optimize the simulation effect.

Benefits of technology

It realizes stable and reliable simulation of complex soft body objects, reduces edge-breaking defects, improves simulation accuracy and performance effects, and enhances the sense of reality in virtual scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120339479A_ABST
    Figure CN120339479A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a flexible object rendering method and device, equipment, a storage medium and a program product, and is at least applied to the field of cloud technology and the field of games. The method comprises the following steps: acquiring parameter information of a collision object in video frames of a virtual scene at two adjacent moments, an initial physical model of a flexible object in a video frame at a previous moment in the two moments, and a constraint data set of the physical model of the flexible object; dividing the video frame at the previous moment into a plurality of subframes; determining the parameter information of the collision object in each subframe based on the parameter information of the collision object in the video frame; for each sub-frame, based on the parameter information of the collision object in the sub-frame and the initial physical model, resolving each piece of motion constraint information in the constraint data set to obtain a motion calibration parameter of the flexible object in the sub-frame; and rendering the flexible object in the sub-frame based on the motion calibration parameter. According to the invention, the display effect of the flexible object can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of the Internet, and relate to, but are not limited to, a method, apparatus, device, storage medium, and program product for rendering a flexible object. Background Technique

[0002] With the development of computer technology, virtual scenes are more and more widely used. There are usually flexible objects in a virtual scene. The flexible object is, for example, the clothes worn by a character in the virtual scene, and can also be a curtain or a handkerchief in the virtual scene. In the process of real-time rendering of a virtual scene, the flexible object is usually further rendered by simulating the flexible object. For example, the physical model of the cloth can be modeled through cloth simulation, and then the cloth is rendered and displayed based on the physical model of the cloth. At the same time, since the state of the flexible object changes under the action of an external force, it is necessary to consider the action of the external force on the flexible object to make the rendered flexible object more realistic.

[0003] In the related art, cloth simulation usually uses the NvCloth cloth solver to perform cloth simulation for games. NvCloth adopts a particle-based spring system model and regards the cloth as an elastic system composed of a large number of particles and springs. By modeling the physical properties of the particles and springs, the physical properties such as the elasticity, gravity, and friction of the cloth can be simulated. At the same time, a grid-based collision detection and response technology is adopted to detect the collision between the cloth and other objects and respond to the collision, and self-collision detection and response are supported.

[0004] However, for complex flexible objects in the related art, such as multi-layer clothing, the accurate physical model of the cloth cannot be established during cloth simulation at present, so there are problems such as poor simulation effect and broken edge defects in high-precision cloth, which affect the simulation effect. Summary of the Invention

[0005] The embodiments of the present application provide a method, apparatus, device, storage medium, and program product for rendering a flexible object, which can be applied to at least the cloud technology field or the game field, and can accurately simulate the physical model of the flexible object, thereby improving the display effect of the flexible object.

[0006] The technical solution of the embodiments of the present application is realized as follows:

[0007] An embodiment of the present application provides a method for rendering a flexible object, including: during the running of a virtual scene, obtaining parameter information of a collision object in video frames of the virtual scene at two adjacent moments, an initial physical model of the flexible object in the video frame at the previous moment of the two moments, and a constraint data set of the physical model of the flexible object pre-constructed; the initial physical model includes initial parameters required for physically simulating the form of the flexible object at the previous moment; the constraint data set includes multiple different types of motion constraint information; dividing the video frame at the previous moment into multiple sub-frames, each sub-frame corresponding to a moment within the time interval between the two moments; determining the parameter information of the collision object in each sub-frame based on the parameter information of the collision object in the video frames of the two moments; for each sub-frame, resolving each motion constraint information in the constraint data set based on the parameter information of the collision object in the sub-frame and the initial physical model to obtain the motion calibration parameter of the flexible object in the sub-frame; and rendering the flexible object in the sub-frame based on the motion calibration parameter.

[0008] An embodiment of the present application provides a flexible object rendering device, including: an obtaining module, configured to obtain parameter information of a collision object in video frames of the virtual scene at two adjacent moments, an initial physical model of the flexible object in the video frame at the previous moment of the two moments, and a constraint data set of the physical model of the flexible object pre-constructed during the running of the virtual scene; the initial physical model includes initial parameters required for physically simulating the form of the flexible object at the previous moment; the constraint data set includes multiple different types of motion constraint information; a sub-frame dividing module, configured to divide the video frame at the previous moment into multiple sub-frames, each sub-frame corresponding to a moment within the time interval between the two moments; a determining module, configured to determine the parameter information of the collision object in each sub-frame based on the parameter information of the collision object in the video frames of the two moments; a resolving module, configured to, for each sub-frame, resolve each motion constraint information in the constraint data set based on the parameter information of the collision object in the sub-frame and the initial physical model to obtain the motion calibration parameter of the flexible object in the sub-frame; and a rendering module, configured to render the flexible object in the sub-frame based on the motion calibration parameter.

[0009] An embodiment of the present application provides an electronic device, including: a memory, configured to store executable instructions; a processor, configured to implement the above flexible object rendering method when executing the executable instructions stored in the memory.

[0010] An embodiment of the present application provides a computer program product, which includes executable instructions stored in a computer-readable storage medium; wherein a processor of an electronic device reads the executable instructions from the computer-readable storage medium and implements the above-mentioned soft body object rendering method when executing the executable instructions.

[0011] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute the executable instructions to implement the above-mentioned soft body object rendering method.

[0012] The embodiments of the present application have the following beneficial effects:

[0013] When rendering a soft body object, firstly, a physical simulation of the soft body object is performed, and the motion calibration parameters of the initial physical model of the soft body object are determined, so that the initial parameters in the initial physical model are modified based on the motion calibration parameters, and the physical model that can accurately characterize the simulated soft body object is obtained, and then the rendering of the soft body object is completed. In the implementation process, when performing physical simulation, the video frame of the previous moment of the video frames of two adjacent moments is divided into multiple subframes, and each subframe is used as the basis for simulation, and different motion constraint information in the constraint data set of the physical model of the pre-constructed soft body object is solved, so as to obtain the motion calibration parameters of the soft body object in each subframe. In this way, since the physical simulation is performed according to each subframe, it is ensured that for the soft body object whose skeletal animation moves too violently or complexly, a stable and reliable simulation result can be obtained, that is, accurate motion calibration parameters are obtained, so that the initial physical model of the soft body object can be accurately calibrated based on the motion calibration parameters, thereby improving the physical simulation effect of the soft body object. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 It is an optional architecture diagram of a soft body object rendering system provided in an embodiment of the present application;

[0015] Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0016] Figure 3 It is an optional flowchart of the soft body object rendering method provided in the embodiment of the present application;

[0017] Figure 4 is another optional flowchart of the soft body object rendering method provided in an embodiment of the present application;

[0018] Figure 5 It is a schematic diagram of the implementation process of solving the distance constraint parameters provided in the embodiment of the present application;

[0019] Figure 6It is a schematic diagram of the implementation process for solving the bending constraint parameters provided by an embodiment of the present application;

[0020] Figure 7 It is a schematic diagram of the implementation process for solving the self - collision constraint parameters provided by an embodiment of the present application;

[0021] Figure 8 It is a schematic diagram of the implementation process for solving the continuous collision detection constraint parameters provided by an embodiment of the present application;

[0022] Figure 9 It is an effect optimization test resource for the cloth physical simulation method provided by an embodiment of the present application;

[0023] Figure 10 It is another effect optimization test resource for the cloth physical simulation method provided by an embodiment of the present application;

[0024] Figure 11 It is a simulation effect diagram of the cloth physical simulation method provided by an embodiment of the present application;

[0025] Figure 12 It is a schematic diagram of the wrinkle effect provided by an embodiment of the present application;

[0026] Figure 13 It is a schematic diagram of the rendered visual effect provided by an embodiment of the present application;

[0027] Figure 14 It is a schematic diagram of the principle for solving the motion constraint information provided by an embodiment of the present application;

[0028] Figure 15 It is a schematic diagram of the principle for solving the bending constraint parameters provided by an embodiment of the present application;

[0029] Figure 16 It is a schematic diagram of the principle for solving the self - collision constraint parameters provided by an embodiment of the present application;

[0030] Figure 17 It is a schematic diagram of the principle for solving the continuous collision detection constraint provided by an embodiment of the present application. Detailed implementation manners

[0031] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.

[0032] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. It can be understood, however, that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict. Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by those skilled in the technical field to which the embodiments of the present application belong. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0033] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other relevant parts to achieve a predetermined goal and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of the module or unit.

[0034] Before describing the method for rendering a flexible object provided in the embodiments of the present application, the professional terms involved in the embodiments of the present application are first described:

[0035] (1) Responsive to, which is used to represent the conditions or states on which the executed operations depend. When the dependent conditions or states are satisfied, one or more executed operations can be real-time or can have a set delay; without special indication, there is no restriction on the execution sequence of the multiple executed operations.

[0036] (2) Constraint-based physical simulation technology (PBD, Position Based Dynamics): PBD simulates the dynamic behavior of an object by imposing a series of constraints on the position of each particle. In PBD, each particle has a position vector and a velocity vector, and is connected to adjacent particles by springs. These springs can represent various different types of forces, such as gravity, air resistance, etc. At the same time, various constraint conditions, such as length limits, angle limits, etc., are also introduced in PBD. When an external force acts on these particles, they will move and deform. Then, iterative calculations are performed according to the set constraint conditions and applied to all relevant particles to maintain authenticity. Since PBD uses simple and efficient numerical methods to solve nonlinear problems and is easy to parallelize, it has been widely used in the field of computer graphics. For example, in game development, it can be used to simulate soft objects such as cloth and hair; in film and television special effects, it can also be used to generate realistic water wave effects, etc.

[0037] (3) Extended Position - Based Dynamics (XPBD): Used to simulate the physical behavior of rigid and flexible bodies. XPBD is an extension of the traditional PBD method, aiming to address some limitations and problems of PBD in flexible body simulation. XPBD achieves higher stability and accuracy by iterating multiple times in each simulation step. XPBD uses constraints to simulate the interactions and constraint conditions between objects, such as collisions, connections, and constraints. These constraints are satisfied through iterative solutions, and the positions of particles are adjusted to meet the constraint conditions. Compared with traditional PBD, XPBD introduces more types of constraints and more complex constraint - solving methods to more accurately simulate the behavior of objects. XPBD can be used to simulate various objects, including cloth, soft bodies, ropes, liquids, etc., and has certain advantages in terms of computational efficiency and stability. Generally speaking, XPBD is an advanced position - constraint dynamics method for simulating the physical behavior of rigid and flexible bodies, providing more accurate and stable simulation results by introducing more constraints and improving the solving method.

[0038] (4) Cloth physics simulation: A computer simulation technology based on physical principles, used to simulate the physical behavior and movement of cloth in the real world. Through cloth physics simulation, physical properties such as the elasticity, friction, and air resistance of cloth can be simulated to achieve a more realistic cloth simulation effect. In games, cloth physics simulation can be used to simulate the movement and deformation of items such as characters' clothes, hair, and canvases to enhance the realism and visual effects of the scene.

[0039] In the cloth physics simulation methods in related technologies, the NvCloth cloth solver is usually used for cloth simulation in games. However, the NvCloth cloth solver has some drawbacks in both collision and simulation aspects, limiting its scope of application and effectiveness in practical applications.

[0040] First, in terms of collision: The NvCloth cloth solver has problems such as serious interpenetration of multiple layers of complex cloth, high self - collision overhead, and inability to collide with the scene. These problems result in poor collision effects when the NvCloth cloth solver simulates multiple layers of complex cloth, high performance overhead after enabling CCD, and also poor effects. At the same time, the high self - collision overhead makes the effect ineffective, and the inability to collide with the scene also limits the scope of application of the NvCloth cloth solver in practical applications.

[0041] Second, in terms of simulation: The NvCloth cloth solver has problems such as poor simulation effects for large - area and complex cloth, and frayed edge defects for high - precision cloth, which affect the simulation effect. These problems limit the simulation effect of the NvCloth cloth solver in practical applications.

[0042] Based on at least one of the above problems existing in the related art, the embodiment of the present application proposes a soft body object rendering method based on the XPBD solver, which is used to realize the physical simulation of cloth to improve the effect of cloth simulation. The soft body object rendering method provided by the embodiment of the present application, in terms of collision, is based on the XPBD solver, adopts a more efficient collision detection and response technology, supports more complex collision effects, and can effectively solve the problems of serious interpenetration of multi-layer complex cloth, high self-collision overhead, and inability to collide with the scene. At the same time, by optimizing the collision detection and response technology, better collision effects can be achieved, multi-layer collision effects are controllable, self-collision effects are good, and collision interaction with the scene can be performed, further improving the effect and performance of cloth simulation. In terms of simulation, the simulation algorithm is optimized to improve the simulation effect and accuracy, reduce the occurrence rate of broken edge defects, and can effectively solve the problems of poor simulation effect of large-area and complex cloth, and broken edge defects of high-precision cloth, and further improve the effect and performance of cloth simulation. It can be seen that through the improvement and optimization of the embodiment of the present application, the performance and effect of cloth physical simulation can be further improved, and its scope of use and effect in practical applications can be expanded.

[0043] Specifically, in the method for rendering a soft body object provided by an embodiment of the present application, first, in the process of running a virtual scene, parameter information of collision objects in video frames of the virtual scene at two adjacent moments, an initial physical model of the soft body object in the video frame of the previous moment of the two moments, and a constraint data set of a pre-constructed physical model of the soft body object are obtained; the initial physical model includes initial parameters required for physically simulating the shape of the soft body object at the previous moment; the constraint data set includes multiple different types of motion constraint information; then, the video frame of the previous moment is divided into multiple subframes, each subframe corresponds to a moment within the time interval between the two moments; and based on the parameter information of the collision objects in the video frames of the two moments, the parameter information of the collision objects in each subframe is determined; then, for each subframe, based on the parameter information of the collision objects in the subframe and the initial physical model, each motion constraint information in the constraint data set is solved to obtain the motion calibration parameters of the soft body object in the subframe; finally, based on the motion calibration parameters, the soft body object in the subframe is rendered. In this way, since physical simulation is performed according to each sub-frame, a stable and reliable simulation result can be obtained for soft-body objects whose skeletal animation moves too violently or complexly, that is, accurate motion calibration parameters can be obtained, so that the initial physical model of the soft-body object can be accurately calibrated based on the motion calibration parameters, thereby improving the physical simulation effect of the soft-body object.

[0044] Before explaining the method for rendering a flexible object according to an embodiment of the present application, first, an exemplary application of the flexible object rendering device according to an embodiment of the present application will be described here. The flexible object rendering device is an electronic device for implementing the method for rendering a flexible object. In one implementation, the flexible object rendering device (i.e., the electronic device) provided by the embodiment of the present application can be implemented as a terminal or a server. In one implementation, the flexible object rendering device provided by the embodiment of the present application can be implemented as a laptop computer, a tablet computer, a desktop computer, a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable game device, a smart robot, a smart home appliance, and a smart vehicle device, etc., any terminal with a game video display function and a game application running function; in another implementation, the flexible object rendering device provided by the embodiment of the present application can also be implemented as a server. Among them, the server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (CDN, Content Delivery Network), and big data and artificial intelligence platforms. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiments of the present application. Next, an exemplary application will be described when the flexible object rendering device is implemented as a terminal.

[0045] See Figure 1 , Figure 1 FIG. is an optional architecture diagram of the flexible object rendering system provided by the embodiment of the present application. To accurately display the flexible object in the video frame corresponding to the virtual scene during the operation of the virtual scene, a virtual scene application (any game application) can be provided. The virtual scene application provides a flexible object rendering function. The virtual scene is run by running the virtual scene application, and during the operation of the virtual scene, the flexible object rendering function can be synchronously called to accurately render the flexible object in the video frame of the virtual scene.

[0046] The flexible object rendering system 10 according to the embodiment of the present application at least includes a terminal 100, a network 200, and a server 300. A virtual scene application is installed on the terminal 100, where the server 300 can be the server of the virtual scene application. The terminal 100 can constitute the flexible object rendering device according to the embodiment of the present application, that is, the method for rendering a flexible object according to the embodiment of the present application is implemented through the terminal 100. The terminal 100 is connected to the server 300 through the network 200. The network 200 can be a wide area network or a local area network, or a combination of the two. See Figure 1, when running a virtual scene application on the running terminal 100, the user can perform operation control through the client of the virtual scene application to realize the running of the virtual scene application. During the running of the virtual scene application, a corresponding virtual scene video will be generated. When rendering the virtual scene video, in order to ensure the accurate rendering of the soft body object in the virtual scene video and avoid bad display effects such as object penetration, the soft body object rendering method provided by the embodiments of the present application can be used to render the soft body object.

[0047] In the implementation process, the terminal 100 can send a control instruction for any virtual object in the virtual scene to the server 300 through the network 200. After receiving the control instruction, the server 300 will continuously respond to the control instruction through a virtual scene engine (such as a game engine) and continuously generate a virtual scene video. During the process of generating the virtual scene video, the parameter information of the collision objects in the video frames of the virtual scene at two adjacent moments, the initial physical model of the soft body object in the video frame of the previous moment among the two moments, and the constraint data set of the physical model of the pre-constructed soft body object will be continuously obtained; the initial physical model includes the initial parameters required for physically simulating the shape of the soft body object at the previous moment; the constraint data set includes multiple different types of motion constraint information; then, the video frame of the previous moment is divided into multiple sub-frames, and each sub-frame corresponds to a moment within the time interval between the two moments; and based on the parameter information of the collision objects in the video frames of the two moments, the parameter information of the collision objects in each sub-frame is determined; then, for each of the sub-frames, based on the parameter information of the collision objects in the sub-frame and the initial physical model, each motion constraint information in the constraint data set is solved to obtain the motion calibration parameter of the soft body object in the sub-frame; finally, based on the motion calibration parameter, the soft body object in the sub-frame is rendered to obtain the rendered virtual scene video. After obtaining the rendered virtual scene video, the server 300 can send the virtual scene video to the terminal 100, and the terminal 100 displays the virtual scene video on the current interface.

[0048] The soft body object rendering method provided by the embodiments of the present application can also be implemented based on a cloud platform and through cloud technology. For example, the above-mentioned server 300 can be a cloud server. By running the virtual scene application on the cloud server, a virtual scene video of the virtual scene is generated, or, the motion calibration parameter of the soft body object in each sub-frame can also be determined through the cloud server, so as to accurately render the soft body object in each sub-frame based on the motion calibration parameter.

[0049] In some embodiments, a cloud storage may also be provided, and the constraint data set of the physical model of the flexible object can be stored in the cloud storage. In this way, when generating a virtual scene video and calibrating and rendering the flexible object, the constraint data set of the physical model of the flexible object can be directly obtained from the cloud storage, so as to quickly determine the motion calibration parameters of the flexible object in each sub-frame.

[0050] It should be noted here that cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data computing, storage, processing, and sharing. Cloud technology is the general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model, which can form a resource pool and be used on demand, flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark and needs to be transmitted to the background system for logical processing. Data at different levels will be processed separately, and various industry data requires a powerful system back-end support, which can be achieved through cloud computing.

[0051] Figure 2 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Figure 2 The illustrated electronic device may be a flexible object rendering device, and the flexible object rendering device includes: at least one processor 310, a memory 350, at least one network interface 320, and a user interface 330. Each component in the flexible object rendering device is coupled together through a bus system 340. It can be understood that the bus system 340 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 340 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 2 all kinds of buses are labeled as the bus system 340.

[0052] The processor 310 may be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or any conventional processor, etc.

[0053] The user interface 330 includes one or more output devices 331 that enable the presentation of media content, and one or more input devices 332.

[0054] The memory 350 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disc drives, etc. The memory 350 optionally includes one or more storage devices that are physically remote from the processor 310. The memory 350 includes volatile memory, non-volatile memory, or both volatile and non-volatile memory. The non-volatile memory can be Read Only Memory (ROM), and the volatile memory can be Random Access Memory (RAM). The memory 350 described in the embodiments of the present application is intended to include any suitable type of memory. In some embodiments, the memory 350 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, which are illustrated below.

[0055] The operating system 351 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks; the network communication module 352 is used to reach other computing devices via one or more (wired or wireless) network interfaces 320. Exemplary network interfaces 320 include: Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB), etc.; the input processing module 353 is used to detect and translate one or more user inputs or interactions from one of one or more input devices 332.

[0056] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2 A soft body object rendering device 354 stored in the memory 350 is shown. The soft body object rendering device 354 can be a soft body object rendering device in an electronic device, and it can be software in the form of programs and plugins, etc. It includes the following software modules: an acquisition module 3541, a sub-frame division module 3542, a determination module 3543, a solution module 3544, and a rendering module 3545. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described below.

[0057] In some embodiments, the device provided by the embodiments of the present application may be implemented in a hardware manner. As an example, the device provided by the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the soft object rendering method provided by the embodiments of the present application. For example, the processor in the form of a hardware decoding processor may employ one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.

[0058] The soft object rendering method provided by each embodiment of the present application may be executed by an electronic device. Among them, the electronic device may be a server or a terminal. That is, the soft object rendering method provided by each embodiment of the present application may be executed by a server, or may be executed by a terminal, or may also be executed through interaction between the server and the terminal.

[0059] Figure 3 is an optional flowchart of the soft object rendering method provided by the embodiments of the present application. The following will be described in conjunction with Figure 3 the steps shown. As Figure 3 shown, taking the execution entity of the soft object rendering method as a server as an example for description, the method includes the following steps S101 to step S105:

[0060] Step S101, during the process of running a virtual scene, obtain the parameter information of the collision object in the video frames of the virtual scene at two adjacent moments, the initial physical model of the soft object in the video frame of the previous moment among the two moments, and the constraint data set of the physical model of the soft object pre-constructed.

[0061] In the embodiments of the present application, the virtual scene can be understood as a scene displayed on the device screen. The virtual scene may be a visual and interactive virtual environment constructed by using tools such as computer technology and modeling software. The virtual scene may be a scene obtained by simulating a scene in the real world, such as a scene obtained by simulating an autonomous driving scene or a scenic spot playing scene in the real world; or, the virtual scene may also be a semi-simulated and semi-fictional scene, such as a scene with fictional characters superimposed in the simulated world corresponding to the real world; or, the virtual scene may also be a purely fictional scene, such as a game scene, a scene in a TV drama or a movie, etc.

[0062] The virtual scene may include at least one soft body object. The soft body object in the embodiments of the present application refers to an object that supports deformation during movement. For example: elements such as cloth, sponge, rubber, and rope in the virtual scene that are prone to deformation. The shape of the soft body object can change with its own movement in the virtual scene, or deform due to collisions with other objects (referred to as collision objects). For example, the clothes of a virtual game character in a game scene can change in position and its own shape as the virtual game character moves. Another example is that the flag in the game scene flutters under the action of wind. Other objects in the virtual scene except the soft body object can be called reference objects. These reference objects are all collision objects that support collisions with virtual elements, and can also be called collision bodies. Any reference object can be a static object element in the virtual scene, such as virtual grassland, virtual building. The reference object can also be a movable object in the virtual scene, such as a virtual character in a game scene, a virtual animal in a game scene, etc. It should be understood that the soft body object can collide with one or more collision bodies at a certain moment. For example, when a virtual character moves in a game scene, the clothes worn by the virtual character not only collide with the virtual character, but also collide with the virtual plants in the game scene. The soft body object can collide with different reference objects at different moments. For example, the clothes worn by the virtual character only collide with the virtual character at the current moment, while in the next moment, it not only collides with the virtual character, but also collides with the ground in the game scene.

[0063] During the process of running the virtual scene, the simulation of the soft body object can be realized by means of the physical model of the soft body object. The physical model of the soft body object is a model that describes the physical properties of the soft body object. Among them, the physical properties include mechanical properties, such as elasticity, rigidity, friction, etc. Based on the physical model, the movement and behavior of the soft body object in the virtual scene can be simulated. For example, based on the cloth model, the deformation and position change of the cloth in the virtual scene following the movement of the virtual character can be simulated. The current moment refers to the moment when physical simulation is performed, which can be the moment corresponding to any frame of the scene in the virtual scene, or any moment between any two frames of the scene. In the embodiments of the present application, the initial physical model of the soft body object is a model in which the initial parameters in the model are not corrected by the method of the embodiments of the present application. That is to say, the initial physical model is the physical model of the soft body object in the video frame of the currently generated initial video.

[0064] Here, a virtual scenario is taken as an example of the game scenario for illustration. During the operation of the game application, when a player operates on the client of the game application, for example, after performing an operation of moving one step to the left, raising a hand, viewing an item, etc., the server of the game application will respond to the player's operation. Correspondingly, a game video to be displayed on the client of the game application will be generated. However, this game video is an initial video, which includes a soft body object (such as clothes) and a collision object. This initial video is a video that has not accurately corrected the soft body object. That is to say, through the initial video, different objects displayed after the player's operation, as well as the initial positions and states of each object, can be reflected. However, in terms of the details of the displayed content, the soft body objects such as clothes in the initial video have not been accurately corrected. Naturally, there may be phenomena such as the clothes penetrating each other and unnatural movement. Therefore, it is necessary to further correct the initial video. Of course, in some embodiments, the initial video may also be two consecutive video frames generated after responding to the player's operation.

[0065] In the embodiments of the present application, the initial physical model includes the initial parameters required for physically simulating the form of the soft body object at the previous moment; that is to say, since the initial physical model is the physical model of the soft body object in the video frame of the currently generated initial video, therefore, the position and state information of the soft body object in the video frames of two adjacent moments (i.e., two adjacent video frames) are also recorded in this initial physical model. Based on this initial physical model, the soft body object can be rendered, but the rendered effect may be abnormal, such as phenomena of penetrating each other and unnatural movement.

[0066] The constraint dataset includes multiple different types of motion constraint information, and the motion constraint information refers to the information used to constrain the motion of the mass points in the soft body object. The motion constraint information includes different types of constraint information, and different types of constraint information will be described below.

[0067] The different motion constraint information in the constraint dataset can be pre-constructed. Each type of motion constraint information can be pre-constructed before running the virtual scenario, or the constraint dataset for all the soft body objects in this virtual scenario can be constructed during the development stage of the virtual scenario. During the entire rendering process of the soft body object, the motion constraint information in the constraint dataset remains fixed. Only by performing constraint solving under different motion constraint information through the initial physical model of the current soft body object, the motion calibration parameters for each mass point in the soft body object can be determined.

[0068] Step S102: Divide the video frame of the previous moment into multiple sub-frames, and each sub-frame corresponds to a moment within the time interval between two moments.

[0069] In the embodiments of the present application, since there is a certain time interval between two adjacent video frames, that is to say, the video frames at two adjacent moments correspond to a time interval. Therefore, this time interval can be divided into multiple sub-time intervals, and based on these sub-time intervals, multiple moments within the entire time interval can be obtained. Each moment corresponds to a sub-frame, and the sub-frame at each moment is the same as the video frame at the previous moment among the two adjacent video frames. That is, the video frame at the previous moment can be used as the sub-frame at each moment divided within the time interval.

[0070] When dividing the time interval, it can be divided at equal intervals or randomly at unequal intervals. For example, for the first and second adjacent video frames, if the display interval duration between the two video frames is 1 second, then, if the two video frames are equally spaced into 10 moments, the time step between adjacent moments is 0.1 second, and the last moment among the multiple moments is before the moment corresponding to the second video frame.

[0071] In the embodiments of the present application, the purpose of dividing the time interval into multiple sub-time intervals to obtain multiple sub-frames is to be able to correct the initial parameters of the soft body object in the video frame with a finer time granularity during subsequent constraint solving. And since multiple sub-frames are divided within the time interval, multiple corrections can be achieved within one time interval. That is to say, based on the known initial physical model of the soft body object (the initial parameters of each mass point in the soft body object), multiple corrections are made to the initial parameters of each mass point in the soft body object. Therefore, for situations where the skeletal animation moves too violently or the fabric is relatively complex (multi-layered, multi-creased), a stable and reliable correction result can be obtained.

[0072] Step S103: Determine the parameter information of the collision object in each sub-frame based on the parameter information of the collision object in the video frames at two moments.

[0073] Here, since the collision object in the video frame is an object that may collide with the soft body object, and during the movement of the soft body object, it will collide with the collision object. Therefore, when correcting the parameters (such as position and state) of the soft body object in each sub-frame, the parameter information of the collision object in this sub-frame also needs to be considered.

[0074] The parameter information of the collision object includes the position and rotation information of each mass point in the collision object. The parameter information of the collision object in the video frames at two moments can be obtained, and through information interpolation processing of the parameter information of the collision object in the video frames at two moments, the parameter information of the collision object in each sub-frame between the two times is obtained.

[0075] In the embodiments of the present application, the collision object can be any object in the virtual scene. For a collision object, multiple collision bodies can be obtained after simplification by corresponding geometric shapes, that is, a collision object can be composed of multiple collision bodies. For example, the object obtained by simplifying the limbs, torso, etc. of a virtual character through a capsule can be multiple collision bodies of the collision object, which is the virtual character. Geometrically, the collision body includes but is not limited to: capsule, sphere, cube, and collision bodies constructed based on triangles. In terms of motion attributes, the collision body includes but is not limited to: movable objects, such as virtual characters walking in the virtual scene; static objects, such as seats / tables / sofas in the virtual scene. The collision between a soft body object and a static object in the virtual scene can be called a scene collision, the collision between a soft body object and a movable object in the virtual scene can be called a character collision, and the collision of a soft body object with itself can be called a self-collision. For example, the cloth wrinkles and piles up when it collides with itself. It should be emphasized that the collision of a soft body object with itself can be understood as the collision between different mass points in the soft body object.

[0076] Step S104: For each sub-frame, based on the parameter information of the collision object in the sub-frame and the initial physical model, solve each motion constraint information in the constraint dataset to obtain the motion calibration parameters of the soft body object in the sub-frame.

[0077] In the embodiments of the present application, after determining the parameter information of the collision object and the initial physical model of the soft body object in each sub-frame, the parameter information of each mass point can be obtained from the initial physical model of the soft body object, and the parameter information of each mass point in the collision object can be obtained from the parameter information of the collision object. Then, based on the parameter information of each mass point of the soft body object and the parameter information of each mass point in the collision object, solve each motion constraint information in the constraint dataset, and it can be determined whether the parameter information of each mass point of the soft body object in the current sub-frame is reasonable or accurate, that is, the motion calibration parameters for correcting the parameter information of each mass point of the soft body object are determined.

[0078] The motion calibration parameters include correction parameters for correcting parameter information such as the position of each mass point in the soft body object. For different types of motion constraint information, the calculated correction parameters are different. After solving different motion constraint information respectively, multiple correction parameters can be obtained for each mass point. Therefore, multiple correction parameters can be parameter-fused to obtain the final correction parameters for overall correction of each mass point, and the final motion calibration parameters are obtained.

[0079] Here, parameter fusion may be summing up multiple correction parameters. For correction parameters with directions, if the directions of the correction parameters are different, a correction vector may be generated based on the directions of the correction parameters, the correction vector including correction parameters corresponding to different directions, and the correction vector constitutes the final correction parameter.

[0080] Step S105 , rendering the soft body object in the subframe based on the motion calibration parameters.

[0081] In an embodiment of the present application, after obtaining the motion calibration parameters, the initial parameters in the initial physical model of the soft body object can be corrected based on the motion calibration parameters, that is, the initial parameters in the initial physical model can be modified to obtain the corrected parameters. The corrected parameters include the parameters of each particle in the soft body object. After obtaining the corrected parameters, physical simulation can be performed based on the corrected parameters to obtain a physical model of the soft body object after the parameters are corrected. The physical model after the parameters are corrected is a physical model that can accurately display the soft body object. Therefore, rendering can be performed based on the physical model after the parameters are corrected, and the soft body object can be rendered into the video frame of the game video to obtain the final game video and display it.

[0082] The soft body object rendering method provided by the embodiment of the present application, when rendering the soft body object, firstly performs physical simulation of the soft body object, determines the motion calibration parameters for the initial physical model of the soft body object, and then modifies the initial parameters in the initial physical model based on the motion calibration parameters, obtains the physical model that can accurately characterize the simulated soft body object, and then completes the rendering of the soft body object. In the implementation process, when performing physical simulation, the video frame of the previous moment of the video frames of two adjacent moments is divided into multiple subframes, and each subframe is used as the basis for simulation, and the different motion constraint information in the constraint data set of the physical model of the pre-constructed soft body object is solved, so as to obtain the motion calibration parameters of the soft body object in each subframe. In this way, since the physical simulation is performed according to each subframe, it is ensured that for the soft body object whose skeletal animation moves too violently or complexly, a stable and reliable simulation result can be obtained, that is, accurate motion calibration parameters are obtained, so that the initial physical model of the soft body object can be accurately calibrated based on the motion calibration parameters, thereby improving the physical simulation effect of the soft body object.

[0083] The soft object rendering method provided by the embodiments of the present application can be applied to various fields, including but not limited to: game development, film and television production, fashion design, animation production, film production, etc. In the virtual scenes of these fields, the production of soft objects (such as fabrics) can be realized. Taking game development as an example, the virtual scene is a game scene, and the method of the embodiments of the present application can be used for fabric production in game development. In the face of fabrics with characteristics such as multiple layers, large areas, complex long gowns, multiple folds, multiple embellishments, and strong details, significant improvements in simulation effects can be achieved in terms of collision and simulation, so as to produce more delicate fabrics, improve the fabric effects in the game scene, and bring a better visual experience to users based on the improvement of the fabric effects, thereby enhancing the user experience and bringing benefits to game development.

[0084] The application scenarios of the soft object rendering method provided by the embodiments of the present application will be illustrated by examples below. The embodiments of the present application can be applied to at least any one of the following exemplary scenarios:

[0085] Scenario 1: During the operation of a game application, when a player operates on the client of the game application, the server of the game application will respond to the player's operation and generate a game video to be displayed on the client of the game application. When rendering the game video, an initial video corresponding to the operation can be determined based on the player's operation first. The initial video includes a soft body object and a collision object, and this initial video is a video that has not accurately corrected the clothes. At this time, the soft body object rendering method provided by the embodiments of the present application can be used to correct the display effect of the soft body object in the initial video. During the correction process, the initial video can be first frame-divided. For example, the initial video can be divided into multiple video frames according to a preset frame rate, so as to form a video frame sequence. Then, the soft body objects in each video frame in the video frame sequence are corrected in turn. For example, if the video frame sequence corresponding to the initial video includes 10 video frames, the first frame and the second frame are first corrected using the soft body object rendering method provided by the embodiments of the present application. That is to say, the first frame can be divided into multiple sub-frames, and then for each sub-frame in turn, the motion calibration parameters of the soft body object in the sub-frame are determined, and the position and state of the soft body object in the corresponding sub-frame are corrected based on the motion calibration parameters. Then, the second frame and the third frame are corrected using the soft body object rendering method provided by the embodiments of the present application. That is to say, the second frame can be divided into multiple sub-frames, and then for each sub-frame in turn, the motion calibration parameters of the soft body object in the sub-frame are determined, and the position and state of the soft body object in the corresponding sub-frame are corrected based on the motion calibration parameters. This process is repeated until the correction of the soft body objects in all video frames is completed, and then the soft body object is rendered based on the corrected parameters to obtain the final game video, which is a game video with a high display effect (that is, there will be no phenomena such as mutual penetration and unnatural movement).

[0086] For the soft body object correction method proposed in Scenario 1, since it is after determining the entire complete initial video (here, the initial video is not the complete video of the entire game operation process, but a video segment after responding to the player's current operation. Among them, the duration of this video segment may be very short, for example, it can be 100 milliseconds or 1 second. Therefore, even if the soft body object correction process is performed after determining the entire initial video, it is also possible for the corrected game video to be finally displayed in the game application), the soft body objects in each video frame in the initial video are corrected. In this way, the correction can be performed based on the information of the complete video, that is, the correction process is executed from the global perspective of the game video, so as to greatly ensure the accuracy of the correction.

[0087] Scenario 2: During the operation of a game application, when a player operates on the client side of the game application (such as an operation of moving one step to the left, a raising hand operation, an operation of viewing an item, etc.), the server of the game application will respond to the player's operation. Correspondingly, a game video to be displayed on the client side of the game application will be generated. When rendering the game video, based on the player's operation, an initial video corresponding to the operation can be determined. And when determining the initial video, when every two consecutive video frames are determined, the soft body object rendering method provided by the embodiments of the present application is adopted to correct the soft body object in the video frame at the previous moment among the currently determined two video frames. In the implementation process, when two video frames are determined, the previous video frame can be immediately divided into multiple sub-frames, and then for each sub-frame in turn, the motion calibration parameter of the soft body object in the sub-frame is determined, and based on this motion calibration parameter, the position and state of the soft body object in the corresponding sub-frame are corrected to obtain the corrected parameters of the soft body object in the video frame at the previous moment. After obtaining the corrected parameters of the soft body object, the position and state of the soft body object in this video frame can be updated based on these corrected parameters, that is, the soft body object in the video frame at the previous moment is rendered based on these corrected parameters, so as to obtain the corrected previous video frame. After that, after the second video frame and the third video frame are determined, the above method can also be used to correct the soft body object in the second video frame until the generation and correction process of all video frames in the game video is completed, so as to obtain the corrected game video and display the corrected game video. Among them, the corrected game video is a game video with a high display effect (that is, there will be no phenomena such as mutual penetration and unnatural movement).

[0088] For the soft body object correction method proposed in Scenario 2, since the soft body object rendering method provided by the embodiments of the present application is adopted every time two video frames are determined, thus, since the process of determining the video (i.e., the process of generating the video) and the process of correcting the soft body object in the video are carried out synchronously, therefore, the efficiency of video rendering can be greatly improved.

[0089] Next, taking the above Scenario 2 as an example, the soft body object rendering method of the embodiments of the present application will be described. Figure 4 is another optional flowchart of the soft body object rendering method provided by the embodiments of the present application, as Figure 4 shown, the method includes the following steps S201 to step S213:

[0090] Step S201, the terminal runs a virtual scene application and receives a control instruction for any virtual object in the virtual scene through the client side of the virtual scene application.

[0091] Here, during the operation of a game application (i.e., a virtual scene application), when a player operates on the client side of the game application, a control instruction can be generated. The control instruction can be for any virtual object in the game (such as a player character, backing into a parking space, etc.). For example, the player can perform an operation of moving one step to the left, raising a hand, or viewing an item. Correspondingly, a control instruction for moving one step to the left, a finger-raising instruction, a viewing item instruction, etc. can be generated.

[0092] Step S202, the terminal sends the control instruction to the server.

[0093] Step S203, the server generates at least two video frames of the virtual scene video at the current moment in response to the control instruction.

[0094] Here, after receiving the control instruction sent by the terminal, the server can generate at least two video frames of the virtual scene video at the current moment in response to the control instruction. The at least two video frames can be video frames in the initial video. The initial video refers to a video in which the parameters of the soft body object in the video have not been corrected.

[0095] Step S204, the server obtains the parameter information of the collision object in the video frames of the virtual scene at two adjacent moments, the initial physical model of the soft body object in the video frame at the previous moment of the two moments, and the constraint data set of the physical model of the soft body object pre-constructed.

[0096] In the embodiment of the present application, the initial physical model includes the initial parameters required for physically simulating the shape of the soft body object at the previous moment; the constraint data set includes multiple different types of motion constraint information. The server obtains the initial physical model of the soft body object in the video frame at the previous moment of the two moments, which can include the following two situations:

[0097] Situation 1: When the video frame at the previous moment is the first video frame in the virtual scene video corresponding to the virtual scene, the server can obtain the initial data for the soft body object sent by the object solver; and perform initial parameter configuration for each mass point in the initial physical model of the soft body object according to the initial data to obtain the initial physical model.

[0098] Here, the server obtains the initial data for the soft body object sent by the object solver, which can be achieved in the following way: First, before generating the first video frame in the virtual scene video, the server receives the parameter input operation for each mass point in the soft body object through the object solver; then, after the object solver summarizes the input parameters of each input mass point in response to the parameter input operation to obtain the initial data of the soft body object, the server receives the initial data for the soft body object sent by the object solver.

[0099] In the embodiments of the present application, a constructed flexible object can be directly loaded into an object solver, and then in response to a parameter input operation, input parameters for each particle in the flexible object are obtained. At this time, based on the input parameters of all the particles of the flexible object, a preliminary physical model of the flexible object can be formed to obtain the initial physical model at the current moment. After summarizing the input parameters for each particle in the flexible object, the initial data of the flexible object is obtained. At this time, the object solver can send the initial data of the flexible object to the server. The initial data of the flexible object may include pre-configured morphological data input through the parameter input operation. The pre-configured morphological data is configured after the flexible object is meshed into each particle, including but not limited to: the initial position and initial velocity of each particle in the flexible object in the virtual scene, etc.

[0100] In some embodiments, for each particle in the flexible object, parameter configuration can be performed multiple times. That is to say, after summarizing the parameters to obtain the initial data of the flexible object, parameter update configuration can also be performed for each particle in the flexible object in the object solver. The configured parameters include but are not limited to at least one of the following: the stretch stiffness in the stretch dimension, the bend stiffness in the bending dimension, the damping parameter, the mass parameter, etc. These parameters are beneficial to controlling the morphology and dynamic effects of the fabric. After configuring the corresponding parameters for each particle in the virtual element, the initial physical model of the flexible object can be obtained.

[0101] In the embodiments of the present application, the object solver can perform physical simulation based on the initial parameters of the configured flexible object to obtain the initial physical model of the flexible object. That is to say, the server can call the object solver to perform physical simulation on the morphology of the flexible object at the current moment according to the initial parameters of the flexible object. The object solver can be a physics-based cloth simulation engine. Through the cloth simulation engine, cloth physical simulation can be realized. Specifically, physical properties such as the elasticity, friction, and air resistance of the cloth can be simulated, and multiple constraint types and graphics processing unit (GPU) acceleration are supported to achieve high-quality cloth simulation effects.

[0102] Case 2: When the video frame of the previous moment is not the first video frame in the virtual scene video corresponding to the virtual scene, the server can obtain the physical model of the flexible object in the historical video frame that is before and adjacent to the video frame, and determine the physical model of the flexible object in the historical video frame as the initial physical model of the flexible object in the video frame of the previous moment.

[0103] In the embodiments of the present application, when the video frame at the previous moment among two adjacent moments is not the first video frame in the virtual scene video, the physical model of the soft body object in the historical video frame at the historical moment before the previous moment can be determined as the initial physical model of the soft body object in the video frame at the previous moment. That is to say, the physical model of the soft body object that has been determined previously can be migrated to the physical model of the soft body object in the video frames at two adjacent moments currently. In this way, since the historical video frame and the video frame at the previous moment are two adjacent video frames, and the change of the soft body object in the two video frames is not significant, when performing parameter correction on the soft body object in the video frame at the previous moment based on the physical model of the soft body object in the historical video frame, there will not be too much parameter change. Therefore, not only can the amount of calculated data be reduced, but also the accuracy of correction can be ensured.

[0104] In the embodiments of the present application, the server can obtain the parameter information of the collision object in the video frames at two adjacent moments of the virtual scene in the following way: First, the server obtains a control instruction for any virtual object in the virtual scene; the virtual object includes at least a collision object and a soft body object; then, the server determines the morphological data of each virtual object in the virtual scene at two moments in response to the control instruction; finally, the server determines the video frame at the corresponding moment and the parameter information of the collision object in the video frame respectively based on the morphological data at each moment.

[0105] The control instruction here can be the control instruction input in step S201. For example, it can be a control instruction to move one step to the left for any object in the game, a finger-lifting instruction, an instruction to view an item, etc. Since the server will generate the current initial video after responding to the control instruction, in the two adjacent video frames in this initial video, in addition to the soft body object, the morphological changes (such as position changes, etc.) of other collision objects will also occur, and the data of these two video frames are known. Only the morphological performance of the soft body object is abnormal and needs to be corrected for the soft body object, while for the collision object, the parameters are already known and are accurate parameters. Therefore, based on these two video frames, the morphological data of each virtual object (including the collision object and the soft body object) at two moments can be directly obtained. After obtaining the morphological data of each virtual object at two moments, the server can determine the parameter information of the collision object in the video frame at the corresponding moment respectively based on the morphological data at each moment.

[0106] In some embodiments, the motion constraint information in the constraint dataset of the physical model of the flexible object may include at least one of the following: distance constraint parameter, bending constraint parameter, self-collision constraint parameter, capsule constraint parameter, and continuous collision detection constraint parameter. Among them, the constraint dataset of the physical model of the flexible object can be constructed in the following manner: The server constructs the distance constraint parameter of each mass point in the physical model of the flexible object, and the distance constraint parameter is used to constrain the distance between the mass point and at least one other mass point; the server constructs the bending constraint parameter of each mass point in the physical model of the flexible object, and the bending constraint parameter is used to constrain the angle between the mass point and at least one other mass point; the server constructs the self-collision constraint parameter of each mass point in the physical model of the flexible object, and the self-collision constraint parameter is used to constrain the parameter information of the mass point when the mass point collides with at least one other mass point in the case of self-collision; the server constructs the capsule constraint parameter corresponding to each mass point in the physical model of the flexible object, and the capsule constraint is used to constrain the connection relationship between different parts of the flexible object; the server constructs the continuous collision detection constraint parameter corresponding to each mass point in the physical model of the flexible object, and the continuous collision detection constraint is used to constrain the parameter information of the mass point when the flexible object undergoes continuous collision during the movement process.

[0107] An explanation of the mass point is given here. A mass point is a point that has mass but no volume or shape, and it is an idealized model in physics. When the size and shape of an object do not play a role, or the role played is not significant and can be ignored, the object is approximately regarded as an ideal object that only has mass and its volume and shape can be ignored, and the mass point (mass point, particle) used to represent the object is called a mass point. In the embodiments of the present application, when constructing a flexible object, the flexible object can be meshed first to form multiple grid units, and then a grid unit is abstracted into a mass point. In this way, the processes such as collision detection and constraint resolution for the grid unit can be simplified into the processes such as collision detection and constraint resolution for a mass point. That is to say, the initial physical model of the flexible object is composed of multiple grid units, and each grid unit corresponds to a mass point. The server can also construct the constraint dataset of the physical model of the flexible object in the following manner: The server scans each grid unit in the initial physical model of the flexible object and adds the motion constraint information in the constraint dataset to the initial parameters of the mass point corresponding to each grid unit.

[0108] Step S205, the server divides the video frame of the previous moment into multiple sub-frames, and each sub-frame corresponds to a moment within the time interval between two moments.

[0109] In the embodiments of the present application, the purpose of dividing the time interval into multiple sub-time intervals to obtain multiple sub-frames is to be able to correct the initial parameters of the soft body object in the video frame with a finer time granularity during subsequent constraint resolution. Moreover, since multiple sub-frames are divided within the time interval, multiple corrections can be achieved within one time interval. That is to say, based on the known initial physical model of the soft body object (the initial parameters of each mass point in the soft body object), multiple corrections are made to the initial parameters of each mass point in the soft body object. Therefore, for situations where the skeletal animation moves too violently or the cloth is relatively complex (multi-layered, multi-creased), a stable and reliable correction result can be obtained.

[0110] Step S206, the server obtains the first parameter information of the collision object in the video frame at the previous moment and the second parameter information of the collision object in the video frame at the subsequent moment among two moments.

[0111] In the embodiments of the present application, after obtaining the morphological data of each virtual object at two moments, the server can respectively determine the parameter information of the collision object in the video frame at the corresponding moment based on the morphological data at each moment. Here, the parameter information of the collision object in the video frame at the previous moment is denoted as the first parameter information, and the parameter information of the collision object in the video frame at the subsequent moment is denoted as the second parameter information.

[0112] Step S207, the server performs information interpolation processing on the first parameter information and the second parameter information based on the previous moment and the subsequent moment to obtain the parameter information of the collision object in the sub-frame at each moment within the time interval.

[0113] Here, any interpolation method can be used for information interpolation processing, such as linear interpolation, polynomial interpolation, quadratic interpolation, spline interpolation, cubic spline interpolation, least squares interpolation, etc.

[0114] For example, when performing information interpolation processing based on the previous moment and the subsequent moment, the intermediate moment in the time interval can be first determined based on the previous moment and the subsequent moment, and linear interpolation can be performed based on the first parameter information and the second parameter information to determine the parameter information of the collision object in the sub-frame at the intermediate moment; then, the 1 / 4 moment in the time interval can be determined based on the previous moment and the intermediate moment, and linear interpolation can be performed based on the first parameter information and the parameter information at the intermediate moment to determine the parameter information of the collision object in the sub-frame at the 3 / 4 moment; at the same time, the 3 / 4 moment in the time interval can be determined based on the subsequent moment and the intermediate moment, and linear interpolation can be performed based on the second parameter information and the parameter information at the intermediate moment to determine the parameter information of the collision object in the sub-frame at the 3 / 4 moment. By analogy, the parameter information of the collision object in the sub-frame at each moment can be obtained.

[0115] Step S208: For each subframe, the server determines the motion constraint type corresponding to each motion constraint information and obtains the solution priorities for different motion constraint types.

[0116] Step S209: The server sorts all the motion constraint information according to the solution priorities to form a motion constraint information sequence.

[0117] Step S210: Based on the parameter information of the collision objects in the subframe and the initial physical model, the server sequentially solves each motion constraint information according to the motion constraint information sequence to obtain the motion calibration parameters of the flexible object in the subframe.

[0118] In some embodiments, referring to Figure 5 , when the motion constraint information includes distance constraint parameters, the process of solving the distance constraint parameters in Step S210 can be implemented through the following Steps S2101 to S2105:

[0119] Step S2101: Obtain the collision mass and collision position information of each mass point of the collision object from the parameter information of the collision objects in the subframe.

[0120] Step S2102: Obtain the flexible mass and flexible position information of each mass point of the flexible object from the initial physical model.

[0121] Step S2103: Sequentially for each mass point of the collision object and each mass point of the flexible object, based on the collision position information and the flexible position information, determine the initial mass point distance between the mass point of the collision object and the mass point of the flexible object.

[0122] Step S2104: For each mass point of the flexible object, based on the collision mass, collision position information, flexible mass, flexible position information, and the initial mass point distance, determine the first correction distance of the mass point of the flexible object.

[0123] In the embodiments of the present application, the collision mass, collision position information, flexible mass, flexible position information, and the initial mass point distance of the mass point can be input into a preset first solution formula, and the first correction distance of the mass point is calculated through the first solution formula.

[0124] Step S2105: Determine the first correction distances of all the mass points of the flexible object as the motion calibration parameters of the flexible object in the subframe.

[0125] In the embodiments of the present application, after obtaining the first correction distances of each mass point of the flexible object, the first correction distances of all the mass points can be summarized to obtain the motion calibration parameters of the flexible object in the subframe. The motion calibration parameters include correction parameters for correcting parameter information such as the position of each mass point in the flexible object.

[0126] In some embodiments, referring to Figure 6 , when the motion constraint information includes bending constraint parameters, the process of resolving the bending constraint parameters in step S210 can be implemented by the following steps S2106 to S2112:

[0127] Step S2106, obtain the position information of each mass point of the collision object from the parameter information of the collision object in the sub-frame.

[0128] Step S2107, obtain the position information of each mass point of the flexible body object and the flexible body mass from the initial physical model.

[0129] Step S2108, construct multiple mass point triangles based on all the mass points in the collision object and all the mass points of the flexible body object.

[0130] Step S2109, for each mass point of the flexible body object, determine two adjacent target mass point triangles containing the mass point.

[0131] Step S2110, based on the position information of each mass point in the target mass point triangle, determine the angle of the initial dihedral angle between two adjacent target mass point triangles.

[0132] Step S2111, for each mass point of the flexible body object, based on the flexible body mass of the mass point, the position information of all the mass points in two adjacent target mass point triangles, and the angle of the initial dihedral angle, determine the second correction distance of the mass point of the flexible body object.

[0133] In the embodiments of the present application, the flexible body mass of the mass point, the position information of all the mass points in two adjacent target mass point triangles, and the angle of the initial dihedral angle can be input into a preset second resolution formula, and the second correction distance of the mass point is calculated through the second resolution formula.

[0134] Step S2112, determine the motion calibration parameter of the flexible body object in the sub-frame as the second correction distance of all the mass points of the flexible body object.

[0135] In the embodiments of the present application, after obtaining the second correction distance of each mass point of the flexible body object, the second correction distances of all the mass points can be summarized to obtain the motion calibration parameter of the flexible body object in the sub-frame, and the motion calibration parameter includes correction parameters for correcting parameter information such as the position of each mass point in the flexible body object.

[0136] In some embodiments, for the same mass point, if the first corrected distance and the second corrected distance of the mass point are calculated simultaneously, parameter fusion can be performed on the first corrected distance and the second corrected distance. Here, the parameter fusion can be adding the first corrected distance and the second corrected distance. If the directions of the first corrected distance and the second corrected distance are different, parameter fusion of the two corrected distances needs to be performed according to the directions of the first corrected distance and the second corrected distance. For example, if the first corrected distance is that the mass point moves 1 millimeter to the right and the second corrected distance is that the mass point moves 1 millimeter upward, the fusion parameter after parameter fusion of the first corrected distance and the second corrected distance can be moving in the direction of 45 degrees to the upper right corner millimeters.

[0137] In some embodiments, referring to Figure 7 , when the motion constraint information includes the self-collision constraint parameter, the process of resolving the self-collision constraint parameter in step S210 can be implemented through the following steps S2113 to S2117:

[0138] Step S2113, obtain the thickness of the flexible body object, the flexible body mass of each mass point of the flexible body object, and the flexible body position information from the initial physical model.

[0139] Step S2114, construct multiple mass point triangles based on all the mass points of the flexible body object.

[0140] Step S2115, for each mass point of the flexible body object, with the mass point as the current vertex, based on the flexible body position information of the current vertex, the flexible body position information of the three mass points in each mass point triangle, and the thickness, determine the distance change gradient of the current vertex.

[0141] In the embodiments of the present application, the flexible body position information of the current vertex, the flexible body position information of the three mass points in each mass point triangle, and the thickness can be input into a preset third resolution formula, and the distance change gradient of the current vertex can be calculated through the third resolution formula.

[0142] Step S2116, determine the third corrected distance of the current vertex based on the distance change gradient.

[0143] Here, since the distance change gradient of the current vertex (i.e., the mass point) is calculated, that is, the change distance of the current vertex at different times is known, therefore, based on this distance change gradient, the third corrected distance for the current vertex at different times can be determined.

[0144] Step S2117, determine the motion calibration parameter of the flexible body object in the sub-frame as the third corrected distances of all the mass points of the flexible body object.

[0145] In the embodiments of the present application, after obtaining the third correction distance of each mass point of the flexible object, the third correction distances of all the mass points can be aggregated to obtain the motion calibration parameter of the flexible object in this sub-frame. The motion calibration parameter includes correction parameters for correcting parameter information such as the position of each mass point in the flexible object.

[0146] In some embodiments, for the same mass point, if the first correction distance, the second correction distance, and the third correction distance of this mass point are calculated simultaneously, parameter fusion can also be performed on the first correction distance, the second correction distance, and the third correction distance; alternatively, after parameter fusion has been performed on the first correction distance and the second correction distance to obtain a fusion parameter, parameter fusion can also be performed on the fusion parameter and the third correction distance to obtain a secondary fusion parameter. For the implementation process of parameter fusion, please refer to the explanations in the above embodiments, and the embodiments of the present application will not elaborate further.

[0147] In some embodiments, refer to Figure 8 , when the motion constraint information includes continuous collision detection constraint parameters, the process of resolving the continuous collision detection constraint parameters in step S210 can be implemented through the following steps S2118 to S2121:

[0148] Step S2118, for each mass point of the flexible object, based on the parameter information of the collision object in the sub-frame and the initial physical model, determine whether the mass point will intersect with the capsule in the collision object within the sub-time interval between the sub-frame and the adjacent next sub-frame.

[0149] In some embodiments, the following method can be used to determine whether the mass point will intersect with the capsule in the collision object within the sub-time interval between the sub-frame and the adjacent next sub-frame:

[0150] First, based on the parameter information of the collision object in the sub-frame, determine the axial vector of the capsule, the center point position information of the capsule, the axial length of the capsule, and the radius of the capsule; obtain the flexible body position information of the mass point from the initial physical model; perform a dot product operation on the flexible body position information and the axial vector of the capsule to obtain the dot product operation result; based on the flexible body position information and the center point position information of the capsule, determine the position vector between the mass point and the capsule; determine the projection length of the position vector on the axial vector of the capsule; based on the flexible body position information and the center point position information of the capsule, determine the distance between the mass point and the capsule. Then, based on the dot product operation result, the axial vector of the capsule, the radius of the capsule, as well as the projection length, the distance between the mass point and the capsule, and the axial length of the capsule, determine whether the mass point will intersect with the capsule in the collision object within the sub-time interval between the sub-frame and the adjacent next sub-frame.

[0151] Here, based on the dot product operation result, the axial vector of the capsule, the radius of the capsule, as well as the projection length, the distance between the mass point and the capsule, and the axial length of the capsule, it is determined whether the mass point will intersect with the capsule in the collision object within the sub-time interval from the current sub-frame to the adjacent next sub-frame. It can be determined that the mass point intersects with the capsule in the collision object when the following two conditions are met:

[0152] Condition 1, the absolute value of the dot product operation result is less than or equal to the sum of half of the length of the axial vector of the capsule and the radius of the capsule; Condition 2, the projection length is less than or equal to the radius of the capsule, and the distance between the mass point and the capsule is less than or equal to the sum of half of the axial length of the capsule and the radius of the capsule.

[0153] Step S2119, if it is determined that the mass point will intersect with the capsule in the collision object, then determine the interval distance between the mass point and the axial length of the capsule.

[0154] Step S2120, determine the fourth correction distance of the mass point according to the interval distance.

[0155] In the embodiments of the present application, when determining the fourth correction distance of the mass point according to the interval distance, the radius of the capsule can be obtained; then, determine the difference between the interval distance and the radius of the capsule, and determine the fourth correction distance based on this difference.

[0156] Step S2121, determine the motion calibration parameter of the soft body object in the sub-frame as the fourth correction distance of all mass points of the soft body object.

[0157] In the embodiments of the present application, after obtaining the fourth correction distance of each mass point of the soft body object, the fourth correction distances of all mass points can be summarized to obtain the motion calibration parameter of the soft body object in this sub-frame. The motion calibration parameter includes correction parameters for correcting parameter information such as the position of each mass point in the soft body object.

[0158] In some embodiments, for the same mass point, if the first correction distance, the second correction distance, the third correction distance, and the fourth correction distance of the mass point are calculated simultaneously, then the first correction distance, the second correction distance, the third correction distance, and the fourth correction distance can also be parameter-fused. For the implementation process of parameter fusion, please refer to the explanations in the above embodiments, and the embodiments of the present application will not be elaborated here.

[0159] In some embodiments, if it is determined that a mass point will intersect with the capsule in the collision object, the soft body position information of the mass point and the axial vector of the capsule can also be determined; and a cross product operation is performed on the soft body position information and the determined axial vector of the capsule; then, the fifth correction distance of the mass point is determined according to the result of the cross product operation; wherein, after the soft body position information is position-corrected based on the fifth correction distance, the vector direction of the cross product between the obtained corrected soft body position information and the axial vector of the capsule is the same as the vector direction of the result of the cross product operation; that is to say, the fifth correction distance can ensure that the cross product does not reverse. In this way, when the fifth correction distance is determined, the fifth correction distances of all the mass points of the soft body object can be determined as the motion calibration parameters of the soft body object in the sub-frame.

[0160] In the embodiments of the present application, after obtaining the fifth correction distance of each mass point of the soft body object, the fifth correction distances of all the mass points can be summarized to obtain the motion calibration parameters of the soft body object in this sub-frame. The motion calibration parameters include correction parameters for correcting parameter information such as the position of each mass point in the soft body object.

[0161] In some embodiments, for the same mass point, if the first correction distance, the second correction distance, the third correction distance, the fourth correction distance, and the fifth correction distance of the mass point are calculated simultaneously, parameter fusion can also be performed on the first correction distance, the second correction distance, the third correction distance, the fourth correction distance, and the fifth correction distance. For the implementation process of parameter fusion, please refer to the explanations in the above embodiments, and the embodiments of the present application will not be elaborated herein.

[0162] It should be noted that in the motion calibration parameters of the soft body object in each finally obtained sub-frame, the correction parameters after parameter fusion of each mass point of the soft body object can be used.

[0163] Step S211, the server renders the soft body object in the sub-frame based on the motion calibration parameters to obtain a rendered virtual scene video.

[0164] In the embodiments of the present application, after obtaining the motion calibration parameters, the initial parameters in the initial physical model of the soft body object can be corrected based on the motion calibration parameters, that is, the initial parameters in the initial physical model are modified to obtain corrected parameters. The corrected parameters include the parameters of each mass point in the soft body object. After obtaining the corrected parameters, physical simulation can be performed based on the corrected parameters to obtain a physical model of the soft body object with corrected parameters. The physical model with corrected parameters is a physical model that can accurately display the soft body object. Therefore, rendering can be performed based on the physical model with corrected parameters, and the soft body object is rendered into the video frame of the game video to obtain the final game video and display it.

[0165] Step S212: the server sends the rendered virtual scene video to the terminal.

[0166] Step S213: the terminal displays the rendered virtual scene video on the current interface.

[0167] The soft body object rendering method provided in the embodiment of the present application performs physical simulation according to each sub-frame, thereby ensuring that a stable and reliable simulation result can be obtained for a soft body object whose skeletal animation moves too violently or complexly, that is, accurate motion calibration parameters are obtained, so that the initial physical model of the soft body object can be accurately calibrated based on the motion calibration parameters, thereby improving the physical simulation effect of the soft body object.

[0168] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.

[0169] The embodiment of the present application proposes a method for rendering a soft body object, which can be a cloth physics simulation method, wherein the cloth physics simulation method of the embodiment of the present application can be applied to any game application, for example, for martial arts realistic type games, the cloth has characteristics such as multiple layers, large-area complex robes, multiple wrinkles, multiple embellishments, and strong details. Then, the core requirements of the cloth physics simulation method include: high-precision cloth simulation effect, which can significantly improve the effect of the cloth and show the details of the cloth; can cope with the complex actions of the character, such as the challenge of light work to the performance of the cloth; can handle the cloth with characteristics such as multiple layers, large-area complex robes, multiple wrinkles, multiple embellishments, and strong details; can avoid the problem of multiple layers of cloth interlaced; real-time simulation, which can show the character's actions and the effect of the cloth in real time in the game; the cost is acceptable and feasible, and can be widely used in practical applications.

[0170] Figure 9 It is an effect optimization test resource of the cloth physics simulation method provided in the embodiment of the present application. Figure 10 It is another effect optimization test resource of the cloth physics simulation method provided in the embodiment of the present application. Figure 9 The cloth shown is gradually simulated from a single layer to multiple layers, with higher accuracy and better simulation effect; Figure 10 The fabric shown has the characteristics of complex style, multiple layers, and relatively high precision. It can be seen that by applying the method of the embodiment of the present application, these resources have the characteristics of high precision, multiple layers, and complex style, which can effectively demonstrate the optimization effect and realize the simulation of fabrics with high precision, multiple layers, and complex style, thereby obtaining a more optimized simulation effect. Figure 11It is the simulation effect diagram of the cloth physical simulation method provided by the embodiments of the present application. The effect can be verified using actual art resources and animations. In the scene picture of the presented virtual scene, the clothes present corresponding forms under the corresponding actions of the virtual character without penetration, and have a good display effect.

[0171] In terms of simulation, the embodiments of the present application can well handle the situation where animations are faster and more complex, such as actions like walking, running, jumping, and light kung fu. Specifically, a purely self-developed cloth solver (Cloth Solver, that is, the object solver in the above-mentioned server) is implemented, which improves the local space simulation and increases the inertial effect of the root motion. These improvements enable the solutions of the embodiments of the present application to better meet the complex cloth simulation requirements, including cloth with characteristics such as multiple layers, large-area complex long gowns, multiple folds, multiple embellishments, and strong details, supporting more cloth layers and richer fold effects, as Figure 12 shown in the fold effect.

[0172] In terms of collision, the embodiments of the present application can avoid the problem of multi-layer cloth penetration, thereby achieving a better collision effect. Compared with the very poor effect of the cloth light kung fu action implemented by NvCloth, the embodiments of the present application perform very well in the same action. These improvements enable the solutions of the embodiments of the present application to better display the actions of the character and the effects of the cloth in the game, thereby enhancing the visual effect and user experience of the game, as Figure 13 shown in the rendered visual effect.

[0173] Next, in combination with the cloth physical simulation method provided by the embodiments of the present application, the overall algorithm process of the cloth solver (Cloth Solver) of the embodiments of the present application will be described.

[0174] The cloth solver generally adopts the XPBD algorithm. When simulating, each video frame is divided into several sub-frames, and the simulation is performed according to each sub-frame. The core pseudo-code is as follows:

[0175]

[0176] Here, the initialization process of the cloth solver will be described. In the initialization stage, the following processing will be performed:

[0177] 1) Apply for the required memory.

[0178] 2) Copy the initial parameters passed from the cloth solver; among them, the initial parameters include: the initial position, initial velocity of each mass point on the cloth, the cloth parameters edited in the cloth editor, etc.

[0179] 3) Scan the mesh cells to construct various types of motion constraint information (constraint).

[0180] Among them, the motion constraint information specifically includes:

[0181] Distance Constraints: In physical simulation, distance constraint is a constraint relationship used to limit the distance between two objects within a specific range. The distance constraint parameter can be used to simulate situations such as springs, ropes, and connected objects. By calculating and adjusting the distance between objects, the stability of the constraint can be maintained.

[0182] Bending Constraint: Bending constraint is a constraint relationship used to simulate the bending and deformation of objects. The bending constraint parameter is usually used to simulate the bending behavior of flexible rods, ropes, fabrics, etc. By calculating and adjusting the shape and angle of the object, the stability and authenticity of the bending constraint can be maintained.

[0183] Self Collision Constraint: Self collision constraint is a constraint relationship used to simulate internal collisions of objects. When different parts of an object collide, the self collision constraint parameter can detect and adjust the position and shape of the object to avoid internal penetration and intersection. It is usually applied to simulate flexible objects such as soft bodies and fabrics.

[0184] Capsule Constraint: Capsule constraint is a constraint relationship used to simulate the connection relationship between objects. The capsule constraint parameter is usually used to simulate situations such as joints and connected objects. The capsule constraint regards the connection point between two objects as a capsule shape, and by calculating and adjusting the position and rotation of the object, the stability and authenticity of the constraint can be maintained.

[0185] Continuous Collision Detection Constraint (CCD Constraint): Continuous collision detection constraint is a constraint relationship used to simulate continuous collisions of objects during motion. The continuous collision detection constraint parameter detects and processes collisions at each time step of the object's motion to maintain the accuracy and stability of the simulation. The continuous collision detection constraint parameter is often used to simulate objects with fast motion, rotation, and collisions to avoid penetration and unrealistic collision effects.

[0186] 4) Initialize the self-collision acceleration structure; among them, bounding boxes are created for the triangles of each cloth mesh, and rough collision screening is performed through the bounding boxes.

[0187] 5) Weights and layer information of nodes. Among them, information such as various parameters of the cloth solver is copied in this stage and will not change later. Here, a node refers to a node edited in the cloth editor. For example, a cloth mesh is a node, and data such as weights will be painted on this mesh.

[0188] In the embodiments of the present application, each video frame will be divided into several sub - frames. The introduction of sub - frames is to obtain a stable and reliable result when the skeletal animation moves too violently.

[0189] In the embodiments of the present application, the position and rotation information of the capsules and fixed particles in each sub - frame will be interpolated from the information of the previous video frame and the next video frame transmitted from the cloth editor. For example, position lerp, rotation slerp and other data can be obtained. Each sub - frame is regarded as a complete simulation time slice, that is, a complete simulation algorithm will be performed once.

[0190] Regarding the solution of the motion constraint information in the constraint dataset, in this stage, several iterations will be performed. Each iteration will project the motion constraint information of all categories in a specified order. Here, the "specified order" is the order of different types of constraints. Projection is an operation mode. However, this operation mode is abstracted into several general steps, and the calculation formulas of each step for different constraints are different. Projecting the motion constraint information can be understood as solving the motion constraint information to obtain the motion calibration parameters of the corresponding soft - body object.

[0191] It should be noted that in the embodiments of the present application, not every type of motion constraint information will be projected in each iteration. For example, the air mesh and self - collision constraints will only be projected in the last iteration of each sub - frame. In addition, not every type of motion constraint information will be projected at most once in each iteration. For example, the capsule collision will be iterated multiple times and interspersed among other types of constraints.

[0192] Next, the solution process of different types of motion constraint information will be described. Among them, various motion constraint information and its solution methods are based on serial implementation, and the parallel implementation formulas are basically the same.

[0193] (1) For the distance constraint corresponding to the distance constraint parameter, which is used to constrain the distance between two mass points and can be used for stretching, shearing, LRA and other constraints. Such as Figure 14As shown in the figure, it is a schematic diagram of the motion constraint information calculation principle provided by the embodiment of the present application. For the two particles A and B in the figure (where one of the particles A and B can represent a particle in the current sub-frame to be calculated, and the other particle can represent a particle in the collision object in the sub-frame), the following formulas (1-1) and (1-2) can be used to calculate the corrected distance between particle A and particle B (i.e., the first corrected distance):

[0194]

[0195]

[0196] Wherein, m1 and m2 respectively represent the masses of particle A and particle B (i.e., the collision mass and the flexible body mass); ω1 and ω2 respectively represent the reciprocals of the masses of particle A and particle B; p1 and p2 respectively represent the positions of particle A and particle B (i.e., the collision position information and the flexible body position information); Δp1 and Δp2 respectively represent the corrected distances of particle A and particle B; d represents the initial particle distance between particle A and particle B. represents the gradient value of p1 and p2 for particle A. Here, m1 and m2, p1 and p2, etc. can all be the initial parameters in the initial physical model of the flexible body object. That is to say, these data can be obtained from the initial parameters of the initial physical model, and thus the first corrected distance of each particle of the flexible body object can be calculated based on the above formulas.

[0197] It should be noted that for any particle in the flexible body object, this particle can be regarded as one of particle A or particle B in the embodiment of the present application, and the other of particle A and particle B can be a particle in the collision object. By using the above formulas (1-1) and (1-2), the distance constraint parameters of each particle in the flexible body object can be repeatedly calculated to obtain the first corrected distance of each particle. In this way, based on the first corrected distance of each particle, the position and state of the entire flexible body object can be corrected.

[0198] In the embodiment of the present application, when calculating the distance constraint parameters of multiple particles in the flexible body object, the above formulas (1-1) and (1-2) can be used for parallel calculation.

[0199] (2) For the bending constraint corresponding to the bending constraint parameter, such as Figure 15As shown, it is a schematic diagram of the principle for solving bending constraint parameters provided by an embodiment of the present application. Bending constraint is a constraint that limits the angle between two triangles. In the embodiment of the present application, bending constraint is a type of constraint used to simulate the bending behavior of flexible objects. Bending constraint is used to limit the bending angle between adjacent particles in a flexible body to simulate the behavior of an object when it bends or twists. In bending constraint, usually two adjacent mass points are selected as the endpoints of the constraint, and a desired bending angle is defined. By iteratively solving the constraint during the simulation, the positions and velocities of the particles are adjusted so that the actual bending angle gradually approaches the desired angle. The corrected distance (i.e., the second corrected distance) of the mass point i of the flexible object can be calculated using the following formulas (1-3):

[0200]

[0201] where, Δp i represents the position difference between mass points (i.e., the second corrected distance); ω i represents the reciprocal of the mass of mass point i; represents the angle of the initial dihedral angle; q i represents the gradient of mass point i. Combining with the schematic diagram of Figure 15 , assuming that mass point i is mass point 1 corresponding to p1, then the gradient q1 of mass point 1 can be calculated using the following formulas (1-4) to (1-7):

[0202]

[0203]

[0204]

[0205] q1 = -q2 - q3 - q4 (1-7).

[0206] where, the normal the normal

[0207] It should be noted that p1, p2, p3, p4, etc. here can all be the initial parameters in the initial physical model of the flexible object. That is to say, these data can be obtained from the initial parameters of the initial physical model, and thus the second corrected distance of each mass point of the flexible object can be calculated based on the above formulas.

[0208] (3) For the self - collision constraint corresponding to the self - collision constraint parameter, the self - collision constraint is a type of constraint used to simulate the internal collision behavior of a flexible body object. The self - collision constraint is used to limit the mutual penetration between different parts of the flexible body to simulate the internal collision of the object and avoid unnatural crossing phenomena. In the self - collision constraint, by detecting the collision situation inside the flexible body object, it is determined which mass points penetrate each other. Then, by iteratively solving the constraint, the positions and velocities of the corresponding mass points are adjusted so that they no longer penetrate each other, thereby simulating the internal collision behavior of the object. Figure 16 is a schematic diagram of the solution principle of the self - collision constraint parameter provided by the embodiment of the present application. Combining Figure 16 , the following formula (1 - 8) can be used to calculate the distance change gradient of the mass point of the flexible body object, and thus solve the corrected distance (i.e., the third corrected distance) of the vertex based on the distance change gradient:

[0209]

[0210] Among them, C(q, p1, p2, p3) represents the gradient; q represents the position of the vertex (the current vertex, that is, the mass point to be solved currently) (i.e., the flexible body position information); p1, p2, and p3 are the three vertices of the triangle; h represents the fabric thickness, which is a value set in the fabric editor.

[0211] It should be noted that q, p1, p2, p3, p4, etc. here can all be the initial parameters in the initial physical model of the flexible body object. That is to say, these data can be obtained from the initial parameters of the initial physical model, and thus the third corrected distance of each mass point of the flexible body object can be calculated based on the above formula.

[0212] (4) For the continuous collision detection constraint corresponding to the continuous collision detection constraint parameter (Semi CCD), the Semi CCD method does not solve the exact intersection time. Instead, it generally first judges whether there is a possible intersection (proximity check). If there is a possible intersection, then a simpler three - dimensional structure such as a plane is used for approximation, and directional information is used to achieve the effect of CCD. Among them, in AirMesh, a directed volume (third - order determinant) is used, in CCD, a directed distance (dot product) is used, and in the Semi CCD of the embodiment of the present application, a directed area (cross product) is used.

[0213] During the implementation process, as Figure 17 shown, first, a proximity check is performed to determine whether there may be an intersection between the mass point and the cylinder 171 (what remains after removing the two ends of a capsule collision body is a cylinder) within the current frame. The basis is whether the mass point is always within Figure 17The content of area 172 can be judged by using the dot product. If not, it is considered that they may intersect. If they may intersect, the projection is guaranteed that the cross product does not reverse, or the projection is guaranteed that the interval distance between the mass point and the axial length of the capsule ( Figure 17 the distance between point a and point b of the capsule in

[0214] The implementation process of the click judgment is described below:

[0215] To judge whether a mass point is inside the capsule, a dot product operation can be used for judgment. The following is a method based on the dot product operation:

[0216] 1) Define the axial vector of the capsule as capsuleAxis, the center point of the capsule (i.e., the center point position information) as capsuleCenter, the axial length of the capsule as capsuleLength, and the radius of the capsule as r.

[0217] 2) Represent the mass point to be judged as point.

[0218] 3) Calculate the dot product between the mass point point and the axial vector capsuleAxis of the capsule, denoted as dotProduct1 (i.e., the result of the dot product operation).

[0219] 4) Calculate the vector between the mass point point and the center point capsuleCenter of the capsule, denoted as vector (i.e., the position vector between the mass point and the capsule).

[0220] 5) Calculate the projection length of the vector vector on the axial vector capsuleAxis of the capsule, denoted as projection.

[0221] 6) Calculate the distance between the mass point point and the center point capsuleCenter of the capsule, denoted as distance.

[0222] 7) If the following two conditions are met, the mass point point is inside the capsule:

[0223] Condition 1: The absolute value of dotProduct1 is less than or equal to half of the length of the axial vector capsuleAxis of the capsule plus the radius of the capsule.

[0224] Condition 2: The length of the vector projection is less than or equal to the radius of the capsule, and the distance between the mass point point and the center point capsuleCenter of the capsule is less than or equal to half of the length of the capsule plus the radius of the capsule.

[0225] Through this method, the dot product operation can be used to determine whether a particle is inside the capsule. It should be noted that this method assumes that the axial vector of the capsule is in the length direction of the capsule and that the capsule is infinitely long. If the capsule has different length ranges, it can be adjusted according to specific circumstances.

[0226] The cloth physical simulation method provided by the embodiments of this application, in terms of collision, this cloth physical simulation method successfully solves the problem of poor collision effect after improving the cloth accuracy. By implementing solutions such as Semi CCD and collision penetration optimization, the accuracy and stability of cloth simulation are successfully improved, making the character actions and cloth effects in the game more realistic and natural. In terms of simulation, this cloth physical simulation method successfully solves the problems of tearing and edge fragmentation (solved by the bending constraint of XPBD), successfully solving the problems of tearing and edge fragmentation in cloth simulation, making the cloth effect in the game more perfect and smooth. Thus, it can be seen that the embodiments of this application have achieved remarkable results in both collision and simulation aspects, successfully improving the cloth effect and user experience in the game, bringing great benefits to game development.

[0227] In addition, from the perspective of the overall solution, the embodiments of this application are a cloth physical simulation method based on the XPBD algorithm. This method is based on the XPBD algorithm and is optimized and improved for the special requirements of cloth physical simulation on the basis of the XPBD algorithm to achieve a more realistic and efficient cloth simulation effect. Specifically, it includes: (1) Optimized constraint handling: For the special constraint requirements in cloth simulation, the constraint handling in the XPBD algorithm is optimized. It may include adding specific types of constraints (such as distance constraints, bending constraints, etc.) to simulate the deformation and structure of the cloth, and adjusting the parameters and stiffness of the constraints to control the strength and toughness of the cloth. By optimizing the constraint handling, the tearing and edge fragmentation effects of the cloth can be better simulated. (2) Efficient collision detection: For the collision problems in cloth simulation, an efficient collision detection algorithm is designed. It may adopt collision detection methods based on bounding boxes, grids or other data structures to improve the efficiency and accuracy of collision detection. Through efficient collision detection, the collisions between the cloth and other objects can be more accurately captured and the corresponding tearing and edge fragmentation effects can be triggered.

[0228] It can be understood that in the embodiments of the present application, for content related to user information, such as information in the constraint data set of the physical model of the pre-constructed flexible object, if it involves data related to user information or enterprise information, when the embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, or these information need to be obfuscated to eliminate the corresponding relationship between this information and the user; and the collection and processing of relevant data should strictly comply with the requirements of relevant national laws and regulations during actual application, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing behaviors within the scope authorized by laws and regulations and the personal information subject.

[0229] Next, the exemplary structure in which the flexible object rendering device 354 provided in the embodiments of the present application is implemented as a software module will be further described. In some embodiments, as Figure 2 shown, the flexible object rendering device 354 includes: an acquisition module 3541, configured to acquire parameter information of a collision object in video frames of the virtual scene at two adjacent moments during the running of the virtual scene, the initial physical model of the flexible object in the video frame at the previous moment of the two moments, and the constraint data set of the physical model of the pre-constructed flexible object; the initial physical model includes initial parameters required for physically simulating the form of the flexible object at the previous moment; the constraint data set includes multiple different types of motion constraint information; a sub-frame division module 3542, configured to divide the video frame at the previous moment into multiple sub-frames, and each sub-frame corresponds to a moment within the time interval between the two moments; a determination module 3543, configured to determine parameter information of the collision object in each sub-frame based on the parameter information of the collision object in the video frames of the two moments; a solution module 3544, configured to, for each sub-frame, solve each motion constraint information in the constraint data set based on the parameter information of the collision object in the sub-frame and the initial physical model to obtain the motion calibration parameter of the flexible object in the sub-frame; a rendering module 3545, configured to render the flexible object in the sub-frame based on the motion calibration parameter.

[0230] In some embodiments, the obtaining module is further configured to: when the video frame at the previous moment is the first video frame in the virtual scene video corresponding to the virtual scene, obtain the initial data for the soft body object sent by the object solver; and perform initial parameter configuration on each mass point in the initial physical model of the soft body object according to the initial data to obtain the initial physical model; when the video frame at the previous moment is not the first video frame in the virtual scene video corresponding to the virtual scene, obtain the physical model of the soft body object in the historical video frame that is before and adjacent to the video frame, and determine the physical model of the soft body object in the historical video frame as the initial physical model of the soft body object in the video frame at the previous moment.

[0231] In some embodiments, the obtaining module is further configured to: before generating the first video frame in the virtual scene video, receive a parameter input operation for each mass point in the soft body object through the object solver; after the object solver responds to the parameter input operation and summarizes the input parameters of each input mass point to obtain the initial data for the soft body object, receive the initial data for the soft body object sent by the object solver.

[0232] In some embodiments, the obtaining module is further configured to: obtain a control instruction for any virtual object in the virtual scene; the virtual object includes at least the collision object and the soft body object; in response to the control instruction, determine the morphological data of each virtual object in the virtual scene at the two moments; respectively based on the morphological data at each moment, determine the video frame at the corresponding moment and the parameter information of the collision object in the video frame.

[0233] In some embodiments, the device further includes: a constraint parameter construction module, configured to construct distance constraint parameters for each mass point in the physical model of the flexible object, where the distance constraint parameters are used to constrain the distance between the mass point and at least one other mass point; construct bending constraint parameters for each mass point in the physical model of the flexible object, where the bending constraint parameters are used to constrain the angle between the mass point and at least one other mass point; construct self-collision constraint parameters for each mass point in the physical model of the flexible object, where the self-collision constraint parameters are used to constrain the parameter information of the mass point when the mass point collides with at least one other mass point in the case of self-collision; construct capsule constraint parameters corresponding to each mass point in the physical model of the flexible object, where the capsule constraint is used to constrain the connection relationship between different parts of the flexible object; construct continuous collision detection constraint parameters corresponding to each mass point in the physical model of the flexible object, where the continuous collision detection constraint is used to constrain the parameter information of the mass point when the flexible object undergoes continuous collision during movement; wherein, the distance constraint parameters, the bending constraint parameters, the self-collision constraint parameters, the capsule constraint parameters, and the continuous collision detection constraint parameters respectively constitute the motion constraint information in the constraint dataset of the physical model of the flexible object.

[0234] In some embodiments, the initial physical model of the flexible object is composed of multiple mesh units, and each mesh unit corresponds to a mass point; wherein, the constraint parameter construction module is further configured to: scan each mesh unit in the initial physical model of the flexible object, and add the motion constraint information in the constraint dataset to the initial parameters of the mass point corresponding to each mesh unit.

[0235] In some embodiments, the solving module is further configured to: determine the motion constraint type corresponding to each piece of motion constraint information, and obtain the solving priority for different motion constraint types; sort all the motion constraint information according to the solving priority to form a motion constraint information sequence; based on the parameter information of the collision object in the sub-frame and the initial physical model, sequentially solve each piece of motion constraint information according to the motion constraint information sequence to obtain the motion calibration parameters of the flexible object in the sub-frame.

[0236] In some embodiments, when the motion constraint information includes distance constraint parameters, the solving module is further configured to: obtain the collision mass and collision position information of each mass point of the collision object from the parameter information of the collision object in the sub-frame; obtain the flexible body mass and flexible body position information of each mass point of the flexible body object from the initial physical model; successively for each mass point of the collision object and each mass point of the flexible body object, based on the collision position information and the flexible body position information, determine the initial mass point distance between the mass point of the collision object and the mass point of the flexible body object; for each mass point of the flexible body object, based on the collision mass, the collision position information, the flexible body mass, the flexible body position information and the initial mass point distance, determine the first corrected distance of the mass point of the flexible body object; and determine the first corrected distances of all the mass points of the flexible body object as the motion calibration parameters of the flexible body object in the sub-frame.

[0237] In some embodiments, when the motion constraint information includes bending constraint parameters, the solving module is further configured to: obtain the position information of each mass point of the collision object from the parameter information of the collision object in the sub-frame; obtain the position information and flexible body mass of each mass point of the flexible body object from the initial physical model; construct a plurality of mass point triangles based on all the mass points in the collision object and all the mass points of the flexible body object; for each mass point of the flexible body object, determine two adjacent target mass point triangles containing the mass point; based on the position information of each mass point in the target mass point triangle, determine the angle of the initial dihedral angle between the two adjacent target mass point triangles; for each mass point of the flexible body object, based on the flexible body mass of the mass point, the position information of all the mass points in the two adjacent target mass point triangles and the angle of the initial dihedral angle, determine the second corrected distance of the mass point of the flexible body object; and determine the second corrected distances of all the mass points of the flexible body object as the motion calibration parameters of the flexible body object in the sub-frame.

[0238] In some embodiments, when the motion constraint information includes self-collision constraint parameters, the solving module is further configured to: obtain the thickness of the flexible body object, the flexible body mass and flexible body position information of each mass point of the flexible body object from the initial physical model; construct a plurality of mass point triangles based on all the mass points of the flexible body object; for each mass point of the flexible body object, taking the mass point as the current vertex, based on the flexible body position information of the current vertex, the flexible body position information of three mass points in each mass point triangle and the thickness, determine the distance change gradient of the current vertex; based on the distance change gradient, determine the third corrected distance of the current vertex; and determine the third corrected distances of all the mass points of the flexible body object as the motion calibration parameters of the flexible body object in the sub-frame.

[0239] In some embodiments, when the motion constraint information includes continuous collision detection constraint parameters, the solving module is further configured to: for each mass point of the flexible object, based on the parameter information of the collision object in the sub-frame and the initial physical model, determine whether the mass point will intersect with the capsule in the collision object within the sub-time interval between the sub-frame and the adjacent next sub-frame; if it is determined that the mass point will intersect with the capsule in the collision object, determine the interval distance between the mass point and the axial length of the capsule; determine the fourth correction distance of the mass point according to the interval distance; and determine the motion calibration parameter of the flexible object in the sub-frame as the fourth correction distances of all the mass points of the flexible object.

[0240] In some embodiments, the solving module is further configured to: based on the parameter information of the collision object in the sub-frame, determine the axial vector of the capsule, the center point position information of the capsule, the axial length of the capsule, and the radius of the capsule; obtain the flexible position information of the mass point from the initial physical model; perform a dot product operation on the flexible position information and the axial vector of the capsule to obtain a dot product operation result; determine the position vector between the mass point and the capsule based on the flexible position information and the center point position information of the capsule; determine the projection length of the projection of the position vector on the axial vector of the capsule; determine the distance between the mass point and the capsule based on the flexible position information and the center point position information of the capsule; and determine whether the mass point will intersect with the capsule in the collision object within the sub-time interval between the sub-frame and the adjacent next sub-frame based on the dot product operation result, the axial vector of the capsule, the radius of the capsule, the projection length, the distance between the mass point and the capsule, and the axial length of the capsule.

[0241] In some embodiments, the solving module is further configured to: if the following conditions are met, determine that the mass point intersects with the capsule in the collision object: the absolute value of the dot product operation result is less than or equal to the sum of half of the length of the axial vector of the capsule and the radius of the capsule; and the projection length is less than or equal to the radius of the capsule, and the distance between the mass point and the capsule is less than or equal to the sum of half of the axial length of the capsule and the radius of the capsule.

[0242] In some embodiments, the solving module is further configured to: obtain the radius of the capsule; determine the difference between the interval distance and the radius of the capsule, and determine the fourth correction distance based on the difference.

[0243] In some embodiments, the solving module is further configured to: if it is determined that the mass point will intersect with the capsule in the collision object, determine the soft body position information of the mass point and determine the axial vector of the capsule; perform a cross product operation on the soft body position information and the determined axial vector of the capsule; determine a fifth correction distance of the mass point according to the result of the cross product operation; wherein, after performing position correction on the soft body position information based on the fifth correction distance, the vector direction of the cross product between the obtained corrected soft body position information and the axial vector of the capsule is the same as the vector direction of the result of the cross product operation; determine the fifth correction distances of all the mass points of the soft body object as the motion calibration parameters of the soft body object in the sub-frame.

[0244] In some embodiments, the determining module is further configured to: obtain first parameter information of a collision object in a video frame at a previous moment and second parameter information of the collision object in a video frame at a later moment among the two moments; based on the previous moment and the later moment, perform information interpolation processing on the first parameter information and the second parameter information to obtain parameter information of the collision object in a sub-frame at each moment within the time interval.

[0245] It should be noted that the description of the device in the embodiments of the present application is similar to the description of the above method embodiments, and has similar beneficial effects to the method embodiments, so details are not described herein again. For the technical details not disclosed in the embodiments of the present device, please refer to the description of the method embodiments of the present application for understanding.

[0246] The embodiments of the present application provide a computer program product, which includes executable instructions, and the executable instructions are a kind of computer instructions; the executable instructions are stored in a computer-readable storage medium. When a processor of an electronic device reads the executable instructions from the computer-readable storage medium and the processor executes the executable instructions, the electronic device is caused to execute the method in the embodiments of the present application described above.

[0247] The embodiments of the present application provide a storage medium storing executable instructions, wherein the executable instructions are stored, and when the executable instructions are executed by a processor, the processor will be caused to execute the method provided in the embodiments of the present application, for example, as Figure 3 shown in the method.

[0248] In some embodiments, the storage medium may be a computer-readable storage medium. For example, it can be a ferroelectric memory (FRAM, Ferromagnetic Random Access Memory), a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read Only Memory), an electrically erasable programmable read-only memory (EEPROM, Electrically Erasable Programmable Read Only Memory), a flash memory, a magnetic surface memory, an optical disc, or a compact disk-read only memory (CD-ROM), etc.; it can also be various devices including one or any combination of the above memories.

[0249] In some embodiments, the executable instructions may be in the form of a program, software, software module, script, or code, and can be written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and can be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0250] As an example, the executable instructions may or may not correspond to files in the file system, and can be stored as part of a file that stores other programs or data. For example, they can be stored in one or more scripts in a hypertext markup language (HTML, Hyper Text Markup Language) document, stored in a single file dedicated to the program under discussion, or stored in multiple cooperating files (for example, files that store one or more modules, subroutines, or code portions). As an example, the executable instructions can be deployed to be executed on one electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed at multiple locations and interconnected through a communication network.

[0251] As described above, the above are only embodiments of the present application and are not used to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are all included in the protection scope of the present application.

Claims

1. A method for rendering a flexible object, characterized in that, The method includes: During the running of the virtual scene, obtaining parameter information of collision objects in video frames of the virtual scene at two adjacent moments, the initial physical model of the soft body object in the video frame at the previous moment of the two moments, and a constraint data set of the physical model of the soft body object pre-constructed; the initial physical model includes initial parameters required for physically simulating the shape of the soft body object at the previous moment; the constraint data set includes multiple different types of motion constraint information; Dividing the video frame at the previous moment into multiple sub-frames, each sub-frame corresponding to a moment within the time interval between the two moments; Based on the parameter information of the collision objects in the video frames at the two moments, determining the parameter information of the collision objects in each of the sub-frames; For each of the sub-frames, based on the parameter information of the collision objects in the sub-frame and the initial physical model, resolving each of the motion constraint information in the constraint data set to obtain the motion calibration parameters of the soft body object in the sub-frame; Based on the motion calibration parameters, rendering the soft body object in the sub-frame.

2. The method according to claim 1, wherein Obtaining the initial physical model of the soft body object in the video frame at the previous moment of the two moments includes: When the video frame at the previous moment is the first video frame in the virtual scene video corresponding to the virtual scene, obtaining the initial data sent by the object resolver for the soft body object; and configuring initial parameters for each mass point in the initial physical model of the soft body object according to the initial data to obtain the initial physical model; When the video frame at the previous moment is not the first video frame in the virtual scene video corresponding to the virtual scene, obtaining the physical model of the soft body object in the historical video frame before and adjacent to the video frame, and determining the physical model of the soft body object in the historical video frame as the initial physical model of the soft body object in the video frame at the previous moment.

3. The method according to claim 2, wherein The obtaining the initial data sent by the object resolver for the soft body object includes: Before generating the first video frame in the virtual scene video, receiving a parameter input operation for each mass point in the soft body object through the object resolver; After the object resolver summarizes the input parameters of each input mass point in response to the parameter input operation to obtain the initial data of the soft body object, receiving the initial data sent by the object resolver for the soft body object.

4. The method according to claim 1, wherein The obtaining the parameter information of the collision objects in the video frames of the virtual scene at two adjacent moments includes: Obtaining a control instruction for any virtual object in the virtual scene; the virtual object includes at least the collision object and the soft body object; In response to the control instruction, determining the shape data of each virtual object in the virtual scene at the two moments; Based on the shape data at each moment respectively, determining the video frame at the corresponding moment and the parameter information of the collision object in the video frame.

5. The method according to claim 1, wherein The method further includes: Construct the distance constraint parameters for each particle in the physical model of the flexible object, where the distance constraint parameters are used to constrain the distance between the particle and at least one other particle; Construct the bending constraint parameters for each particle in the physical model of the flexible object, where the bending constraint parameters are used to constrain the angle between the particle and at least one other particle; Construct the self-collision constraint parameters for each particle in the physical model of the flexible object, where the self-collision constraint parameters are used to constrain the parameter information of the particle when the particle collides with at least one other particle in the case of self-collision; Construct the capsule constraint parameters corresponding to each particle in the physical model of the flexible object, where the capsule constraint is used to constrain the connection relationship between different parts of the flexible object; Construct the continuous collision detection constraint parameters corresponding to each particle in the physical model of the flexible object, where the continuous collision detection constraint is used to constrain the parameter information of the particle when the flexible object undergoes continuous collisions during movement; Among them, the distance constraint parameters, the bending constraint parameters, the self-collision constraint parameters, the capsule constraint parameters, and the continuous collision detection constraint parameters respectively constitute the motion constraint information in the constraint dataset of the physical model of the flexible object.

6. The method according to claim 5, wherein The initial physical model of the flexible object is composed of multiple grid cells, and each grid cell corresponds to a particle; among them, constructing the constraint dataset of the physical model of the flexible object includes: Scan each grid cell in the initial physical model of the flexible object, and add the motion constraint information in the constraint dataset to the initial parameters of the particle corresponding to each grid cell.

7. The method according to claim 1, characterized in that, Based on the parameter information of the collision object in the sub-frame and the initial physical model, resolving each motion constraint information in the constraint dataset to obtain the motion calibration parameters of the flexible object in the sub-frame, including: Determine the motion constraint type corresponding to each motion constraint information, and obtain the resolution priority for different motion constraint types; Sort all the motion constraint information according to the resolution priority to form a motion constraint information sequence; Based on the parameter information of the collision object in the sub-frame and the initial physical model, resolve each motion constraint information in turn according to the motion constraint information sequence to obtain the motion calibration parameters of the flexible object in the sub-frame.

8. The method according to claim 7, wherein When the motion constraint information includes distance constraint parameters, based on the parameter information of the collision object in the sub-frame and the initial physical model, resolving the distance constraint parameters according to the motion constraint information sequence to obtain the motion calibration parameters of the flexible object in the sub-frame, including: Obtain the collision mass and collision position information of each particle of the collision object from the parameter information of the collision object in the sub-frame; Obtain the flexible mass and flexible position information of each particle of the flexible object from the initial physical model; For each particle of the collision object and each particle of the flexible object in sequence, based on the collision position information and the flexible object position information, determine the initial particle distance between the particle of the collision object and the particle of the flexible object; For each particle of the flexible object, based on the collision mass, the collision position information, the flexible object mass, the flexible object position information, and the initial particle distance, determine the first corrected distance of the particle of the flexible object; Determine the motion calibration parameter of the flexible object in the sub-frame as the first corrected distances of all the particles of the flexible object.

9. The method according to claim 7, wherein When the motion constraint information includes bending constraint parameters, the method for resolving the bending constraint parameters according to the motion constraint information sequence based on the parameter information of the collision object in the sub-frame and the initial physical model to obtain the motion calibration parameter of the flexible object in the sub-frame includes: Obtain the position information of each particle of the collision object from the parameter information of the collision object in the sub-frame; Obtain the position information and the flexible object mass of each particle of the flexible object from the initial physical model; Based on all the particles of the collision object and all the particles of the flexible object, construct a plurality of particle triangles; For each particle of the flexible object, determine two adjacent target particle triangles containing the particle; Based on the position information of each particle in the target particle triangles, determine the angle of the initial dihedral angle between the two adjacent target particle triangles; For each particle of the flexible object, based on the flexible object mass of the particle, the position information of all the particles in the two adjacent target particle triangles, and the angle of the initial dihedral angle, determine the second corrected distance of the particle of the flexible object; Determine the motion calibration parameter of the flexible object in the sub-frame as the second corrected distances of all the particles of the flexible object.

10. The method according to claim 7, wherein When the motion constraint information includes self-collision constraint parameters, the method for resolving the self-collision constraint parameters according to the motion constraint information sequence based on the parameter information of the collision object in the sub-frame and the initial physical model to obtain the motion calibration parameter of the flexible object in the sub-frame includes: Obtain the thickness of the flexible object, the flexible object mass of each particle of the flexible object, and the flexible object position information from the initial physical model; Based on all the particles of the flexible object, construct a plurality of particle triangles; For each particle of the flexible object, with the particle as the current vertex, based on the flexible object position information of the current vertex, the flexible object position information of three particles in each particle triangle, and the thickness, determine the distance change gradient of the current vertex; Based on the distance change gradient, determine the third corrected distance of the current vertex; Determine the motion calibration parameter of the flexible object in the sub-frame as the third corrected distances of all the particles of the flexible object.

11. The method according to claim 7, wherein When the motion constraint information includes continuous collision detection constraint parameters, resolving the continuous collision detection constraint parameters according to the motion constraint information sequence based on the parameter information of the collision objects in the sub-frame and the initial physical model to obtain the motion calibration parameters of the flexible object in the sub-frame includes: For each mass point of the flexible object, based on the parameter information of the collision objects in the sub-frame and the initial physical model, determine whether the mass point will intersect with the capsule in the collision objects within the sub-time interval between the sub-frame and the adjacent next sub-frame; If it is determined that the mass point will intersect with the capsule in the collision objects, determine the interval distance between the mass point and the axial length of the capsule; Determine the fourth correction distance of the mass point according to the interval distance; Determine the fourth correction distances of all the mass points of the flexible object as the motion calibration parameters of the flexible object in the sub-frame.

12. The method according to claim 11, wherein The determining whether the mass point will intersect with the capsule in the collision objects within the sub-time interval between the sub-frame and the adjacent next sub-frame based on the parameter information of the collision objects in the sub-frame and the initial physical model includes: Based on the parameter information of the collision objects in the sub-frame, determine the axial vector of the capsule, the center point position information of the capsule, the axial length of the capsule, and the radius of the capsule; Obtain the flexible body position information of the mass point from the initial physical model; Perform a dot product operation on the flexible body position information and the axial vector of the capsule to obtain a dot product operation result; Based on the flexible body position information and the center point position information of the capsule, determine the position vector between the mass point and the capsule; Determine the projection length of the position vector on the axial vector of the capsule; Based on the flexible body position information and the center point position information of the capsule, determine the distance between the mass point and the capsule; Based on the dot product operation result, the axial vector of the capsule, the radius of the capsule, and the projection length, the distance between the mass point and the capsule, and the axial length of the capsule, determine whether the mass point will intersect with the capsule in the collision objects within the sub-time interval between the sub-frame and the adjacent next sub-frame.

13. The method according to claim 12, wherein The determining whether the mass point will intersect with the capsule in the collision objects within the sub-time interval between the sub-frame and the adjacent next sub-frame based on the dot product operation result, the axial vector of the capsule, the radius of the capsule, and the projection length, the distance between the mass point and the capsule, and the axial length of the capsule includes: If the following conditions are satisfied, determine that the mass point intersects with the capsule in the collision objects: The absolute value of the dot product operation result is less than or equal to the sum of half of the length of the axial vector of the capsule and the radius of the capsule; and, The projection length is less than or equal to the radius of the capsule body, and the distance between the mass point and the capsule body is less than or equal to the sum of half of the axial length of the capsule body and the radius of the capsule body.

14. The method according to claim 11, wherein Said determining the fourth correction distance of the mass point according to the interval distance includes: Obtaining the radius of the capsule body; Determining the difference between the interval distance and the radius of the capsule body, and determining the fourth correction distance based on the difference.

15. The method according to claim 11, wherein The method further includes: If it is determined that the mass point will intersect the capsule body among the collision objects, then determining the soft body position information of the mass point and determining the axial vector of the capsule body; Performing a cross product operation on the soft body position information and the determined axial vector of the capsule body; Determining the fifth correction distance of the mass point according to the result of the cross product operation; wherein, after the soft body position information is position-corrected based on the fifth correction distance, the vector direction of the cross product between the obtained corrected soft body position information and the axial vector of the capsule body is the same as the vector direction of the result of the cross product operation; Determining the fifth correction distances of all the mass points of the soft body object as the motion calibration parameters of the soft body object in the sub-frame.

16. The method according to any one of claims 1 to 15, characterized in that, Said determining the parameter information of the collision object in each sub-frame based on the parameter information of the collision object in the video frames at two moments includes: Obtaining the first parameter information of the collision object in the video frame at the previous moment and the second parameter information of the collision object in the video frame at the later moment among the two moments; Based on the previous moment and the later moment, performing information interpolation processing on the first parameter information and the second parameter information to obtain the parameter information of the collision object in the sub-frame at each moment within the time interval.

17. A rendering device for flexible objects, characterized in that, The device includes: An acquisition module, configured to acquire, during the running of the virtual scene, the parameter information of the collision object in the video frames at two adjacent moments of the virtual scene, the initial physical model of the soft body object in the video frame at the previous moment among the two moments, and the constraint data set of the physical model of the soft body object pre-constructed; the initial physical model includes the initial parameters required for physically simulating the form of the soft body object at the previous moment; the constraint data set includes multiple different types of motion constraint information; A sub-frame division module, configured to divide the video frame at the previous moment into multiple sub-frames, and each sub-frame corresponds to a moment within the time interval between the two moments; A determination module, configured to determine the parameter information of the collision object in each sub-frame based on the parameter information of the collision object in the video frames at two moments; A solution module, configured to, for each sub-frame, based on the parameter information of the collision object in the sub-frame and the initial physical model, solve each motion constraint information in the constraint data set to obtain the motion calibration parameters of the soft body object in the sub-frame; A rendering module, configured to render the soft body object in the sub-frame based on the motion calibration parameters.

18. An electronic device, characterized in that, Includes: A memory, configured to store executable instructions; A processor, when executing the executable instructions stored in the memory, implements the soft body object rendering method according to any one of claims 1 to 16.

19. A computer-readable storage medium, characterized in that, Stored with executable instructions, when causing a processor to execute the executable instructions, implements the soft body object rendering method according to any one of claims 1 to 16.

20. A computer program product, the computer program product includes executable instructions, and the executable instructions are stored in a computer-readable storage medium; When a processor of an electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, implements the soft body object rendering method according to any one of claims 1 to 16.