Fabric Animation Processing Method and Device, Electronic Device, Storage Medium
By obtaining the fabric grid model and bone chain, using dynamic bone algorithms and physical simulation calculations, generating and fusing animations, the efficiency and control problems of fabric animation simulation in the existing technology are solved, and efficient and real fabric animation effects are achieved.
Patent Information
- Application Number
- CN202111668736.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-12-31
AI Technical Summary
Existing fabric animation simulation technology is difficult to achieve large-scale use and animation producers’ fine control over fabric shape, which makes animation performance difficult.
By obtaining the fabric mesh model and bone chain, using dynamic bone algorithms and physical simulation calculations, first and second-level animations are generated and fused to obtain the final fabric animation.
It reduces the amount of simulation operations, reduces performance consumption, improves the efficiency and control accuracy of animation production, and achieves a more realistic fabric animation effect.
Smart Images

Figure CN114299200B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and particularly to a method and apparatus for processing cloth animation, an electronic device, and a storage medium. Background Art
[0002] With the development of computer technology, cloth animation simulation technology has been widely used in fields such as animated movies and games. Through cloth animation simulation technology, effects such as deformation and fluttering of clothes on virtual characters are obtained to show rich motion details and increase the realism of the animation.
[0003] In related technologies, cloth simulation is a physical simulation based on the vertices of a mesh model. By constructing various spring and damping constraint networks between the vertices, the soft dynamics of the cloth are simulated. This cloth simulation based on discrete points has a large amount of simulation calculation and is difficult to implement for large-scale use. At the same time, in the cloth simulation completely based on constraint relationships, since there are a very large number of points and parameters involved in the simulation, it is very difficult for animators to adjust the cloth to the desired shape and dynamics, and can only be controlled by the simulation results, which brings great difficulties to animation performance. Summary of the Invention
[0004] In view of the above problems, the present application is proposed to provide a method and apparatus for processing cloth animation, an electronic device, and a storage medium that overcome the above problems or at least partially solve the above problems, including:
[0005] A method for processing cloth animation, including:
[0006] Obtain a cloth mesh model and a bone chain, where the bone chain is associated with the vertices of the cloth mesh model, the bone chain is formed by connecting a plurality of bones, and the levels of the plurality of bones decrease in sequence from the head to the tail of the bone chain; the bone chain includes dynamic bones configured with a dynamic bone algorithm, and the bones with levels greater than a preset level in the bone chain are configured with bone animations; the dynamic bones include at least some of the bones with levels less than the preset level;
[0007] Determine a first-level animation of the cloth mesh model according to the bone animation and the animation of the dynamic bones;
[0008] Obtain dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model;
[0009] Perform physical simulation calculations on the dynamic vertices according to the cloth constraints to obtain a second-level animation of the cloth mesh model;
[0010] Fuse the first-level animation and the second-level animation to obtain the cloth animation of the cloth mesh model.
[0011] Optionally, obtaining the dynamic vertices and cloth constraints corresponding to the dynamic skeleton in the cloth mesh model includes:
[0012] Obtaining the performance parameters of the currently running device;
[0013] When the performance parameters are greater than the first performance metric, obtaining the dynamic vertices and cloth constraints corresponding to the dynamic skeleton in the cloth mesh model.
[0014] Optionally, obtaining the performance parameters of the currently running device includes:
[0015] Obtaining the device model of the currently running device;
[0016] Determining the performance parameters corresponding to the device model from a first configuration table as the performance parameters of the currently running device; the first configuration table records multiple device models and the performance parameters corresponding to each device model.
[0017] Optionally, obtaining the performance parameters of the currently running device includes:
[0018] Obtaining the used resource information corresponding to the currently running device;
[0019] Determining the remaining resource information corresponding to the currently running device according to the used resource information;
[0020] Determining the performance parameters of the currently running device according to the remaining resource information.
[0021] Optionally, obtaining the dynamic vertices and cloth constraints corresponding to the dynamic skeleton in the cloth mesh model includes:
[0022] In response to a first switching operation on the cloth model from a long view to a close view, obtaining the dynamic vertices and cloth constraints corresponding to the dynamic skeleton in the cloth mesh model.
[0023] Optionally, fusing the first-level animation and the second-level animation to obtain the cloth animation of the cloth mesh model includes:
[0024] Obtaining the fusion weight parameters of the second-level animation corresponding to each dynamic vertex;
[0025] Fusing the second-level animation with the first-level animation according to the fusion weight coefficient to obtain the cloth animation of the cloth mesh model.
[0026] Optionally, determining the first-level animation of the cloth mesh model according to the skeleton animation and the animation of the dynamic skeleton includes:
[0027] Determine the animation parameters of the dynamic skeleton according to the bone animation;
[0028] Obtain the dynamic configuration parameters of the dynamic skeleton; the dynamic configuration parameters include damping, elastic coefficient, gravity, and angle constraint;
[0029] Process the animation parameters of the dynamic skeleton according to the damping, elastic coefficient, gravity, and angle constraint to generate the animation of the dynamic skeleton, so as to determine the first-level animation of the cloth mesh model.
[0030] Optionally, the determining the first-level animation of the cloth mesh model according to the bone animation and the animation of the dynamic skeleton further includes:
[0031] When the dynamic skeleton is inside the corresponding collision body, adjust the dynamic skeleton outside the collision body;
[0032] Determine the first-level animation of the cloth mesh model according to the animation of the adjusted dynamic skeleton.
[0033] Optionally, the performing physical simulation calculation on the dynamic vertices according to the cloth constraint to obtain the second-level animation of the cloth mesh model includes:
[0034] Obtain the maximum offset distance between the cloth mesh model and the dynamic skeleton;
[0035] Perform physical simulation calculation on the dynamic vertices according to the maximum offset distance and the cloth constraint to obtain the second-level animation of the cloth mesh model, so that the offset distance between the cloth mesh model and the dynamic skeleton in the third animation is less than the maximum offset distance.
[0036] A cloth animation processing device, comprising:
[0037] A first acquisition module, configured to acquire a cloth mesh model and a bone chain, the bone chain is associated with the vertices of the cloth mesh model, the bone chain is formed by connecting a plurality of bones, and the levels of the plurality of bones decrease in sequence in the direction from the head to the tail of the bone chain; the bone chain includes a dynamic skeleton configured with a dynamic skeleton algorithm, and the bones with levels greater than a preset level in the bone chain are configured with bone animations; the dynamic skeleton includes at least some of the bones with levels less than the preset level;
[0038] A first animation determination module, configured to determine the first-level animation of the cloth mesh model according to the bone animation and the animation of the dynamic skeleton;
[0039] A second acquisition module, configured to acquire the dynamic vertices and cloth constraints corresponding to the dynamic skeleton in the cloth mesh model;
[0040] A second animation determination module, configured to perform physical simulation calculations on the dynamic vertices according to the cloth constraints to obtain a second-level animation of the cloth mesh model;
[0041] A cloth animation generation module, configured to fuse the first-level animation and the second-level animation to obtain a cloth animation of the cloth mesh model.
[0042] Optionally, the second acquisition module includes:
[0043] A performance parameter acquisition module, configured to acquire performance parameters of the current running device;
[0044] A second animation parameter acquisition module, configured to acquire the dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model when the performance parameters are greater than a first performance index.
[0045] Optionally, the performance parameter acquisition module includes:
[0046] A device model acquisition module, configured to acquire the device model of the current running device;
[0047] A performance parameter acquisition module based on the device model, configured to determine the performance parameters corresponding to the device model from a first configuration table as the performance parameters of the current running device; the first configuration table records multiple device models and the performance parameters corresponding to each device model.
[0048] Optionally, the performance parameter acquisition module includes:
[0049] An occupied resource information acquisition module, configured to acquire the occupied resource information corresponding to the current running device;
[0050] A remaining resource information determination module, configured to determine the remaining resource information corresponding to the current running device according to the occupied resource information;
[0051] A performance parameter determination module based on the remaining resource information, configured to determine the performance parameters of the current running device according to the remaining resource information.
[0052] Optionally, the second acquisition module includes:
[0053] An acquisition module based on a switching operation, configured to, in response to a first switching operation for the cloth model from a long shot to a close shot, acquire the dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model.
[0054] Optionally, the cloth animation generation module includes:
[0055] A fusion weight parameter acquisition module, configured to acquire the fusion weight parameters of the second-level animations corresponding to each dynamic vertex;
[0056] An animation generation module based on the fusion weight parameters, configured to perform a fusion process on the second-level animation and the first-level animation according to the fusion weight coefficient to obtain the cloth animation of the cloth grid model.
[0057] Optionally, the first animation determination module includes:
[0058] An animation parameter determination module, configured to determine the animation parameters of the dynamic skeleton according to the skeleton animation;
[0059] A dynamic configuration parameter determination module, configured to acquire the dynamic configuration parameters of the dynamic skeleton; the dynamic configuration parameters include damping, elastic coefficient, gravity, and angle constraint;
[0060] A first animation generation module, configured to process the animation parameters of the dynamic skeleton according to the damping, elastic coefficient, gravity, and angle constraint to generate the animation of the dynamic skeleton, so as to determine the first-level animation of the cloth grid model.
[0061] Optionally, the first animation determination module includes:
[0062] A collision detection module, configured to adjust the dynamic skeleton outside the collision body when the dynamic skeleton is inside the corresponding collision body;
[0063] A first animation generation module based on collision detection, configured to determine the first-level animation of the cloth grid model according to the animation of the adjusted dynamic skeleton.
[0064] Optionally, the second animation determination module includes:
[0065] A maximum offset distance determination module, configured to acquire the maximum offset distance between the cloth grid model and the dynamic skeleton;
[0066] A second animation generation module based on the maximum offset distance, configured to perform physical simulation calculations on the dynamic vertices according to the maximum offset distance and the cloth constraint to obtain the second-level animation of the cloth grid model, so that the offset distance between the cloth grid model and the dynamic skeleton in the third animation is less than the maximum offset distance.
[0067] An electronic device, including a processor, a memory, and a computer program stored on the memory and capable of running on the processor, where when the computer program is executed by the processor, the steps of the cloth animation processing method as described above are implemented.
[0068] A computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps of the fabric animation processing method described above are implemented.
[0069] The present application has the following advantages:
[0070] In an embodiment of the present application, by obtaining a fabric mesh model and a bone chain associated with the vertices of the fabric mesh model, wherein the bone chain is formed by connecting a plurality of bones, and the levels of the plurality of bones decrease in sequence in the direction from the head to the tail of the bone chain; the bone chain includes dynamic bones configured with a dynamic bone algorithm, and bones with levels greater than a preset level in the bone chain are configured with bone animations; the dynamic bones include at least some of the bones with levels less than the preset level; determining a first-level animation of the fabric mesh model according to the bone animation and the animation of the dynamic bones; then, obtaining dynamic vertices corresponding to the dynamic bones in the fabric mesh model and fabric constraints; performing physical simulation calculations on the dynamic vertices according to the fabric constraints to obtain a second-level animation of the fabric mesh model; finally, fusing the first-level animation and the second-level animation to obtain a fabric animation of the fabric mesh model; in the process of performing vertex physical simulation calculations to obtain the second-level animation in the embodiment of the present application, the dynamic vertices corresponding to the dynamic bones are used, which are fewer than the vertices of the fabric mesh model. Therefore, the simulation operation amount is small and the consumed performance is less. Moreover, since the simulation vertices for performing physical simulation calculations are the vertices corresponding to the dynamic bones, and the fabric animation fuses the first-level animation and the second-level animation, it is easier to control the shape dynamics of the physical simulation calculations. In addition, when generating the first-level animation, only the bones with levels greater than the preset level in the bone chain need to be made with bone animations, which can also reduce the workload of animation production and improve the efficiency of animation production. Description of the Drawings
[0071] In order to more clearly illustrate the technical solutions of the present application, the drawings required to be used in the description of the present application will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0072] Figure 1 It is a flowchart of the steps of a fabric animation processing method according to an embodiment of the present application;
[0073] Figure 2 It is a schematic diagram of a virtual object according to an embodiment of the present application;
[0074] Figure 3 It is a schematic diagram of the initial animation display of a virtual object according to an embodiment of the present application;
[0075] Figure 4Schematic diagram of the first - level animation display of a virtual object in an embodiment of the present application;
[0076] Figure 5 Schematic diagram of the cloth animation display of a virtual object in an embodiment of the present application;
[0077] Figure 6 Schematic diagram of the maximum offset distance in an embodiment of the present application;
[0078] Figure 7 Block diagram of a cloth animation processing device in an embodiment of the present application. Detailed implementation manners
[0079] To make the above - mentioned objects, features, and advantages of the present application more obvious and understandable, the present application will be further described in detail below with reference to the accompanying drawings and specific implementation manners. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts belong to the scope of protection of the present application.
[0080] A cloth animation processing method provided by an embodiment of the present application can run on a local terminal device or a server. When the cloth animation processing method runs on the server, the cloth animation processing method can be implemented and executed based on a cloud interaction system, where the cloud interaction system includes a server and client devices.
[0081] In an optional implementation manner, various cloud applications can run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the running entity of the game program and the presenting entity of the game screen are separated. The storage and running of the cloth animation processing method are completed on the cloud game server, and the role of the client device is for data reception, sending, and presenting the game screen. For example, the client device can be a display device with data transmission function near the user side, such as a first terminal device, a television, a computer, a palm computer, etc.; however, the cloth animation processing method is performed by the cloud game server in the cloud. When playing a game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses data such as the game screen, returns it to the client device through the network, and finally, the client device decodes and outputs the game screen.
[0082] In an optional embodiment, taking a game as an example, the local terminal device stores a game program and is used to present game scenes. The local terminal device is used to interact with players through a graphical user interface, that is, conventionally, the game program is downloaded and installed on an electronic device and then run. The ways for the local terminal device to provide the graphical user interface to players can include various methods. For example, it can be rendered and displayed on the display screen of the terminal, or provided to players through holographic projection. For example, the local terminal device may include a display screen and a processor. The display screen is used to present the graphical user interface, which includes game scenes. The processor is used to run the game, generate the graphical user interface, and control the display of the graphical user interface on the display screen.
[0083] Referring to Figure 1 , a flowchart of steps of a cloth animation processing method provided by an embodiment of the present application is shown. In the embodiment of the present application, cloth animation may refer to the animation performance of flexible objects in an animated movie or an electronic game scene, including but not limited to the clothing, hair of virtual objects of human character types, or the hair of virtual objects of animal character types, etc.; the method may include the following steps:
[0084] Step 101, obtain a cloth mesh model and a bone chain. The bone chain is associated with the vertices of the cloth mesh model. The bone chain is formed by connecting multiple bones. The levels of the multiple bones decrease in sequence in the direction from the head to the tail of the bone chain; the bone chain includes dynamic bones configured with a dynamic bone algorithm. The bones with levels greater than a preset level in the bone chain are configured with bone animations; the dynamic bones include at least some of the bones with levels less than the preset level;
[0085] Step 102, determine the first-level animation of the cloth mesh model according to the bone animation and the animation of the dynamic bones;
[0086] Step 103, obtain the dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model;
[0087] Step 104, perform physical simulation calculations on the dynamic vertices according to the cloth constraints to obtain the second-level animation of the cloth mesh model;
[0088] Step 105, fuse the first-level animation and the second-level animation to obtain the cloth animation of the cloth mesh model.
[0089] In an embodiment of the present application, a cloth mesh model and a bone chain associated with the vertices of the cloth mesh model are obtained. The bone chain is formed by connecting multiple bones, and the levels of the multiple bones decrease in sequence in the direction from the head to the tail of the bone chain. The bone chain includes dynamic bones configured with a dynamic bone algorithm, and bones with levels greater than a preset level in the bone chain are configured with bone animations. The dynamic bones include at least some of the bones with levels less than the preset level. The first-level animation of the cloth mesh model is determined according to the bone animation and the animation of the dynamic bones. Then, dynamic vertices corresponding to the dynamic bones in the cloth mesh model and cloth constraints are obtained. Physical simulation calculations are performed on the dynamic vertices according to the cloth constraints to obtain the second-level animation of the cloth mesh model. Finally, the first-level animation and the second-level animation are fused to obtain the cloth animation of the cloth mesh model. In the process of performing vertex physical simulation calculations to obtain the second-level animation in the embodiment of the present application, the dynamic vertices corresponding to the dynamic bones are used, which are fewer than the vertices of the cloth mesh model. Therefore, the simulation calculation amount is small and the consumed performance is small. Moreover, since the simulation vertices for performing physical simulation calculations are the vertices corresponding to the dynamic bones, and the cloth animation fuses the first-level animation and the second-level animation, it is easier to control the modeling dynamics of the physical simulation calculations. In addition, when generating the first-level animation, only the bones with levels greater than the preset level in the bone chain need to be made into bone animations, which can also reduce the workload of animation production and improve the efficiency of animation production.
[0090] Next, the cloth animation processing method in this exemplary embodiment will be further described.
[0091] In step 101, a cloth mesh model and a bone chain are obtained. The bone chain is associated with the vertices of the cloth mesh model. The bone chain is formed by connecting multiple bones, and the levels of the multiple bones decrease in sequence in the direction from the head to the tail of the bone chain. The bone chain includes dynamic bones configured with a dynamic bone algorithm, and bones with levels greater than a preset level in the bone chain are configured with bone animations. The dynamic bones include at least some of the bones with levels less than the preset level.
[0092] The cloth model in an animated movie or game scene includes a cloth mesh model and a bone chain; the cloth mesh model is composed of a triangular patch mesh, and the triangular patch mesh includes vertices and triangular patches, which represent the appearance information of the object model and are responsible for rendering the corresponding model of the virtual character. Among them, the cloth model can refer to the model corresponding to a flexible body, including but not limited to the models corresponding to hair, clothes, etc. The bone chain is formed by connecting multiple bones, contains the structural information of the cloth model, and is responsible for controlling the deformation of the model. Each bone in the bone chain is associated with the vertices of the cloth mesh model. It can be understood that skinning operation is performed on the cloth mesh model according to the bone chain. The levels of the multiple bones that make up the bone chain decrease in turn from the head to the tail of the bone chain, that is, the closer the bone is to the head of the chain, the higher its level. The bone at the head of the chain can be understood as the root bone. As Figure 2 shown in the schematic diagram of a virtual object in an embodiment of the present application; the virtual object is a virtual character wearing a long dress, and the long dress can be divided into an upper garment and a skirt. Taking the skirt as an example, the model corresponding to the skirt is the cloth model. Combining Figure 2 it can be seen that there can be multiple bone chains included in the cloth model, and the levels of the bones decrease from top to bottom in turn, that is, the closer to the waist of the virtual character, the higher the level of the bones of the skirt.
[0093] The above preset level can be set according to actual needs. In this embodiment, greater than the preset level includes the preset level itself. Exemplarily, the preset level can be the highest level in the bone chain. At this time, the bones greater than the preset level are the bones at the highest level in the bone chain; the preset level can also be determined according to the number of bones included in the bone chain, and can also be determined according to the length of the bone chain.
[0094] Exemplarily, when determining the bones greater than the preset level according to the number of bones included in the bone chain, the bones greater than the preset level can be the bones determined by the preset percentage of the number of bones included in the bone chain starting from the head of the chain. The preset percentage can be 20%, 30%, 40%, etc., and is set according to actual needs. For example, when the bone chain is formed by connecting 4 bones, the levels are set for each bone in turn from the head to the tail of the chain. Assuming the levels are the first level, the second level, the third level, and the fourth level from high to low, if 30% of the number of bones included in the bone chain is used to determine the bones greater than the preset level, since 30% of the calculated number of bones is 1.2, rounding up is 2. Therefore, the bones greater than the preset level are two bones selected from the head of the chain to the tail of the chain as the bones greater than the preset level, that is, the preset level is the second level, and the bones greater than the preset level are the bones of the first level and the second level.
[0095] Exemplarily, when determining the bones above the preset level according to the length of the bone chain, the bones above the preset level can be determined from the head of the chain according to a preset percentage of the length of the bone chain. The preset percentage can be 20%, 30%, 40%, etc., and is set according to actual needs. For example, when the length of the bone chain is 20 (the unit is not limited and is consistent with the unit of the length of a single bone), it is formed by sequentially connecting 4 bones with lengths of 4, 6, 5, and 5 respectively. The head of the chain is the bone with a length of 4. Hierarchies are set for each bone in sequence from the head to the tail of the chain. Assuming the hierarchies are the first level, the second level, the third level, and the fourth level from high to low, if the bones above the preset level are determined by 30% of the length of the bone chain, since 30% of the length of the bone chain is calculated to be 6, and the length of the bone at the first level is 4 and the length of the bone at the second level is 6, it can be determined that the 30% position of the length of the bone chain corresponds to the bone at the second level. Therefore, the bones above the preset level are selected as two bones from the head to the tail of the chain as the bones above the preset level, that is, the preset level is the second level, and the bones above the preset level are the bones at the first level and the second level.
[0096] In this embodiment, the bone chain contains dynamic bones configured with a dynamic bone algorithm. That is, the bones in the bone chain driven by the dynamic bone algorithm are named dynamic bones. Among them, the dynamic bone algorithm is a simple algorithm based on simulating a spring oscillator to implement the physical simulation of a tree-like flexible body. Generally, all the bones in the bone chain can be used as dynamic bones, that is, all the bones in the bone chain are driven by the dynamic bone algorithm; or the bones in the bone chain without configured bone animations can be used as dynamic bones, that is, the bones with levels less than the preset level in the bone chain are configured with the dynamic bone algorithm; or some of the bones in the bone chain without configured bone animations can be used as dynamic bones, that is, some of the bones with levels less than the preset level in the bone chain are configured with the dynamic bone algorithm.
[0097] In step 102, the first-level animation of the cloth mesh model is determined according to the bone animation and the animation of the dynamic bones.
[0098] In this embodiment, the first-level animation of the cloth mesh model can be determined according to the bone animation and the animation of the dynamic bones. Since the animation of the dynamic bones is used in the first-level animation, the first-level animation of the cloth mesh model can display the animation effect of a flexible body.
[0099] Exemplarily, the process of determining the first-level animation of the cloth mesh model according to the bone animation and the animation of the dynamic bones can include:
[0100] Determine the initial animation of the cloth mesh model according to the bone animation;
[0101] Determine the dynamic animation of the cloth mesh model according to the animation of the dynamic skeleton;
[0102] Fuse the initial animation and the dynamic animation to obtain the first-level animation of the cloth mesh model.
[0103] After determining the skeleton for configuring the skeleton animation, by performing animation baking on this part of the skeleton, the initial animation of the cloth model, that is, the initial animation of the cloth mesh model, can be obtained. As Figure 3 shown, it is a schematic diagram of the initial animation display; combined with Figure 2 it can be known that Figure 3 the skeletons greater than the preset level in are part of the skeleton chain. Therefore, the animator only needs to formulate the skeleton animation for the skeletons greater than the preset level, rather than formulating the skeleton animation for all the skeletons in the skeleton chain, which can reduce the workload of the animator and improve the efficiency of animation production.
[0104] The animation obtained by driving the dynamic skeleton through the dynamic skeleton algorithm is the animation of the dynamic skeleton. According to the animation of the dynamic skeleton, the animation of the area corresponding to the dynamic skeleton in the cloth mesh model can be determined, which is the dynamic animation of the cloth mesh model.
[0105] Exemplarily, the determining of the dynamic animation of the cloth mesh model according to the animation of the dynamic skeleton includes:
[0106] Determine the animation parameters of the dynamic skeleton according to the skeleton animation of the skeletons greater than the preset level;
[0107] Obtain the dynamic configuration parameters of the dynamic skeleton; the dynamic configuration parameters include damping, elastic coefficient, gravity, and angle constraint;
[0108] Process the animation parameters of the dynamic skeleton according to the damping, elastic coefficient, gravity, and angle constraint to generate the animation of the dynamic skeleton, so as to determine the second-level animation of the cloth mesh model.
[0109] In this example, during the process of the dynamic skeleton algorithm driving the dynamic skeleton, it is necessary to determine dynamic configuration parameters such as the animation parameters, damping, elastic coefficient, gravity, and angular constraints of the dynamic skeleton. Among them, the animation parameters of the dynamic skeleton can include the movement speed and movement acceleration of the dynamic skeleton, and the movement speed and movement acceleration of the dynamic skeleton can be obtained from the skeleton animation, that is, the animation parameters of the dynamic skeleton are determined according to the skeleton animation of the skeleton with a level greater than the preset level. Exemplarily, when the dynamic skeleton is configured with a skeleton animation at the same time, the movement speed and movement acceleration corresponding to the configured skeleton animation are used as the movement parameters of the dynamic skeleton. When the dynamic skeleton is not configured with a skeleton animation, since the dynamic skeleton and the skeleton configured with the skeleton animation are in the same skeleton chain, therefore, based on the determination of the skeleton animation of some skeletons in the skeleton chain, the movement speed and movement acceleration generated by the dynamic skeleton under the influence of the skeleton animation can be determined. Exemplarily, the animation parameters of the dynamic skeleton can be calculated by the forward dynamics algorithm.
[0110] The dynamic configuration parameters of the dynamic skeleton can be set by the designer according to actual needs. It should be noted that in this embodiment, the angular constraint of the dynamic skeleton is not only a limitation on the rotation angles of the two axes outside the main axis of the skeleton during simulation, which can form a conical range of motion, but also can include single-axis rotation constraints and single-axis single-orientation rotation constraints. In some cases, the single-axis rotation constraint and the single-axis single-orientation rotation constraint can be used to avoid interpenetration phenomena. For example, when the cloth model is a skirt, the rotation of the skirt root can be set to be single-axis single-orientation outward, which can completely avoid the situation where the skeleton chain enters the collision body.
[0111] Furthermore, in an alternative embodiment of the present application, the above-mentioned angular constraint of the dynamic skeleton can also be adaptively adjusted according to the environmental wind field where the cloth model is located. Specifically, the environmental wind field parameters can be obtained. When the environmental wind field parameters are greater than the preset wind field threshold, the angular constraint is increased. Among them, the preset wind field threshold and the increased amount of the angular constraint can be set according to actual needs. It can be understood that when the environmental wind field parameters are greater than the preset wind field threshold, the animation of the cloth model is more obvious, making the animation effect of the cloth model more realistic.
[0112] Furthermore, in an alternative embodiment of the present application, the above-mentioned determination of the dynamic animation of the cloth mesh model according to the animation of the dynamic skeleton further includes:
[0113] When the dynamic skeleton is inside the corresponding collision body, adjust the dynamic skeleton outside the collision body;
[0114] Determine the dynamic animation of the cloth mesh model according to the animation of the adjusted dynamic skeleton.
[0115] In the process of generating the animation of the dynamic skeleton in this embodiment, it is necessary to perform collision detection on the dynamic skeleton. That is, when the dynamic skeleton is inside the corresponding collision body, the position of the dynamic skeleton is adjusted outside the collision body, and then the dynamic animation of the cloth mesh model is determined based on the animation of the adjusted dynamic skeleton, so as to avoid the phenomenon of penetration.
[0116] Specifically, the collision body can be of various types such as spherical, capsule-shaped, cubic, planar, etc.; preferably, a planar collision body can be used to increase the collision detection area as much as possible without destroying the shape, and improve the authenticity of the cloth animation.
[0117] Exemplarily, when the cloth model is a skirt, the collision body corresponding to the dynamic skeleton can be the collision body set on the leg of the virtual character. When the collision body is a spherical collision body, if the spherical collision body is large, the skirt will be lifted by the collision, destroying the shape; if the spherical collision body is small, it will be difficult for the collision to occur, resulting in the phenomenon of penetration. By using a planar collision body, by detecting whether the dynamic skeleton passes from one side (or the first side) of the planar collision body to the other side (or the second side) during the animation process, if so, the dynamic skeleton located on the second side of the planar collision body is adjusted to the relative position on the first side of the planar collision body, so that during the animation process of the dynamic skeleton, it will not penetrate the planar collision body. Correspondingly, the dynamic animation of the cloth mesh model obtained according to the animation of the dynamic skeleton will not have the phenomenon of penetration either.
[0118] Optionally, during the process of performing collision detection, the collision relationship between different dynamic skeletons can also be specified to obtain multiple collision groups, and the dynamic skeletons not in the same collision group do not participate in the collision calculation, thereby reducing the performance consumption of collision detection.
[0119] Optionally, during the process of generating the animation of the dynamic skeleton, multiple dynamic skeleton simulation sub-frames can also be calculated within a single-frame logical time to solve the problem of skeleton simulation jitter caused by the rapid switching of single-frame skeleton animations. The single-frame logical time is also called the frame rate. The dynamic skeleton simulation sub-frame refers to a single-frame picture that forms the animation of the dynamic skeleton. That is to say, in this embodiment, the single-frame picture of the dynamic skeleton animation can also be adaptively determined according to the frame rate based on the calculated animation of the dynamic skeleton, so that the dynamic skeleton animation is smoother and the problem of jitter caused by rapid single-frame switching can be solved.
[0120] After determining the initial animation and the dynamic animation of the cloth mesh model, the initial animation and the dynamic animation can be fused to obtain the first-level animation of the cloth mesh model.
[0121] Exemplarily, the dynamic animation can be superimposed on the basis of the initial animation to generate the first-level animation of the cloth mesh model.
[0122] Specifically, for the first type of bones configured with both skeletal animation and dynamic bone algorithm, the generation process of the first-level animation for the cloth mesh model area corresponding to the first type of bones is obtained by determining key frames through the skeletal animation of the first type of bones and determining the transition frames between the key frames through the dynamic bone algorithm. For the second type of bones configured only with skeletal animation, the generation process of the first-level animation for the corresponding cloth model area is obtained by determining key frames through the skeletal animation of the second type of bones and inserting smooth transition frames between the key frames. For the third type of bones driven only by the dynamic bone algorithm, the generation process of the first-level animation for the cloth mesh model area corresponding to the third type of bones is obtained through the dynamic bone algorithm. For the fourth type of bones that are neither configured with skeletal animation nor with the dynamic bone algorithm, the skeletal animation corresponding to the fourth type of bones can be obtained through the forward dynamics algorithm based on the parent-child relationship between the fourth type of bones and the bones configured with skeletal animation, and then the first-level animation for the cloth mesh model area corresponding to the fourth type of bones can be obtained.
[0123] As Figure 4 shown, the upper half of the skirt uses skeletal animation to generate the initial animation of the cloth mesh model, and the lower half of the skirt uses dynamic bones to generate the dynamic animation of the cloth mesh model. The first-level animation of the cloth mesh model is obtained by superimposing the initial animation and the dynamic animation.
[0124] In step 103, the dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model are obtained.
[0125] Among them, the dynamic vertices corresponding to the dynamic bones in the cloth mesh model refer to the vertices in the cloth mesh model associated with the dynamic bones. The cloth constraint refers to the constraint relationship between the vertices in the cloth mesh model. Specifically, the cloth constraint may include distance constraints, stretching constraints, motion constraints, etc. in the vertical, horizontal, and staggered directions of the vertices. It can be understood that the cloth constraint in this embodiment is the constraint relationship between the dynamic vertices, and the specific values of the cloth constraint are set by relevant personnel according to actual needs.
[0126] In step 104, physical simulation calculations are performed on the dynamic vertices according to the cloth constraints to obtain the second-level animation of the cloth mesh model.
[0127] After determining the dynamic vertices for physical simulation calculation, physical simulation calculation is performed according to the constraint relationships between the dynamic vertices, and a second-level animation of the cloth mesh model can be obtained, which can simulate the pulling effect between real cloth fibers, making the detail performance of the cloth model richer. Since the second-level animation in this embodiment is obtained by performing physical simulation calculation on the dynamic vertices, compared with performing physical simulation calculation on all mesh vertices in the cloth mesh model in the related art, in this embodiment, the calculation amount for obtaining the second-level animation of the cloth mesh model is smaller and the consumed performance is less.
[0128] In step 105, the first-level animation and the second-level animation are fused to obtain the cloth animation of the cloth mesh model.
[0129] After obtaining the first-level animation of the cloth model through the bone animation and the dynamic bones in this embodiment, the first-level animation and the second-level animation can also be fused to obtain the cloth animation of the cloth mesh model, so that the cloth animation can present a more realistic detail simulation effect on the basis of the first-level animation. As Figure 5 shown, the animation of the skirt is obtained by fusing the first-level animation and the second-level animation. Compared with Figure 4 the effect shown that only includes the first-level animation, Figure 5 the skirt animation effect shown is closer to the actual cloth effect.
[0130] Exemplarily, the above-mentioned fusing the first-level animation and the second-level animation to obtain the cloth animation of the cloth mesh model includes:
[0131] Obtain the fusion weight parameters of the second-level animation corresponding to each dynamic vertex;
[0132] According to the fusion weight coefficient, fuse the second-level animation and the first-level animation to obtain the cloth animation of the cloth mesh model.
[0133] In this embodiment, during the process of fusing the first-level animation and the second-level animation, the fusion weight parameters of the second-level animation can be set, and the animation fusion is performed according to the fusion weight parameters. Among them, the fusion weight parameters are used to determine the usage ratio of the first-level animation and the second-level animation used in the cloth animation obtained by fusing the first-level animation and the second-level animation.
[0134] Exemplarily, when the fusion weight parameter of the second-level animation is 0.5, it means that the second-level animation and the first-level animation each account for half of the influence on the cloth animation. When the fusion weight parameter of the second-level animation is 0.3, it means that the influence of the second-level animation on the cloth animation accounts for 0.3, while the influence of the first-level animation on the cloth animation accounts for 0.7.
[0135] It should be noted that the fusion weight parameters corresponding to different dynamic vertices can be different, that is, the fusion weight coefficients corresponding to each dynamic vertex can be set according to actual needs. Exemplarily, the fusion weight parameter of the dynamic vertex can increase as the distance from the head of the bone chain increases. As Figure 5 shown, the fusion weight parameters in the schematic diagram of the skirt can gradually increase in turn in the direction from top to bottom.
[0136] Furthermore, in an alternative embodiment of the present application, the above-mentioned physical simulation calculation of the dynamic vertices according to the cloth constraint to obtain the second-level animation of the cloth mesh model may include:
[0137] Obtain the maximum offset distance between the cloth mesh model and the dynamic bone;
[0138] Perform a physical simulation calculation on the dynamic vertices according to the maximum offset distance and the cloth constraint to obtain the second-level animation of the cloth mesh model, so that the offset distance between the cloth mesh model and the dynamic bone in the second animation is less than the maximum offset distance.
[0139] Among them, the maximum offset distance will affect the stretching deformation and movement amplitude of the cloth mesh model. As Figure 6 shown, the distance between the animation corresponding to the cloth mesh model and the dynamic bone is within the maximum offset distance. In this embodiment, performing a physical simulation calculation on the dynamic vertices according to the maximum offset distance and the cloth constraint can make the cloth mesh model generate an animation only within the set maximum offset distance range, which is convenient for controlling the animation effect. The maximum offset distance can be set according to actual needs. When the maximum offset distance is 0, it means that the physical simulation based on the dynamic vertices will not work. Therefore, generally, the maximum offset distance is not 0.
[0140] Furthermore, considering that the first-level animation can reflect the flexible effect of the cloth, and the first-level animation is implemented based on the bone animation and the dynamic bone algorithm, which has the characteristics of small computational complexity and is suitable for running on most devices. Although the second-level animation obtained by performing a physical simulation calculation based on the dynamic vertices can better reflect the detailed characteristics of the cloth, including effects such as pulling, it requires more device performance compared to the process of generating the first-level animation. Therefore, in an alternative embodiment of the present application, the above-mentioned obtaining of the dynamic vertices and cloth constraints corresponding to the dynamic bone in the cloth mesh model may include:
[0141] Obtain the performance parameters of the currently running device;
[0142] When the performance parameters are greater than the first performance index, obtain the dynamic vertices and cloth constraints corresponding to the dynamic bone in the cloth mesh model.
[0143] Among them, the current running device refers to the device used to run the game program. When the current running device is a local terminal device, the display screen corresponding to the current running device can be the display screen of the local terminal device; when the current running device is a server device, the display screen corresponding to the current running device can be the display screen of the client device. The performance parameters of the device are used to represent the ability of the device to process information. It can be understood that the larger the performance parameters, the stronger the ability of the device to process information.
[0144] It can be understood that in the embodiments of the present application, only when the performance of the current running device meets the requirements of the first performance index (that is, the performance parameter is greater than the first performance index), the relevant steps of generating the second-level animation will be executed on the current running device, so as to display the cloth animation integrating the first-level animation and the second-level animation on the corresponding display screen. When the performance of the current running device does not meet the requirements of the first performance index (that is, the performance parameter is less than the first performance index), only the relevant steps of generating the first-level animation will be executed, so as to display the first-level animation on the corresponding display screen. Among them, when being greater than the first performance index includes the first performance index itself, then being less than the first performance index does not include the first performance index itself; correspondingly, when being greater than the first performance index does not include the first performance index itself, then being less than the first performance index includes the first performance index itself.
[0145] In one example, to obtain the performance parameters of the current running device, the device model of the current running device can be obtained, and the performance parameters of the current running device can be determined according to a pre-set first configuration table. Among them, multiple device models and their corresponding performance parameters are recorded in the first configuration table. After determining the device model, the configuration table can be queried to obtain the corresponding performance parameters.
[0146] In another example, to obtain the performance parameters of the current running device, the used resource information of the current running device can be obtained in real time, and then the remaining resource information corresponding to the current running device can be determined according to the used resource information, and the performance parameters of the current running device can be determined according to the remaining resource information. Among them, the resource information can include CPU occupancy rate, memory occupancy rate, etc.
[0147] After obtaining the performance parameters, the performance parameters can be compared with the first performance index to determine the size relationship between the performance parameters and the first performance index, that is, to determine the performance index range to which the performance parameters belong.
[0148] Optionally, in other examples, the device model of the currently running device can also be obtained, and the performance index range corresponding to the performance parameters of the currently running device can be determined according to the second configuration table, that is, it can be determined whether the performance parameters are greater than the first performance index range or less than the first performance index range. The second configuration table records multiple device models and the corresponding performance index ranges for each device model. That is, after determining the device model, the second configuration table can be queried to directly determine the performance index range to which the corresponding performance parameters belong.
[0149] After determining the performance index range to which the performance parameters belong, the cloth animation processing method is determined according to the corresponding performance index range. That is, when the performance parameters are less than the first performance index, only the process of generating the first-level animation needs to be executed to display the first-level animation on the corresponding display screen, ensuring that the cloth model can display the basic animation form. When the performance parameters are greater than the first performance index, the process of generating the first-level animation, the second-level animation, and fusing the first-level animation and the second-level animation to obtain the cloth animation is executed to display the cloth animation obtained by fusing the first-level animation and the second-level animation on the corresponding display screen, so as to improve the animation detail performance effect of the cloth model.
[0150] In this embodiment, the corresponding cloth animation processing method can be adaptively selected according to the performance of the currently running device to generate the animation of the cloth model, ensuring the smooth operation of the game program and improving the animation performance effect within the performance range that the device can bear.
[0151] Furthermore, considering that in the animation display scenario of the cloth model, more detailed performance effects generally only need to be displayed in the case of a close view. In order to reduce the performance consumption of the running device, in an optional embodiment of the present application, the above-mentioned obtaining of the dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model may include:
[0152] In response to a first switching operation of the cloth model from a long view to a close view, the dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model are obtained.
[0153] In this embodiment, when the virtual scene where the cloth model is located switches from a long view to a close view, the relevant steps of generating the second-level animation are only executed on the currently running device, so as to display the cloth animation obtained by fusing the first-level animation and the second-level animation on the corresponding display screen. When the virtual scene where the cloth model is located switches from a close view to a long view, only the relevant steps of generating the first-level animation are executed, so as to display the first-level animation on the corresponding display screen.
[0154] Among them, the long shot and the close shot can be determined by comparing the distance between the fabric model and the corresponding virtual camera in the virtual scene with the set distance threshold. Exemplarily, when the distance between the fabric model and the virtual camera is less than the distance threshold, it indicates that the fabric model is in the close shot at this time; when the distance between the fabric model and the virtual camera is greater than or equal to the distance threshold, it indicates that the fabric model is in the long shot at this time.
[0155] In this embodiment, when the fabric model is in the long shot, only the relevant steps of generating the first-level animation are executed to reduce the calculation amount and performance consumption; when the fabric model is in the close shot, the relevant steps of generating the second-level animation are executed to display a more realistic simulation effect.
[0156] In the embodiment of the present application, a fabric mesh model and a bone chain associated with the vertices of the fabric mesh model are obtained. Among them, the bone chain is formed by connecting multiple bones, and the levels of the multiple bones decrease in sequence from the head to the tail of the bone chain; the bone chain includes dynamic bones configured with a dynamic bone algorithm, and the bones with levels greater than a preset level in the bone chain are configured with bone animations; the dynamic bones include at least some of the bones with levels less than the preset level; the first-level animation of the fabric mesh model is determined according to the bone animation and the animation of the dynamic bones; then, the dynamic vertices corresponding to the dynamic bones in the fabric mesh model and fabric constraints are obtained; physical simulation calculations are performed on the dynamic vertices according to the fabric constraints to obtain the second-level animation of the fabric mesh model; finally, the first-level animation and the second-level animation are fused to obtain the fabric animation of the fabric mesh model; in the process of performing vertex physical simulation calculations to obtain the second-level animation in the embodiment of the present application, the dynamic vertices corresponding to the dynamic bones are used, which are fewer than the vertices of the fabric mesh model. Therefore, the simulation operation amount is small and the consumed performance is small. Moreover, since the simulation vertices for performing physical simulation calculations are the vertices corresponding to the dynamic bones, and the fabric animation fuses the first-level animation and the second-level animation, it is easier to control the modeling dynamics of the physical simulation calculations; in addition, when generating the first-level animation, only the bones with levels greater than the preset level in the bone chain need to be made into bone animations, which can also reduce the workload of animation production and improve the efficiency of animation production.
[0157] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present application are not limited by the described action sequence, because according to the embodiments of the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present application.
[0158] Refer to Figure 7, showing a structural block diagram of an embodiment of a fabric animation processing device according to the present application. Corresponding to the method embodiment, in the embodiment of the present application, the fabric animation processing device may include the following modules:
[0159] The first acquisition module 701 is configured to acquire a fabric mesh model and a bone chain, the bone chain is associated with the vertices of the fabric mesh model, the bone chain is formed by connecting a plurality of bones, and the levels of the plurality of bones decrease in sequence in the direction from the head to the tail of the bone chain; the bone chain includes dynamic bones configured with a dynamic bone algorithm, and bones with levels greater than a preset level in the bone chain are configured with bone animations; the dynamic bones include at least some of the bones with levels less than the preset level;
[0160] The first animation determination module 702 is configured to determine a first-level animation of the fabric mesh model according to the bone animation and the animation of the dynamic bones;
[0161] The second acquisition module 703 is configured to acquire dynamic vertices and fabric constraints corresponding to the dynamic bones in the fabric mesh model;
[0162] The second animation determination module 704 is configured to perform physical simulation calculations on the dynamic vertices according to the fabric constraints to obtain a second-level animation of the fabric mesh model;
[0163] The fabric animation generation module 705 is configured to fuse the first-level animation and the second-level animation to obtain a fabric animation of the fabric mesh model.
[0164] Optionally, the second acquisition module 703 includes:
[0165] The performance parameter acquisition module is configured to acquire performance parameters of the current running device;
[0166] The second animation parameter acquisition module is configured to acquire dynamic vertices and fabric constraints corresponding to the dynamic bones in the fabric mesh model when the performance parameters are greater than a first performance index.
[0167] Optionally, the performance parameter acquisition module includes:
[0168] The device model acquisition module is configured to acquire the device model of the current running device;
[0169] The performance parameter acquisition module based on the device model is configured to determine the performance parameters corresponding to the device model from a first configuration table as the performance parameters of the current running device; the first configuration table records a plurality of device models and the performance parameters corresponding to each device model.
[0170] Optionally, the performance parameter acquisition module includes:
[0171] A used resource information acquisition module, configured to acquire used resource information corresponding to a currently operating device;
[0172] A remaining resource information determination module, configured to determine remaining resource information corresponding to the currently operating device according to the used resource information;
[0173] A performance parameter determination module based on remaining resource information, configured to determine a performance parameter of the currently operating device according to the remaining resource information.
[0174] Optionally, the second acquisition module 703 includes:
[0175] An acquisition module based on a switching operation, configured to, in response to a first switching operation for the cloth model from a long view to a close view, acquire dynamic vertices and cloth constraints corresponding to the dynamic skeleton in the cloth mesh model.
[0176] Optionally, the cloth animation generation module 705 includes:
[0177] A fusion weight parameter acquisition module, configured to acquire fusion weight parameters of a second-level animation corresponding to each dynamic vertex;
[0178] An animation generation module based on fusion weight parameters, configured to, according to the fusion weight coefficient, perform a fusion process on the second-level animation and the first-level animation to obtain a cloth animation of the cloth mesh model.
[0179] Optionally, the first animation determination module 702 includes:
[0180] An animation parameter determination module, configured to determine animation parameters of the dynamic skeleton according to the bone animation;
[0181] A dynamic configuration parameter determination module, configured to acquire dynamic configuration parameters of the dynamic skeleton; the dynamic configuration parameters include damping, elastic coefficient, gravity, and angle constraint;
[0182] A first animation generation module, configured to process the animation parameters of the dynamic skeleton according to the damping, elastic coefficient, gravity, and angle constraint to generate an animation of the dynamic skeleton, so as to determine a first-level animation of the cloth mesh model.
[0183] Optionally, the first animation determination module 702 includes:
[0184] A collision detection module, configured to, when the dynamic skeleton is inside a corresponding collision body, adjust the dynamic skeleton outside the collision body;
[0185] Generate a first animation module based on collision detection, which is used to determine the first-level animation of the cloth mesh model according to the animation of the adjusted dynamic skeleton.
[0186] Optionally, the second animation determination module 704 includes:
[0187] A maximum offset distance determination module, which is used to obtain the maximum offset distance between the cloth mesh model and the dynamic skeleton;
[0188] Generate a second animation module based on the maximum offset distance, which is used to perform physical simulation calculations on the dynamic vertices according to the maximum offset distance and the cloth constraints to obtain the second-level animation of the cloth mesh model, so that the offset distance between the cloth mesh model and the dynamic skeleton in the third animation is less than the maximum offset distance.
[0189] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For the related parts, please refer to the partial description of the method embodiment.
[0190] The embodiments of the present application also disclose an electronic device, including a processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, the steps of the cloth animation processing method described above are implemented.
[0191] The embodiments of the present application also disclose a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the cloth animation processing method described above are implemented.
[0192] Each embodiment in this specification is described in a progressive manner. The key points of each embodiment are the differences from other embodiments. For the same and similar parts between the embodiments, please refer to each other.
[0193] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a device, or a computer program product. Therefore, the embodiments of the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0194] Embodiments of the present application are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing terminal device generate a means for implementing the specified functions in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or in multiple blocks.
[0195] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction means that implements the specified functions in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or in multiple blocks.
[0196] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, such that a series of operation steps are executed on the computer or other programmable terminal device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the specified functions in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or in multiple blocks.
[0197] Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0198] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.
[0199] The above has introduced in detail a fabric animation processing method, device, electronic device and storage medium provided by the present application. Specific examples are used in this text to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for processing fabric animation, characterized in that, The method includes: Obtaining a cloth mesh model and a bone chain, where the bone chain is associated with the vertices of the cloth mesh model, the bone chain is formed by connecting multiple bones, and the levels of the multiple bones decrease in sequence in the direction from the head to the tail of the bone chain; the bone chain includes dynamic bones configured with a dynamic bone algorithm, and the bones with levels greater than a preset level in the bone chain are configured with bone animations; the dynamic bones include at least some of the bones with levels less than the preset level; Determining a first-level animation of the cloth mesh model according to the bone animation and the animation of the dynamic bones; the first-level animation is obtained by fusing the initial animation and the dynamic animation of the cloth mesh model, the initial animation is determined according to the bone animation, and the dynamic animation is determined according to the animation of the dynamic bones; Obtaining the dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model; Performing physical simulation calculations on the dynamic vertices according to the cloth constraints to obtain a second-level animation of the cloth mesh model; the cloth constraints are the constraint relationships between the dynamic vertices; Fusing the first-level animation and the second-level animation to obtain the cloth animation of the cloth mesh model, including: Obtaining the fusion weight parameters of the second-level animation corresponding to each dynamic vertex; Fusing the second-level animation with the first-level animation according to the fusion weight parameters to obtain the cloth animation of the cloth mesh model.
2. The method according to claim 1, characterized in that, The obtaining the dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model includes: Obtaining the performance parameters of the current running device; When the performance parameters are greater than a first performance index, obtaining the dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model.
3. The method according to claim 2, wherein The obtaining the performance parameters of the current running device includes: Obtaining the device model of the current running device; Determining the performance parameters corresponding to the device model from a first configuration table as the performance parameters of the current running device; the first configuration table records multiple device models and the performance parameters corresponding to each device model.
4. The method according to claim 2, wherein The obtaining the performance parameters of the current running device includes: Obtaining the used resource information corresponding to the current running device; Determining the remaining resource information corresponding to the current running device according to the used resource information; Determining the performance parameters of the current running device according to the remaining resource information.
5. The method according to claim 1, wherein The obtaining the dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model includes: In response to a first switching operation of the cloth mesh model from a long view to a close view, obtaining the dynamic vertices and cloth constraints corresponding to the dynamic bones in the cloth mesh model.
6. The method according to claim 1, characterized in that The determining the first-level animation of the cloth mesh model according to the bone animation and the animation of the dynamic bones includes: Determining the animation parameters of the dynamic bones according to the bone animation; Obtaining the dynamic configuration parameters of the dynamic bones; the dynamic configuration parameters include damping, elastic coefficient, gravity, and angle constraints; Process the animation parameters of the dynamic skeleton according to the damping, elastic coefficient, gravity, and angle constraints to generate the animation of the dynamic skeleton, so as to determine the first-level animation of the cloth mesh model.
7. The method according to claim 6, wherein The determining the first-level animation of the cloth mesh model according to the skeleton animation and the animation of the dynamic skeleton further includes: When the dynamic skeleton is inside the corresponding collision body, adjust the dynamic skeleton outside the collision body; Determine the first-level animation of the cloth mesh model according to the animation of the adjusted dynamic skeleton.
8. The method according to claim 1, wherein the performing physical simulation calculations on the dynamic vertices according to the cloth constraints to obtain the second-level animation of the cloth mesh model includes: Obtain the maximum offset distance between the cloth mesh model and the dynamic skeleton; Perform physical simulation calculations on the dynamic vertices according to the maximum offset distance and the cloth constraints to obtain the second-level animation of the cloth mesh model, so that the offset distance between the cloth mesh model and the dynamic skeleton in the second animation is less than the maximum offset distance.
9. A fabric animation processing device, characterized in that, The apparatus includes: A first acquisition module, configured to acquire a cloth mesh model and a bone chain, the bone chain is associated with the vertices of the cloth mesh model, the bone chain is formed by connecting a plurality of bones, and the levels of the plurality of bones decrease in sequence in the direction from the head to the tail of the bone chain; the bone chain includes a dynamic skeleton configured with a dynamic skeleton algorithm, and the bones with levels greater than a preset level in the bone chain are configured with bone animations; the dynamic skeleton includes at least some of the bones with levels less than the preset level; A first animation determination module, configured to determine the first-level animation of the cloth mesh model according to the bone animation and the animation of the dynamic skeleton; the first-level animation is obtained by fusing the initial animation and the dynamic animation of the cloth mesh model, the initial animation is determined according to the bone animation, and the dynamic animation is determined according to the animation of the dynamic skeleton; A second acquisition module, configured to acquire the dynamic vertices corresponding to the dynamic skeleton and the cloth constraints in the cloth mesh model; A second animation determination module, configured to perform physical simulation calculations on the dynamic vertices according to the cloth constraints to obtain the second-level animation of the cloth mesh model; the cloth constraints are the constraint relationships between the dynamic vertices; A cloth animation generation module, configured to fuse the first-level animation and the second-level animation to obtain the cloth animation of the cloth mesh model; The cloth animation generation module includes: A fusion weight parameter acquisition module, configured to acquire the fusion weight parameters of the second-level animations corresponding to each dynamic vertex; An animation generation module based on fusion weight parameters, configured to fuse the second-level animation and the first-level animation according to the fusion weight parameters to obtain the cloth animation of the cloth mesh model.
10. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, the steps of the cloth animation processing method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the fabric animation processing method described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Flexible object rendering method and device, storage medium and electronic device
CN111773688A
Virtual object rendering method and device, storage medium and electronic device
CN111773719A