A method and device for determining the computational complexity of an animation resource, a computer device, a medium and a program product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2026-01-21
- Publication Date
- 2026-06-02
Smart Images

Figure CN121564152B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device, medium, and program product for determining the computational complexity of an animation resource. Background Technology
[0002] Animation resources are data that describes animation and represents how objects present animated effects. For example, animation resources may include appearance data of a character and motion data on how the character moves.
[0003] In related technologies, commands can be entered via command-line tools to obtain the time consumed during the physical simulation of animation resources. This time consumption can then be used to estimate whether the computational complexity of the animation resources is too high. Computational complexity is used to identify the computational resources consumed in the physical simulation of animation resources; the higher the computational complexity, the higher the consumption of computer equipment.
[0004] However, obtaining time-consuming data through command-line tools has a high barrier to entry for animators. If it is not easily accessible, it may lead to the creation of animation resources with high computational complexity, which will put a heavy burden on computer equipment during runtime, and may even cause the computer equipment to crash or become unstable. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a method, apparatus, computer equipment, medium, and program product for determining the computational complexity of animation resources, which reduces the burden on computer equipment and improves the stability of computer equipment.
[0006] The embodiments of this application disclose the following technical solutions:
[0007] On one hand, embodiments of this application provide a method for determining the computational complexity of animation resources, the method comprising:
[0008] Identify the component to be identified, wherein the component to be identified is one of at least one components included in the animation resource;
[0009] Obtain the number of joints, material iterations, collision substeps, total number of collideable individuals, number of colliders, and number of constraints of the component to be identified;
[0010] The computational complexity of the component to be identified is determined based on the number of joints, the number of material iterations, the number of collision substeps, the total number of collideable individuals, the number of colliders, and the number of constraints.
[0011] On the other hand, embodiments of this application provide a device for determining the computational complexity of animation resources, the device comprising a determining unit and an acquiring unit;
[0012] The determining unit is used to determine the component to be identified, wherein the component to be identified is one of at least one component included in the animation resource;
[0013] The acquisition unit is used to acquire the number of joints, material iterations, collision substeps, total number of collideable individuals, number of colliders, and number of constraints of the component to be identified.
[0014] The determining unit is used to determine the computational complexity of the component to be identified based on the number of joints, the number of material iterations, the number of collision substeps, the total number of collideable individuals, the number of colliders, and the number of constraints.
[0015] On the other hand, embodiments of this application provide a computer device, the computer device including a processor and a memory:
[0016] The memory is used to store computer programs and to transfer the computer programs to the processor;
[0017] The processor is configured to execute the methods described above according to instructions in the computer program.
[0018] On the other hand, embodiments of this application provide a computer-readable storage medium for storing a computer program for performing the methods described above.
[0019] On the other hand, embodiments of this application provide a computer program product including a computer program, which, when run on a computer device, causes the computer device to perform the methods described above.
[0020] As can be seen from the above technical solution, instead of calculating the time consumption of all animation resources in a frame, it is possible to calculate the time consumption of a single component separately. This allows for a more precise estimation of resource consumption, enabling targeted optimization in the future. Specifically, the computational complexity of the component to be identified is determined based on the number of joints, material iterations, collision substeps, total number of collidable individuals, number of colliders, and number of constraints. Among them, joints are the key elements connecting rigid or flexible bodies. Their core function is to restrict the relative motion between objects. The more joints there are, the more times the joint positions need to be updated, and the higher the computational complexity. The more material iterations there are, the more accurate the cloth simulation is, and thus the higher the computational complexity. The number of collision substeps determines the number of collision detections in the same frame. The higher the number of collision substeps, the higher the accuracy and stability of collision handling, and the higher the computational complexity. The total number of collideable individuals is the scale of objects that may collide. The more of these, the higher the computational complexity. The number of colliders is the number of objects that actually participate in collision detection. The more of these, the higher the computational complexity. Constraints are rules used to maintain the deformation law of materials. Each constraint needs to be calculated separately. The more constraints there are, the more times they need to be solved, and thus the higher the computational complexity.
[0021] Therefore, for a component of an animation resource, its computational complexity can be determined based on multiple parameters that may affect its computational complexity. This computational complexity quantifies the computational resource consumption required by the component during physical simulation, thus clarifying the burden on the computer equipment imposed by the component or even the animation resource, enhancing the stability and reliability of the computer equipment. Furthermore, modifying the computational complexity of a component or even the animation resource can reduce its computational complexity, significantly improving the running efficiency of the animation resource on the computer equipment, thereby shortening simulation time and improving simulation accuracy and reliability. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A schematic diagram of the interface of a fabric simulation system provided for related technologies;
[0024] Figure 2 A schematic diagram of the debugging interface of a command-line tool provided for related technologies;
[0025] Figure 3A schematic diagram of a computer system for determining the computational complexity of animation resources, as provided in an embodiment of this application;
[0026] Figure 4 A schematic diagram illustrating an application scenario of a method for determining the computational complexity of animation resources provided in an embodiment of this application;
[0027] Figure 5 A flowchart illustrating a method for determining the computational complexity of an animation resource, provided in an embodiment of this application;
[0028] Figure 6 A schematic diagram of an animation node of a component provided in an embodiment of this application;
[0029] Figure 7 A schematic diagram of a detailed information panel provided in an embodiment of this application;
[0030] Figure 8 A partial schematic diagram of a different type of component provided in an embodiment of this application;
[0031] Figure 9 This is a schematic diagram of an interface for displaying modification prompts according to an embodiment of this application;
[0032] Figure 10 This is a schematic diagram of a plug-in interface proposed in an embodiment of this application;
[0033] Figure 11 This is a schematic diagram of an interface with multiple animation nodes proposed in an embodiment of this application;
[0034] Figure 12 This is a schematic diagram of a viewport panel according to an embodiment of this application;
[0035] Figure 13 A schematic diagram of a device for determining the computational complexity of an animation resource provided in an embodiment of this application;
[0036] Figure 14 This application provides a schematic diagram of the structure of a server according to an embodiment of the present application.
[0037] Figure 15 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0039] It should be noted that this application may display prompt interfaces, pop-ups, or output voice prompts before and during the collection of user-related data (e.g., animation resources). These prompt interfaces, pop-ups, or voice prompts are used to inform the user that their relevant data is being collected. This ensures that the application only begins the steps for collecting user-related data after receiving confirmation from the user regarding the prompt interface or pop-up; otherwise (i.e., without receiving confirmation from the user), the steps for collecting user-related data end, meaning no user-related data is collected. In other words, all user data collected in this application is collected with the user's consent and authorization, and the collection, use, and processing of relevant user data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0040] Physics simulation is a computational method that uses mathematical models and algorithms to simulate the behavior of real-world physical systems. In related technologies, animators can obtain the time taken for animation resources during the physics simulation process via command-line input. The following explanation uses a cloth simulation system as an example.
[0041] See Figure 1 , Figure 1 This is a schematic diagram of the interface of a cloth simulation system provided for related technologies. The cloth simulation system is a mesh-based physical simulation method used to simulate the movement and behavior of cloth on various computer devices. For example, the interface illustrates functional areas such as a cloth resource list, mask configuration, mesh binding, configuration, cloth drawing, and view. Animators can perform operations such as area selection and animation preview within this interface.
[0042] The cloth simulation system also provides a command-line tool that can calculate the relevant time-consuming data for physical simulation while animation assets are running. See also Figure 2 The image shows a schematic diagram of the debugging interface of a command-line tool provided by related technologies. For example... Figure 2 As shown, users can enter codes (i.e. commands) for the corresponding functions. After receiving the input commands, the computer device can display various types of time-consuming data.
[0043] However, obtaining time consumption information through command-line tools is a high-barrier-to-use method for animators. Animators are usually not familiar with the input methods of commands or the operating environment of tools, making it difficult to conveniently obtain time consumption information during the production process.
[0044] Furthermore, in physical simulation, an animation asset typically includes multiple components used in the simulation. For example, the hem of a coat, shoulder fabric, belt, and ribbons. These components each have their own computational complexity in the actual physical simulation and may be created separately during animation production. However, command-line tools can only output the total time consumed by the entire animation asset in a single frame, failing to break it down to the individual time consumed by each component. This makes it impossible for animators to determine which specific component is causing the high computational overhead, hindering targeted optimization for that component.
[0045] Based on this, embodiments of this application provide a method, apparatus, computer equipment, medium, and program product for determining the computational complexity of animation resources. Each individual component in the animation resource is treated as a component to be identified and calculated independently. The computational complexity of the component to be identified is determined by data that affects the consumption of computational resources during physical simulation, such as the number of joints, the number of material iterations, the number of collision substeps, the total number of collidable individuals, the number of colliders, and the number of constraints. This allows for a more precise understanding of the burden that the component places on the computer equipment during physical simulation.
[0046] To facilitate understanding of the method for determining the computational complexity of animation resources provided in the embodiments of this application, the computer system for this method will be described below.
[0047] See Figure 3 This figure is a schematic diagram of a computer system for a method of determining the computational complexity of animation resources according to an embodiment of this application. The computer system 100 includes multiple devices, such as multiple terminal devices 110 and multiple servers 120, etc. The terminal devices 110 and servers 120 can communicate with each other through a communication network.
[0048] The communication network uses standard communication technologies and / or protocols, typically the Internet, but can also be any network, including but not limited to Bluetooth, local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, private network, or any combination of virtual private network. In some embodiments, custom or dedicated data communication technologies may be used to replace or supplement the aforementioned data communication technologies.
[0049] The terminal device can be an electronic device such as a smartphone, wearable device, personal computer (PC), intelligent voice interaction device, smart home appliance, vehicle terminal, aircraft, unmanned vending terminal, extended reality (XR) device, etc. XR devices can include virtual reality (VR) devices, augmented reality (AR) devices, and mixed reality (MR) devices. A client application for the target application can be installed and run on the terminal device. This target application can be an application that supports a defined computational complexity, or other applications that support displaying animations; this application does not limit the specific form of the target application. Furthermore, this application does not limit the form of the target application, including but not limited to applications (Apps), mini-programs, etc., installed on the terminal device, and can also be in the form of a webpage.
[0050] A server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data. The server can be a backend server for the target application, providing backend services to the client of the target application, such as identifying the component to be identified, obtaining various parameters to determine the computational complexity, and determining the computational complexity of the component to be identified based on these parameters.
[0051] To facilitate understanding of the method for determining the computational complexity of animation resources provided in this application embodiment, the following example uses a server as the execution subject of the method for determining the computational complexity of animation resources to illustrate the application scenarios of the method for determining the computational complexity of animation resources.
[0052] See Figure 4 This figure is a schematic diagram illustrating an application scenario of a method for determining the computational complexity of animation resources provided in an embodiment of this application. Figure 4 In this application scenario, server 410, terminal device 420, and database 430 are included. Server 410 performs the computational complexity calculation, terminal device 420 displays the animation interface, and database 430 stores the parameters of the component to be identified. See A1-A5 for details.
[0053] In A1, such as Figure 4The animation creation interface 440 shown allows users to select the component to be identified from the animation resources via terminal device 430. Figure 4 (The middle part is the character's head), and the selection operation for the part to be identified is sent to the server 410 through the communication network.
[0054] In A2, server 410 determines the component to be identified based on a selection operation.
[0055] In A3, server 410 retrieves various parameters of the component to be identified from database 430, including the number of joints, material iteration count, collision substep count, total number of collidable individuals, number of colliders, and number of constraints. These parameters may be calculated by server 410 or terminal device 420 and stored in database 430.
[0056] It should be noted that the above parameters may also be stored in the server 410 or the terminal device 420, or may be calculated in real time by the server 410 or the terminal device 420. This application embodiment does not limit this.
[0057] In A4, server 410 determines the computational complexity of the part to be identified based on the number of joints, material iterations, collision substeps, total number of collideable individuals, number of colliders, and number of constraints.
[0058] In A5, the terminal device 420 obtains the computational complexity of the component to be identified through a communication network and displays it on the animation production interface 440 for animators to reference. For example... Figure 4 As shown, the computational complexity of the head is 12087.
[0059] It should be noted that A1-A5 above can also be executed through terminal device 420, that is, animation production and computational complexity calculation are completed through the same computer device. This application embodiment does not limit this.
[0060] Therefore, the server obtains multiple parameters based on the component selected by the user on the terminal device, calculates the computational complexity of that component based on these parameters, and then displays it to the user through the terminal device. In this way, animators can obtain the computational resource overhead of individual components during the animation production process, thereby identifying and making targeted adjustments to components with high computational complexity before the physical simulation stage. This helps improve animation production efficiency and reduce the computational burden during subsequent physical simulation.
[0061] The method for determining the computational complexity of animation resources provided in this application embodiment can be executed by a server. However, in other embodiments of this application, the terminal device may also have similar functions to the server, thereby executing the method for determining the computational complexity of animation resources provided in this application embodiment, or the terminal device and the server may jointly execute the method for determining the computational complexity of animation resources provided in this application embodiment. This embodiment does not limit this.
[0062] The following describes in detail a method for determining the computational complexity of animation resources provided in this application through method embodiments.
[0063] See Figure 5 This figure is a flowchart illustrating a method for determining the computational complexity of animation resources according to an embodiment of this application. For ease of description, the following embodiment uses a computer device as the execution subject of this method for determining the computational complexity of animation resources, such as the aforementioned terminal device or server. Figure 5 As shown, the methods for determining the computational complexity of this animation resource include S501-S503.
[0064] S501: Identify the component to be identified.
[0065] Animation assets are data that describes animation and represents how an object should be animated. For example, an animation asset can be an animation blueprint or an animation node within an animation blueprint.
[0066] Animation Blueprints are a specialized type of blueprint in Unreal Engine used to control the animation effects of skeletal meshes. Different animation nodes can be created within the Animation Blueprint to directly control the bones of the skeletal mesh. Alternatively, frame-by-frame logic can be set for the skeletal mesh to calculate its final animation pose. Animation nodes in the Animation Blueprint are used to perform various operations, such as processing animation assets, blending animation poses, and manipulating the bones of the skeletal mesh. The physical simulation calculation process can be embedded within custom animation nodes, where physical simulation algorithms are implemented to perform the calculations.
[0067] A component is an independently computeable part of an animation resource. An animation resource can include at least one component, and each component can have independent motion rules and physical properties. Taking an animation resource used to describe the animation process of a garment as an example, the outer skirt, inner skirt, sleeves, and ribbons of the garment can be four components included in that animation resource.
[0068] The component to be identified is one of at least one components included in the animation resource. In other words, the component to be identified can be determined from the components included in the animation resource to determine the computational complexity of the component to be identified.
[0069] The embodiments of this application do not specifically limit the division method of components. The following description uses three division methods as examples.
[0070] Classification method one: Classification according to mechanical properties.
[0071] For example, in animation assets, areas susceptible to swaying and areas that remain stationary can be divided into different components. For instance, the skirt area could be a component, the cape area a component, the hair area a component, and the torso a component. Different areas have different mechanical properties, and calculating their computational complexity separately can more accurately reflect the computational overhead of components with different mechanical properties.
[0072] The second method of division is based on structural hierarchy.
[0073] For example, when creating animation assets of cloth, it can be divided according to the structural hierarchy of the cloth. For instance, the outer layer of cloth is one component, the inner lining is another component, and the decorative layer is yet another component. Calculating the computational complexity of each component separately can more accurately reflect the computational overhead of different structural levels.
[0074] The third method of division is based on the scope of binding.
[0075] For example, based on the bound bone range, areas driven by the same bone group can be considered as a component. For instance, the bones related to the left sleeve constitute one component, and the bones related to the right sleeve constitute another. Different bone groups have different motion drive methods, and their corresponding computational complexity can be calculated independently.
[0076] This application does not specifically limit the method for determining the component to be identified. For example, the component currently being manufactured can be identified as the component to be identified. Alternatively, components can be identified sequentially from beginning to end according to their manufacturing order. Yet another example is that a user-specified component can be identified as the component to be identified.
[0077] As one possible implementation, if the animation resource is an animation blueprint, and the animation blueprint is used to implement the physical simulation process of an object, then the object can be identified to obtain multiple parts, and multiple animation nodes corresponding to each part can be generated. These animation nodes are used to implement the physical simulation process of the corresponding part. For example, animators can add relevant parameters for each part to the animation nodes corresponding to each part.
[0078] See Figure 6 , Figure 6This is a schematic diagram of animation nodes for a component provided in an embodiment of this application. For the physical simulation process of five components—inner skirt, outer skirt, sleeves, ribbon, and upper ribbon—corresponding animation nodes can be created and generated, such as physical animation nodes for the inner skirt, outer skirt, sleeves, ribbon, and upper ribbon. Furthermore, parameters such as damping, world damping (position), world damping (rotation), stiffness, radius, limiting angle, drag coefficient, and wind force coefficient can be adjusted within these animation nodes.
[0079] Therefore, by dividing animation resources into multiple independently computable components and identifying the components to be identified, the subsequent determination of computational complexity can be made more targeted and precise. This facilitates accurate assessment of the resource overhead of the component during the physical simulation process, providing an accurate basis for optimizing the animation resource production process.
[0080] The following section explains the process of determining the computational complexity of the component to be identified using S502-S503.
[0081] S502: Obtain the number of joints, material iterations, collision substeps, total number of collideable individuals, number of colliders, and number of constraints of the part to be identified.
[0082] The following sections will introduce the number of joints, material iterations, collision substeps, total number of collidable individuals, number of colliders, and number of constraints.
[0083] (1) A joint is a point that connects different parts in an animation. The number of joints is the number of joints in a component. Joints can connect rigid or flexible bodies. For example, if performing physical simulation on a skeleton-based animation resource, a joint can be a connection point connecting two bones, a connection point connecting cloth and the character's body, or a connection point connecting particles at different positions on the cloth. Similarly, if performing physical simulation on a mesh-based animation resource, a joint can be a connection point connecting the vertices of a face. The following explanation will use a mesh-based animation resource as an example.
[0084] The core function of joints is to constrain the relative motion between two objects, allowing them to move without completely separating. For example, joints can keep two objects at a certain distance, angle, or direction while allowing them to move within a limited range, thus creating natural animation effects.
[0085] (2) The number of material iterations represents the number of times the internal deformation and recovery process of the material is repeatedly calculated in a simulation. In other words, the number of material iterations is the number of cycles within the simulated material. Through iteration, the shape of the material after being subjected to force is continuously corrected to make it closer to the real physical effect.
[0086] Specifically, in the physical simulation of materials, materials deform under stress, such as being pulled by gravity, blown by wind, or affected by collisions. A single calculation cannot immediately bring the material to a stable state, so multiple iterations are required to allow the material to continuously adjust its position. The higher the number of material iterations, the more times the internal structure of the material is corrected, and the more stable the material's motion becomes, thus closely resembling the real physical effect.
[0087] For example, when fabric is stretched by an external force, if the positional change is calculated only once, unnatural folds or jerking may occur. With multiple iterations, the fabric gradually adjusts its position, eventually presenting a natural curve or drape. At this point, the more times the material is iterated, the smoother the fabric deformation becomes, and the closer it is to the actual appearance of fabric in reality.
[0088] (3) The number of collision substeps is the number of times the collision detection is broken down in a frame of animation. In physical simulation, in order to prevent materials from penetrating the body or other objects when moving at high speed, computer devices often do not perform collision detection only once, but will further subdivide the time in a frame into multiple smaller steps, and perform collision detection again in each step.
[0089] For example, a single frame of animation might only be 1 / 60th of a second, but if an object moves very fast, a single collision detection might result in a "penetration" phenomenon, such as clothing piercing through a character's body. By dividing the collision into more frequent collision detections, it's possible to capture every potential collision within finer time intervals, thus making the physics simulation more stable and realistic.
[0090] (4) A collider is a shape used for collision detection. It can represent the area occupied by an object in space, so as to determine whether other objects come into contact with or penetrate it in the physical simulation. A collisionable individual is used to represent an object that may come into contact with the collider and needs to be collision detected during the physical simulation. It can also represent objects that participate in collision within the animation resource (such as particles of a component that can participate in collisions, and particles are a type of collisionable individual). The total number of collisionable individuals is the number of all objects that may come into contact with the collider and need to be collision detected, which can indicate the scale of objects actually participating in collision detection. Among them, collisionable individuals can be points or joints connected by joints in a component.
[0091] (5) The number of colliders is the number of colliders. For example, the number of colliders can be the number of all colliders that come into contact with the part to be identified.
[0092] (6) Constraints are rules used to restrict the relative motion between objects, and are used to maintain the deformation law and structural stability of objects. The number of constraints is the total number of constraints. In the simulation of flexible materials such as cloth and rope, constraints are used to ensure that adjacent particles will not be stretched infinitely, collapse or deform in a way that does not conform to the material properties, so that the simulation results are closer to the real physical performance.
[0093] Constraints can define the distances, angles, or relative positions that particles should maintain, ensuring that fabric or rope retains its proper structure when subjected to external forces. For example, lateral, longitudinal, and diagonal constraints in fabric can ensure that the mesh structure of the fabric is not destroyed in the horizontal, vertical, and diagonal directions, respectively.
[0094] The embodiments of this application do not specifically limit the method of obtaining the above data. For example, it can be calculated in real time based on pre-set parameters, it can be obtained through initialization of a physical simulation system, or it can be calculated through an actual physical simulation process.
[0095] One possible implementation is to fill in relevant parameters for the component to be identified in the animation resources based on the physical simulation characteristics of the component. This allows the computer to calculate the number of joints, material iterations, collision substeps, total number of collidable individuals, number of colliders, and number of constraints for the component. For example, see... Figure 7 , Figure 7 This is a schematic diagram of a detailed information panel provided in an embodiment of this application. Constraints and collision relationships can be bound in the detailed information panel of the animation node corresponding to the component to be identified, and physical parameters of the component to be identified, such as joint pairs, exclusion of skeletons, root collisions, and structural longitudinal constraints, can be entered. In addition, other parameters, such as rigidity and friction coefficient, can be adjusted (not shown in the figure).
[0096] S503: Determine the computational complexity of the part to be identified based on the number of joints, the number of material iterations, the number of collision substeps, the total number of collidable individuals, the number of colliders, and the number of constraints.
[0097] Computational complexity is used to represent the amount of computational resources required to perform physical simulation of animation resources. For example, the more basic operations (such as addition and multiplication) the part to be identified performs in a frame, the higher the computational complexity and the higher the resource consumption of the computer equipment.
[0098] Joints are points that connect different parts, and each joint needs to have its position and motion state updated in every frame. Therefore, the more joints there are, the more position update calculations the computer needs to perform, resulting in higher computational complexity.
[0099] The material iteration count indicates the number of times the material's internal deformation is repeatedly adjusted in a single simulation. A higher iteration count requires more repeated calculations, resulting in a more accurate material simulation, but also increases computational complexity.
[0100] The number of collision substeps determines the number of times collision detection is subdivided in a frame. Each additional collision substep requires one more round of collision detection, so the more collision substeps there are, the higher the computational complexity.
[0101] Collisable individuals are objects that may come into contact with a collider. The more collisable individuals there are, the more collision detections the computer needs to perform, and thus the higher the computational complexity.
[0102] Colliders are shape objects used to determine whether a collision has occurred. The more colliders there are, the more matching combinations there are in collision detection, and therefore the higher the computational load and complexity of collision detection.
[0103] Constraints are rules used to maintain the deformation law of materials. Each constraint needs to be solved individually. Therefore, the more constraints there are, the more times the computer needs to perform the solution, and the higher the computational complexity.
[0104] Physical simulation consists of multiple independent but interconnected steps, such as position updating, collision detection, and constraint solving. Different parameters correspond to the computational requirements of different steps. For example, the number of joints affects the scale of position updating, the number of material iterations affects the number of deformation solutions, the number of collision sub-steps, the total number of collideable individuals, and the number of colliders collectively affect the computational scale of collision detection, and the number of constraints determines the number of constraint solutions. Since all these stages must be executed to complete the physical simulation process of one frame of animation, a single parameter cannot cover the entire computational process of the part to be identified. Only by combining multiple parameters can the actual computational load of the part to be identified in the entire physical simulation process be fully and accurately reflected, making the determination of computational complexity more comprehensive, realistic, and reliable.
[0105] This application does not specifically limit how to determine the computational complexity of the component to be identified based on the above parameters. Two determination methods are described below as examples.
[0106] Method 1 can be used to determine the computational complexity by adding or multiplying the number of joints, the number of material iterations, the number of collision substeps, the total number of collidable individuals, the number of colliders, and the number of constraints.
[0107] In the second method, different weights can be assigned to the number of joints, the number of material iterations, the number of collision substeps, the total number of collidable individuals, the number of colliders, and the number of constraints. The weights are used to indicate the degree of influence on the computational complexity. Then, a weighted sum is performed to obtain the computational complexity.
[0108] In related technologies, the physical simulation time of animation resources is usually obtained by inputting commands through the command line. Animators need to manually input command line commands in the code runtime environment, which is extremely unfriendly to non-professional programmers. In addition, the command line method for obtaining computational complexity can only output the overall time consumption, and cannot distinguish it by component. This conflicts with the animator's production logic. When creating animation resources, animators not only need to break them down into multiple parts to complete, but also need to make continuous modifications. The output can only be the physical simulation time of the entire animation resource. Animators cannot know which component consumes more computational resources during the physical simulation process, and cannot provide accurate positive feedback on the animation resource production process.
[0109] In this embodiment, after identifying the component to be identified, the computer device can automatically acquire various parameters of the component that can affect its computational complexity, and determine the computational complexity of the component accordingly. This eliminates the need for animators to input program commands, making it more accessible and convenient. Furthermore, by identifying the component and outputting the computational complexity on a component-by-component basis, animators can more meticulously refine the production process based on the computational complexity of each component, thereby reducing the likelihood of producing resource-intensive animation resources.
[0110] As can be seen from the above technical solution, instead of calculating the time consumption of all animation resources in a frame, it is possible to calculate the time consumption of a single component. This allows for a more precise estimation of resource consumption, facilitating targeted optimization later. For a single component of an animation resource, the computational complexity of that component is obtained based on multiple parameters that may affect computational complexity. This computational complexity quantifies the degree of computational resource consumption required by that component during physical simulation, thus clarifying the burden on the computer equipment imposed by that component or even the animation resource, enhancing the stability and reliability of the computer equipment. Furthermore, the computational complexity of a component can be modified by adjusting its computational complexity to reduce the computational complexity of that component or even the animation resource, improving the running efficiency of the animation resource on the computer equipment, thereby shortening simulation time and improving simulation accuracy and reliability.
[0111] In the physical simulation process, different types of operations are performed at different stages. To more accurately reflect the computational complexity of the component to be identified in the physical simulation process, this application divides the physical simulation solution process into three stages: a preprocessing stage, a collision stage, and a constraint stage. This proposes a specific implementation of S503, which is described below. See B1-B4 for details:
[0112] B1: Determine the first complexity of the component to be identified in the preprocessing stage based on the number of joints.
[0113] The pre-processing (Presolve) stage is the initial calculation stage for physical simulation. The computer equipment can calculate the displacement offset that each movable object (such as particles that can participate in the movement) in the component to be identified should produce in the current frame based on external forces (such as gravity, wind force, drag force) and the inertia generated by the motion in the previous frame.
[0114] The first level of complexity is the degree of computational resource consumption required in the preprocessing stage.
[0115] In the preprocessing stage, each movable object needs to have its motion tendency and displacement caused by forces and inertia calculated. Joints are used to connect movable objects, so the more joints there are, the more times the position is updated, and the more computational load the preprocessing stage will be. Therefore, the number of joints can be used to measure the primary complexity of the preprocessing stage.
[0116] As one possible implementation, the initial complexity is positively correlated with the number of joints in the component to be identified. That is, the more joints in the component to be identified, the higher the initial complexity. Taking the initial complexity of the preprocessing stage as being proportional to the number of joints in the component to be identified as an example, the initial complexity can be calculated using Equation 1:
[0117] (Formula 1)
[0118] in, The first complexity of the component to be identified. The number of joints in the component to be identified.
[0119] B2: Determine the second complexity of the part to be identified in the collision phase based on the number of material iterations, the number of collision substeps, the total number of collideable individuals, and the number of colliders.
[0120] The collision phase is used to detect whether a collision occurs between a collided object and a colliding object, and to calculate the collision result. During the collision phase, the computer device needs to determine whether the collided object of the component to be identified comes into contact with, penetrates, or bounces off surrounding colliding objects, and calculates the position of the collided object based on the collision detection results.
[0121] The second complexity refers to the computational resource consumption required during the collision phase. Several parameters can influence this second complexity.
[0122] First, the number of material iterations determines how many times the material is updated based on the collision detection results. More material iterations mean more calls to collision detection results and more corrections to the material after applying force. Second, the number of collision sub-steps is used to break down collision detection in a frame into multiple finer time intervals to avoid penetration issues caused by high-speed motion. More collision sub-steps mean more collision detections are needed per frame. Third, the total number of collideable individuals represents the scale of objects that may collide. A larger total number of collideable individuals results in a larger scale of collision detection. Finally, the number of colliders represents the actual number of objects participating in collision detection. More colliders mean each collideable object needs to undergo repeated collision detection against more colliders, further increasing the computational resource consumption during the collision phase.
[0123] Therefore, the scale of collision detection is determined by the number of colliders and the total number of collidable individuals, the number of collision detection calculations is determined by the number of collision sub-steps, and the number of times the collision detection results are applied to update material deformation is determined by the number of material iterations. Thus, the entire collision detection process is covered by the number of material iterations, the number of collision sub-steps, the total number of collidable individuals, and the number of colliders, resulting in a more accurate second complexity.
[0124] As one possible implementation, the second complexity is positively correlated with the number of material iterations of the part to be identified, the number of collision sub-steps of the part to be identified, the total number of collidable individuals of the part to be identified, and the number of colliders of the part to be identified. In other words, the higher the values of the above parameters, the higher the second complexity. Taking the second complexity of the collision phase as being proportional to the number of material iterations, the number of collision sub-steps, the total number of collidable individuals, and the number of colliders of the part to be identified as an example, the second complexity can be calculated using Formula 2:
[0125] (Formula 2)
[0126] in, The second complexity of the component to be identified. For material iterations, For the number of collision sub-steps, The total number of individuals that can collide. The number of colliders.
[0127] B3: Determine the third complexity of the component to be identified in the constraint phase based on the number of constraints.
[0128] The constraint phase is used to solve for the constraints on the stretching and contraction relationships caused by the structure of the medium.
[0129] The third complexity is the degree of computational resource consumption required in the constraint phase.
[0130] Each constraint needs to participate in the solution process independently. By continuously adjusting the position of the object corresponding to the constraint, the overall material tends to stabilize. Therefore, the more constraints there are, the more position adjustment operations need to be solved, the more times the computer device performs constraint solving, and the higher the computational resource consumption of the constraint phase, resulting in higher complexity.
[0131] As one possible implementation, the third complexity is positively correlated with the number of constraints on the component to be identified; that is, the more constraints, the higher the third complexity. Taking the direct proportionality between the third complexity and the number of constraints on the component to be identified as an example, the third complexity can be calculated using Equation 3:
[0132] (Formula 3)
[0133] in, The third complexity of the component to be identified. For material iterations, To constrain the quantity.
[0134] In the constraint phase, the computer equipment needs to repeatedly solve for the positions of the particles involved in the constraint according to the relationships defined by the constraints, so that the material gradually recovers to a reasonable deformation state after being subjected to external forces. The third complexity, which describes the computational resource consumption of the constraint phase, can be determined by two factors. The number of constraints reflects the scale of the constraint relationships that need to be solved; the more constraints, the more position corrections need to be performed. The material iteration count indicates the number of loops in which constraint solving is repeated in a simulation. Each iteration requires recalculating all constraints; therefore, the more material iterations, the more times all constraints need to be solved repeatedly. In other words, the number of constraints reflects the amount of content to be solved, and the material iteration count reflects the number of repetitions; the combination of the two can more comprehensively cover the computational resource consumption of the constraint phase. Therefore, the third complexity of the component to be identified in the constraint phase can be determined based on the material iteration count and the number of constraints.
[0135] B4: Determine the computational complexity of the component to be identified based on the first, second, and third complexities.
[0136] The preprocessing stage, collision stage, and constraint stage constitute the basic workflow of physical simulation. The preprocessing stage predicts the position based on external forces and inertia; the collision stage detects collisions between collideable individuals and colliders and corrects the position; and the constraint stage maintains the material's deformation characteristics according to constraints. Because these three stages handle different types of computational tasks in the physical simulation process and can comprehensively cover the main computational scenarios of the component to be identified, the computational complexity is not only precise but also comprehensive.
[0137] Based on this, the computational complexity of the component to be identified can be determined according to the first, second, and third complexities. For example, the third complexity can be determined using Formula 4:
[0138] (Formula 4)
[0139] in, The computational complexity of the component to be identified. The first complexity of the component to be identified. The second complexity of the component to be identified. This represents the third complexity of the component to be identified.
[0140] Therefore, by dividing the physical simulation process into a preprocessing stage, a collision stage, and a constraint stage, it is more consistent with the reality of the part to be identified in the physical simulation process. The complexity of the three stages is determined according to the number of joints, the number of material iterations, the number of collision substeps, the total number of collideable individuals, the number of collision bodies, and the number of constraints. This allows for a more detailed characterization of the computational resource consumption of the part to be identified in different stages of the physical simulation process, resulting in a more detailed composition of computational complexity and higher accuracy.
[0141] This application does not specifically limit the type of component to be identified. Five types are used as examples for illustration below.
[0142] Type 1, Multi-Layer Fabric Type. Multi-layer fabric types are used to simulate flexible materials with wide-surface structures, such as clothing, capes, and skirts. Components of the multi-layer fabric type are typically composed of a two-dimensional mesh structure.
[0143] See Figure 8 , Figure 8 This is a partial schematic diagram of a different type of component provided in an embodiment of this application. Points represent particles, and edges represent constraints. The multi-layered fabric type can be a two-dimensional mesh structure, where different particles are constrained at least in the horizontal, vertical, and diagonal directions.
[0144] Type Two: Ribbon Type. The ribbon type is used to simulate long, thin, lightweight, and highly flexible strip-shaped objects, such as ribbons, headbands, and flag ribbons. Compared to fabric, ribbons have a more linear structure, and their movement primarily unfolds along a rope-like path. Ribbons can be attached to one end and can be moved via... Figure 8 The structure shown restricts the relative motion of particles by longitudinal constraints.
[0145] Continue as Figure 8 As shown, the ribbon type can be formed by multiple parallel particle strings. In the horizontal and diagonal directions, the particles are not constrained, only the longitudinal constraints of the structure are included.
[0146] Type 3, Rope Type. Rope types are used to simulate slender, continuous structures such as ropes, chains, and tail ornaments. Rope-type structures are one-dimensional series structures, capable of exhibiting natural swinging, hanging, and traction behaviors, making them suitable for reproducing flexible structures with high tension. Rope types can be connected at both ends, and the particles exhibit a curved shape, allowing them to be manipulated through... Figure 8 The bending longitudinal constraint shown (or other bending types of constraint, not shown in the figure) restricts the bending behavior between particles.
[0147] Continue as Figure 8 As shown, the rope type can be composed of a string of particles, and the particles are not constrained in the horizontal or diagonal directions.
[0148] Type Four: Elastic Rod Type. Elastic rods are used to simulate slender structures with a certain degree of bending stiffness but still capable of displacement and deformation, such as decorative strips, flexible antennas, character back decorations, and wing edges. Elastic rods typically include not only basic structural constraints but also bending constraints to maintain the bending curvature, exhibiting mechanical properties such as elastic recovery, slight swaying, and amplitude attenuation.
[0149] Type 5, Soft Block Type. The Soft Block type is used to simulate flexible objects with volumetric structures, such as soft dolls, jelly-shaped props, stuffing materials, and small soft accessories. Unlike one-dimensional or two-dimensional structures such as multi-layered cloth, ribbon, and rope types, the Soft Block type typically presents a three-dimensional lattice or shell-enclosed structure, containing numerous constraints to maintain volume and shape stability, such as volume constraints and surface constraints. The Soft Block type can support high-order simulation behaviors such as deformation, compression, extrusion, and elastic recovery.
[0150] In one possible implementation, the type of the component to be identified can be determined. The type to be identified can be preset or automatically identified by a computer device; this embodiment does not limit this.
[0151] Different calculation methods can be used depending on the type of component to be identified. The following three cases will be used as examples to illustrate this.
[0152] Scenario 1: The component to be identified is a multi-layered fabric type.
[0153] This application does not specifically limit the method for determining the second complexity. The following description takes a multi-layered fabric type as the example of the component to be identified. Please refer to C1-C3 for details:
[0154] C1: Obtain the structural lateral constraint coefficient, the number of particles for the structural lateral constraint, the structural longitudinal constraint coefficient, the number of particles for the structural longitudinal constraint, the oblique constraint coefficient, and the number of particles for the oblique constraint.
[0155] Constraints can be multi-directional. For example, constraints can include lateral constraints, longitudinal constraints, and diagonal constraints.
[0156] The structural constraints are categorized into three types: Lateral constraints, Structural Constraints, and Diagonal Constraints. Lateral constraints are used to limit the relative motion between particles in the horizontal direction. For example, in a fabric mesh, lateral constraints are often placed between adjacent particles to prevent the fabric from being stretched too long or too short in the lateral direction, thus maintaining the naturalness of lateral deformation. Vertical constraints are used to limit the relative motion between particles in the vertical direction. For example, in fabric simulations such as skirts or capes, vertical constraints are usually placed between vertically arranged particles to ensure that the fabric maintains its basic length structure when subjected to gravity or swaying, preventing unnatural overstretching. Diagonal constraints are used to limit the relative motion between particles in the diagonal direction. For example, in a quadrilateral fabric mesh, diagonal constraints are usually added between two adjacent diagonal points to ensure that the fabric maintains a natural diagonal structure when subjected to complex directional forces (such as rotation or curling).
[0157] The number of particles participating in the lateral constraint of a structure indicates the total number of particles involved in the lateral constraint. The number of particles participating in the longitudinal constraint of a structure indicates the total number of particles involved in the lateral constraint, and the number of particles participating in the diagonal constraint indicates the total number of particles involved in the diagonal constraint. The lateral constraint coefficient indicates whether the lateral constraint participates in collision detection, as do the longitudinal constraint coefficient and the diagonal constraint coefficient. For example, if the lateral constraint coefficient is 0, indicating that the lateral constraint of the component to be identified does not participate in collision detection, then the number of particles participating in the lateral constraint collision detection for the component to be identified is 0.
[0158] C2: Determine the total number of collideable individuals based on the number of joints, the structural lateral constraint coefficient, the number of particles with structural lateral constraints, the structural longitudinal constraint coefficient, the number of particles with structural longitudinal constraints, the oblique constraint coefficient, and the number of particles with oblique constraints.
[0159] In collision detection, the objects involved in the collision include not only particles but also the joints connecting them. By determining the number of particles and joints involved in the collision detection, the total number of collideable individuals can be determined. However, the component to be identified may not necessarily involve collision detection in all directions; therefore, calculations can be performed by combining coefficients from various constraints.
[0160] The number of joints involved in collision detection can be determined based on the number of joints. The number of particles involved in collision detection based on the lateral constraint coefficient and the number of particles involved in the lateral constraint can be determined based on the lateral constraint coefficient and the number of particles involved in the lateral constraint. The number of particles involved in collision detection based on the longitudinal constraint coefficient and the number of particles involved in the longitudinal constraint can be determined based on the longitudinal constraint coefficient and the number of particles involved in the longitudinal constraint. Finally, the above numbers are added together to obtain the total number of collisionable individuals.
[0161] As one possible implementation, C2 can be represented by Equation 5:
[0162] (Formula 5)
[0163] in, The total number of collisionable individuals of the component to be identified. For the number of joints, This represents the lateral constraint coefficient of the structure. The number of particles constrained laterally by the structure. This represents the longitudinal constraint coefficient of the structure. The number of particles constrained by the longitudinal direction of the structure. The oblique constraint coefficient is... The number of particles constrained by the oblique direction.
[0164] As one implementation method, the structural lateral constraint coefficient, structural longitudinal constraint coefficient, and diagonal constraint coefficient can be represented by 1 to indicate that they can participate in collisions, and by 0 to indicate that they cannot participate in collisions.
[0165] C3: Determine the second complexity of the part to be identified in the collision phase based on the number of material iterations, the number of collision substeps, the total number of collideable individuals, and the number of colliders.
[0166] After calculating the total number of collidable individuals using C1-C2, the second complexity of the component to be identified during the collision phase can be calculated by combining the number of material iterations, the number of collision sub-steps, and the number of colliders. See section B2 above for relevant details, which will not be repeated here.
[0167] Therefore, since multi-layered fabric types usually have denser mesh structures and more complex multi-directional constraint relationships, the distribution of lateral, longitudinal, and diagonal constraints may also be different between different layers. Thus, by introducing structural lateral constraints, structural longitudinal constraints, and diagonal constraints, and obtaining the coefficients of each directional constraint and their corresponding particle numbers, it is possible to better match the actual collision detection scale of multi-layered fabric types in the collision stage, making the calculation results of the total number of collisionable individuals more refined, more flexible, and more consistent with the reality of the parts to be identified in the physical simulation process.
[0168] This application does not specifically limit how the number of colliding bodies is determined. The following description takes a multi-layered fabric type as the example to be identified. See D1-D2 for details:
[0169] D1: Based on the type of collider that can collide with the part to be identified, the number of each type of collider can be obtained.
[0170] The types of colliders that can collide with the part to be identified can include spherical colliders, capsule-shaped colliders, and planar colliders.
[0171] Among them, the spherical collider is a collider that uses a sphere as the detection boundary to represent a region of objects in space with an approximately spherical shape. The advantage of the spherical collider is its simple calculation method, making it suitable for most scenarios requiring rapid distance determination. For example, spherical colliders are typically used to simulate the volume of areas such as the head, shoulders, and wrists of a character's body, allowing materials like cloth, hair, or ropes to accurately collide with the sphere's surface during movement, preventing penetration.
[0172] A capsule collider is a collider composed of a hemisphere and a cylinder, typically used to represent slender body parts or objects, such as a character's arms, thighs, or torso. Capsule colliders more realistically conform to the slender shape of the human body and are better suited than spherical colliders for simulating continuous contact areas between fabric and the body surface when bending or sliding. In collision detection, capsule colliders can effectively reduce issues such as fabric penetration, sharp folds, or adhesion errors, thereby improving the accuracy and stability of fabric collisions.
[0173] A planar collider is a type of collider used to simulate an infinitely extending planar region, suitable for representing the surface of the ground, walls, or large fixed objects. During physics simulations, when fabric, ropes, or particles come into contact with a planar collider, they need to be constrained to one side of the plane according to the definition of a planar collider to prevent them from penetrating the ground or undergoing physics-independent motion. For example, when a skirt swings and comes into contact with a planar collider on the ground, some of its particles will be "blocked" by the plane, preventing them from passing through the ground.
[0174] It can obtain the number of each type of collider, thus reflecting the scale of collision detection between the part to be identified and various types of colliders. For example, it can obtain the number of spherical colliders, capsule-shaped colliders, and planar colliders.
[0175] D2: Determine the number of colliders based on the sum of the quantities corresponding to each type of collider.
[0176] As one possible implementation, D2 can be represented by Equation 6:
[0177] (Formula 6)
[0178] in, The number of colliders for the component to be identified. The number of spherical collisions. The number of capsule-shaped colliders. This represents the number of planar colliders.
[0179] Therefore, the number of different types of colliders can be counted separately, and then summed to obtain the number of colliders used for collision detection, thus accurately reflecting the scale of colliders. Since different types of colliders differ in shape characteristics and collision participation methods, obtaining the number of each type of collider separately can avoid the errors caused by rough statistics in a single method, thereby more realistically reflecting the number of colliders faced by the part to be identified during the physical simulation process.
[0180] This application does not specifically limit how the number of constraints is determined. The following description takes a multi-layered fabric type as an example to illustrate one specific implementation of B3. Please refer to E1-E3 for details:
[0181] E1: Obtain the number of transverse constraints, longitudinal constraints, lateral bending constraints, longitudinal bending constraints, and oblique constraints of the structure.
[0182] Among them, the bending lateral constraint number is used to restrict the bending behavior of particles in the horizontal direction, and the bending longitudinal constraint number is used to restrict the bending behavior of particles in the vertical direction. The structural lateral constraint number is the number of structural lateral constraints, the structural longitudinal constraint number is the number of structural longitudinal constraints, the bending lateral constraint number is the number of bending lateral constraints, the bending longitudinal constraint number is the number of bending longitudinal constraints, and the oblique constraint number is the number of oblique constraints.
[0183] E2: The number of constraints is obtained by summing the number of transverse constraints, longitudinal constraints, lateral bending constraints, longitudinal bending constraints, and diagonal constraints.
[0184] Unlike the collision phase, the constraint phase requires more than just structural particle connections, such as longitudinal, lateral, and oblique constraints. It necessitates a comprehensive approach to address the deformation of the component in all directions, including stretching, contraction, and bending. Therefore, in addition to lateral, longitudinal, and oblique constraints, bending lateral and longitudinal constraints must also be included in the calculation of the constraint count.
[0185] The number of constraints can be obtained by adding the number of transverse constraints, longitudinal constraints, lateral bending constraints, longitudinal bending constraints, and oblique constraints.
[0186] E3: Determine the third complexity of the component to be identified in the constraint phase based on the number of material iterations and the number of constraints.
[0187] As one possible implementation, E2-E3 can be represented by Equation 7:
[0188] (Formula 7)
[0189] in, The third complexity of the component to be identified. For material iterations, The number of lateral constraints of the structure. For the number of longitudinal constraints of the structure, For the number of lateral bending constraints, For the longitudinal constraint number of bending, This represents the number of oblique constraints.
[0190] For relevant details, please refer to B3 above, which will not be repeated here.
[0191] Therefore, by separately obtaining the number of structural lateral constraints, structural longitudinal constraints, bending lateral constraints, bending longitudinal constraints, and oblique constraints, the number of constraints can more comprehensively cover the constraints of the component to be identified in more directions, thus truly reflecting the solution scale of the component in the constraint stage. This makes the determination process of the third complexity of multi-layer cloth types more consistent with the computational laws of actual physical simulation.
[0192] In one possible implementation, F1 can be executed if the part to be identified is a multi-layered fabric type.
[0193] F1: If the part to be identified is a multi-layered fabric type, then execute the steps of obtaining the number of joints, material iterations, collision substeps, total number of collidable individuals, number of colliders, and number of constraints of the part to be identified, as well as subsequent steps. That is, if the part to be identified is a multi-layered fabric type, then steps S502-S503, B1-B4, C1-C3, D1-D2, and E1-E3 can be executed.
[0194] Therefore, by determining the type of component to be identified before determining the computational complexity, an appropriate computational method can be automatically adopted for different types of components. For example, when the component to be identified is a multi-layered cloth type, since this type is the most complex, the number of joints, material iterations, collision substeps, total number of collidable individuals, number of colliders, and number of constraints of the component can be obtained. By calculating the computational complexity of the multi-layered cloth type component using all these parameters, the burden that the multi-layered cloth type component places on the computer equipment can be clearly defined, thereby enhancing the stability and reliability of the computer equipment.
[0195] Scenario 2: The component to be identified is a ribbon. See G1-G2 for details.
[0196] G1: If the part to be identified is a ribbon type, then obtain the number of joints, the number of collision substeps, the number of collision bodies, and the number of constraints.
[0197] For ribbon-type components to be identified, their structures are usually relatively simple, often employing methods such as... Figure 8 As shown, in a single-layer chain structure, the internal deformation calculation of the material in a physical simulation process often only requires one or a few iterations to achieve the desired effect. Therefore, the number of material iterations is usually fixed at 1 or other constants. That is, the ribbon type does not require multiple internal iterations for correction as in multi-layer fabric types. Based on this, in the process of calculating computational complexity, the step of obtaining the number of material iterations for the ribbon type to be identified can be omitted, and it can be directly treated as a constant, without needing to participate in the calculation as an explicit parameter.
[0198] Furthermore, the total number of collideable individuals is used to represent the scale of objects participating in collision detection. For multi-layered cloth types, the mesh structure is complex, and collideable individuals include both particles and constraints in multiple directions, requiring complex comprehensive calculations. However, for ribbon types, the structure typically only includes longitudinal structural constraints as a connection method, connecting particles through longitudinal joints. In other words, the total number of collideable individuals can be directly represented by the number of joints. For example, the total number of collideable individuals can be the number of joints × 2.
[0199] G2: Determine the computational complexity of the component to be identified based on the number of joints, the number of collision substeps, the number of collision bodies, and the number of constraints.
[0200] Based on the foregoing analysis, the constant value of the material iteration count and the ratio of the total number of collidable individuals to the number of joints can be substituted into the aforementioned steps for determining computational complexity. To simplify the calculation, the number of joints, collision substeps, collision bodies, and constraints can be directly obtained, and the computational complexity of the component to be identified can be determined based on the combination of the number of joints, collision substeps, collision bodies, constraints, and constant values.
[0201] Therefore, while ribbon-type components can be calculated using the F1 algorithm, the computational complexity is less complex than that of multi-layered fabric components. Since ribbons have simpler internal properties, there's no need to obtain the material iteration count and the total number of collidable individuals, nor are these parameters required for the calculation. This simplifies the computational process, reduces the number of parameters, and still accurately reflects the resource consumption of ribbons in physical simulations, thus improving computational efficiency.
[0202] In one possible implementation, the complexity calculation for the ribbon-type component to be identified can be performed in stages. Specifically, this application provides a concrete implementation of G2, as detailed in H1-H4:
[0203] H1: Determine the first complexity of the component to be identified in the preprocessing stage based on the number of joints.
[0204] For relevant details, please refer to B1 above, which will not be repeated here.
[0205] H2: Determine the second complexity of the part to be identified in the collision phase based on the number of joints, the number of collision substeps, and the number of colliders.
[0206] Since the number of material iterations can be represented by constants and the total number of collidable individuals can be represented by the existing number of joints, the second complexity can be determined without the need for either to participate in the collision phase calculation.
[0207] In one possible implementation, the second complexity is positively correlated with the number of joints, the number of collision substeps, and the number of colliders. In other words, the higher the number of joints, collision substeps, and colliders, the higher the second complexity.
[0208] As one possible implementation, taking a material iteration count of 1 and a total number of collidable individuals equal to the number of joints as an example, H2 can be expressed by Equation 8:
[0209] (Formula 8)
[0210] in, The second complexity of the component to be identified. For the number of collision sub-steps, For the number of joints, The number of colliders.
[0211] Therefore, by constantting the number of material iterations and representing the total number of collidable individuals by the number of joints, the calculation process of the second complexity reduces unnecessary data acquisition and computation. While reducing computational overhead, the positive correlation between the number of joints, the number of collision substeps, the number of collision bodies and the second complexity can still accurately reflect the computational resource consumption of the ribbon type in the physical simulation process, thereby improving the accuracy and efficiency of the computational complexity determination process.
[0212] H3: Determine the third complexity of the component to be identified in the constraint phase based on the number of constraints.
[0213] As one possible implementation, the H3 process can be simplified based on the special characteristics of the ribbon type. See I1-I3 for details, which will not be elaborated here.
[0214] H4: Determine the computational complexity of the component to be identified based on the first, second, and third complexities.
[0215] For relevant details, please refer to section B4 above, which will not be repeated here.
[0216] Therefore, for ribbon-type components to be identified, the physical simulation process is divided into three stages: preprocessing, collision, and constraint. The complexity of each stage is calculated separately, and simplified parameters are used in the collision stage. This not only makes the determination of the computational complexity of ribbon-type components more efficient but also more precise, better reflecting the realism of ribbon-type components in the physical simulation process, achieving a dual improvement in accuracy and efficiency.
[0217] Continue as Figure 8 As shown, in ribbon-type components, at the microscopic level, there are typically only longitudinal structural constraints between particles. That is, the aforementioned lateral structural constraints, bending lateral constraints, bending longitudinal constraints, and oblique constraints are almost non-existent in ribbon-type components. Therefore, these types of constraints can be ignored when calculating the computational resources consumed in the constraint calculation stage. In one possible implementation, this application proposes a specific implementation method for determining the third complexity based on the number of longitudinal structural constraints, namely, the specific implementation method of H3, as detailed in I1-I3.
[0218] I1: Obtain the number of longitudinal constraints of the structure.
[0219] I2: Based on the number of longitudinal constraints, the total number of constraints is obtained. When only the number of longitudinal constraints is obtained, the number of longitudinal constraints can be determined as the total number of constraints without considering other types of constraints.
[0220] I3: Determine the third complexity of the component to be identified in the constraint phase based on the number of constraints.
[0221] As mentioned above, the constraint stage is used to solve for the constraints of the tensile and contractile relationships caused by the medium's structure. For ribbon-type components to be identified, only the longitudinal constraints of the structure can be solved, ignoring other types of constraints, thus saving computational resources.
[0222] As one possible implementation, the third complexity is positively correlated with the number of constraints on the component to be identified; that is, the more constraints, the higher the third complexity. Taking the direct proportionality between the third complexity and the number of constraints on the component to be identified as an example, the third complexity can be calculated using Equation 9:
[0223] (Formula 9)
[0224] in, The third complexity of the component to be identified. To constrain the quantity.
[0225] Therefore, by obtaining only the longitudinal constraints of the structure and calculating the third complexity of the ribbon-type component to be identified in the constraint stage, the characteristics of the ribbon structure itself can be fully utilized to simplify the calculation steps of the third complexity. This avoids unnecessary constraint calculation processes and improves computational efficiency. Furthermore, since the number of material iterations can be represented by constants, computational efficiency is further improved.
[0226] Scenario 3: The component to be identified is a rope. See J1-J2 for details.
[0227] J1: If the component to be identified is a rope type, then obtain the number of joints, the number of collision substeps, the total number of collideable individuals, the number of colliders, and the number of constraints.
[0228] Rope-type components differ from ribbon-type components. Rope-type components typically need to connect two ends and maintain a certain degree of curvature. Therefore, curvature constraints are required to limit the bending behavior of individual particles within the rope-type component, preserving the physical effect of the rope's curvature. Among these constraints, cross-particle constraints are common, meaning constraints may exist between non-adjacent particles. For example, there might be a longitudinal bending constraint between the first and third particles. Therefore, if the component to be identified is a rope-type component, the total number of collideable individuals cannot be directly represented by the number of joints due to cross-particle constraints.
[0229] Based on this, if the component to be identified is a rope type, the number of joints, the number of collision substeps, the total number of collideable individuals, the number of colliding objects, and the number of constraints can be obtained.
[0230] In one possible implementation, the total number of collidable individuals can be determined based on the number of joints and the number of constraints.
[0231] As an example, this step can be represented by Formula 10:
[0232] (Formula 10)
[0233] in, The total number of individuals that can collide. For the number of joints, To constrain the quantity.
[0234] Rope types require constraints of the bending type to maintain the rope's curved shape, and these bending constraints are often set across particles, making it impossible to simply infer the number of collisionable individuals from the number of joints. Determining the total number of collisionable individuals for a rope type by combining the number of joints and the number of constraints not only covers the collision scale brought about by structural connections but also incorporates additional collision objects introduced by bending constraints, making the total number of collisionable individuals more accurate.
[0235] J2: Determine the computational complexity of the component to be identified based on the number of joints, the number of collision substeps, the total number of collideable individuals, the number of colliders, and the number of constraints.
[0236] Based on the foregoing analysis, the constant value of the material iteration count can be substituted into the aforementioned steps for determining computational complexity. To simplify the calculation, the number of joints, collision substeps, total number of collidable individuals, number of colliders, and number of constraints can be directly obtained. The computational complexity of the component to be identified can then be determined based on the combination of the number of joints, collision substeps, total number of collidable individuals, number of colliders, number of constraints, and constant values.
[0237] Therefore, for rope-type components, there is no need to obtain the material iteration count or include it in the calculation to complete the computational complexity calculation process, making the calculation process simpler and requiring fewer parameters. At the same time, it can still accurately reflect the resource consumption of the ribbon in the physical simulation, thus improving computational efficiency.
[0238] In one possible implementation, the complexity calculation for the ribbon-type component to be identified can be performed in stages. Specifically, this application provides a concrete implementation of J2, as detailed in K1-K4:
[0239] K1: Determine the first complexity of the component to be identified in the preprocessing stage based on the number of joints.
[0240] For relevant details, please refer to B1 above, which will not be repeated here.
[0241] K2: Determine the second complexity of the part to be identified in the collision phase based on the number of collision substeps, the total number of collideable individuals, and the number of colliders.
[0242] Since the number of material iterations can be represented by a constant, the second complexity can be determined without the material iterations being included in the collision phase calculation.
[0243] In one possible implementation, the second complexity is positively correlated with the number of collision sub-steps, the total number of collideable individuals, and the number of colliders. In other words, the higher the number of collision sub-steps, the total number of collideable individuals, and the number of colliders, the higher the second complexity.
[0244] As one possible implementation, taking a material iteration count of 1 as an example, K2 can be expressed by Equation 11:
[0245] (Formula 11)
[0246] in, The second complexity of the component to be identified. For the number of collision sub-steps, The total number of individuals that can collide. The number of colliders.
[0247] Therefore, by constantizing the number of material iterations, the calculation process of the second complexity reduces unnecessary data acquisition and computation, thereby reducing computational overhead. The positive correlation between the number of collision sub-steps, the total number of collideable individuals, the number of collision bodies, and the second complexity can still accurately reflect the computational resource consumption of rope type in the physical simulation process, thus improving the accuracy and efficiency of the computational complexity determination process.
[0248] K3: Determine the third complexity of the component to be identified in the constraint phase based on the number of constraints.
[0249] For relevant details, please refer to B3 above, which will not be repeated here.
[0250] K4: Determine the computational complexity of the component to be identified based on the first, second, and third complexities.
[0251] For relevant details, please refer to section B4 above, which will not be repeated here.
[0252] Therefore, for rope-type components to be identified, the physical simulation process is divided into three stages: a preprocessing stage, a collision stage, and a constraint stage. The complexity of each stage is calculated separately, and simplified parameters are used in the collision stage. This not only makes the determination of the computational complexity of rope-type components more efficient but also more precise, better reflecting the realism of rope-type components in the physical simulation process, achieving a dual improvement in accuracy and efficiency.
[0253] In one possible implementation, the computational complexity can be displayed in real time during the animation production process. See L1-L2 for details, where L1 is a specific implementation of S501:
[0254] L1: If a production operation is performed on a target component that is part of at least one component included in an animation resource, then the target component is identified as the component to be identified.
[0255] The production operations can be various editing behaviors performed on components. For example, selecting a component in the view, adjusting the mesh of the component, modifying the physical parameters of the component (such as rigidity, damping, collision-related parameters, etc.), binding or modifying the skeleton of the component, adding or adjusting keyframes for the component on the timeline, or drawing the cloth weight of the component using the brush tool, etc.
[0256] In other words, as long as an operation related to creation or adjustment is performed on a component, that component can be identified as a component to be identified, so that the computational complexity can be calculated and updated for that component in the future.
[0257] L2: Displays the computational complexity of the component to be identified.
[0258] This allows the system to automatically identify the currently edited component within the animator's workflow and simultaneously display its corresponding computational complexity, saving the time cost of additional command input. While modeling, rigging, fine-tuning parameters, or drawing weights for a component, animators can intuitively understand the computational overhead of the component's physical simulation. This facilitates the timely identification and adjustment of overly complex components during the production phase, making the computational complexity feedback more aligned with the actual production workflow. This improves animation production efficiency and helps reduce the burden on computer equipment during subsequent physical simulations.
[0259] In one possible implementation, the correspondence between the physical simulation time and computational complexity of a computer device can be obtained. The physical simulation time indicates the time spent by components participating in the physical simulation.
[0260] Based on this correspondence and the computational complexity of the component to be identified, the physical simulation time of the component to be identified can be determined.
[0261] For example, extensive tests on the physical simulation time were conducted on seven test models. Based on the 294 test data points generated, the data was processed, regressed, and analyzed to obtain the time consumption of the next physical complexity for each model, as shown in Table 1.
[0262] Table 1
[0263]
[0264] The physical simulation time corresponding to a certain computational complexity represents a correlation between physical simulation time and computational complexity. Based on the physical simulation time corresponding to a certain computational complexity for each machine model, and the computational complexity of the component to be identified for each model, the physical simulation time of the component to be identified for each model can be determined. It can be seen that computational complexity and time are positively correlated. Based on this, the upper limit of computational complexity for animation resources or components can be calculated according to the time constraints imposed by the computer device.
[0265] The frame time is used to characterize the maximum time that a computer device can allocate to physical simulation per frame. During the animation resource production stage, different computer devices have different frame time capacities. Based on this, embodiments of this application propose a method for determining the upper limit of complexity, as detailed in M1-M3:
[0266] M1: Get the time and relationship coefficients for each frame.
[0267] The relationship coefficient is used to characterize the relationship between computational complexity and frame update time in computer devices. Frame update time is the total time required for a processing thread to complete all the logic of a frame (including animation calculation, physics simulation, blueprint scripts, etc.), and it is an indicator of frame update speed. The time per frame is the upper limit of the time corresponding to the physics simulation phase within the frame update time.
[0268] The processing thread is the execution thread that undertakes various computational tasks during frame updates. This application does not specifically limit the usage scenarios of the processing thread; that is, this application does not specifically limit the application scenarios. The following description uses three application scenarios as examples:
[0269] Application scenario one: game development.
[0270] In game development, processing threads include at least the main game logic thread and a dedicated physics thread, which are used to complete tasks such as animation calculations, collision simulations, and game script execution within a single frame. To ensure a smooth gaming experience, a high frame rate standard is usually maintained, resulting in a shorter duration of time available for physics simulation per frame.
[0271] Through the solutions implemented in this application, game developers can identify which components' physical simulation processes may affect the smooth operation of the game, and thus make targeted modifications to ensure the game runs smoothly.
[0272] Application scenario two: animation production.
[0273] In the creation of film and television animation, virtual production, or interactive content, processing threads typically run on workstations or offline rendering environments, responsible for performing high-precision cloth, software, or character physics simulations. These animation production scenarios demand high simulation accuracy and visual realism, and often require support for real-time interactive adjustments by directors or artists.
[0274] If the time taken for a single frame of physical simulation is too long, it will slow down the iteration efficiency of the pre-visualization and affect the creative rhythm. With the solution of this application embodiment, the production team can set a reasonable time per frame according to the hardware running environment of the processing thread, so as to evaluate whether the computational complexity of each component is suitable for the current pipeline, thereby enabling timely adjustments to components with high computational complexity and improving the overall production efficiency.
[0275] Application Scenario 3: Virtual Reality Software Development.
[0276] In virtual reality scenarios, processing threads need to simultaneously complete multiple tasks, including head detection, controller detection, environmental interaction, physical response, and animation updates, within a very short time. Any timeout in the physical simulation of any component can lead to dizziness, inaccurate operation, or even safety risks.
[0277] The solution provided in this application enables software developers to clearly define the performance boundaries of components in virtual space. This allows for targeted adjustments to components that affect the execution of other tasks by the processing thread during software development, eliminating the need for repeated testing and improving the development efficiency of virtual reality software. M2: Determine the upper limit of computational complexity for the computer device based on the time consumed per frame and the relationship coefficients.
[0278] The upper limit of computational complexity is the maximum computational complexity a computer device can perform to meet the time required for each frame. The upper limit of computational complexity can be determined by considering the time required for each frame, the relationship between computational complexity and frame update time in the computer device, and the relationship coefficients. Different frame times correspond to different upper limits of computational complexity, and different coefficients of this relationship correspond to different upper limits of computational complexity.
[0279] M3: Determine the modification prompt based on the upper limit of computational complexity and the computational complexity of the component to be identified.
[0280] By comparing the upper limit of computational complexity with the computational complexity of the component to be identified, it can be determined whether the component to be identified meets the time requirement per frame under the current circumstances, and a modification prompt can be given. The modification prompt is used to indicate whether the component to be identified needs modification. This application does not specifically limit the form of the modification prompt; three forms are described below as examples.
[0281] Form 1 provides modification suggestions based on the relationship between the upper limit of computational complexity and the computational complexity of the component to be identified.
[0282] If the upper limit of computational complexity is greater than the computational complexity of the component to be identified, a modification prompt indicating no modification is needed will be given. If the upper limit of computational complexity is less than or equal to the computational complexity of the component to be identified, a modification prompt indicating modification is needed will be given.
[0283] Form 2 lists the upper limit of computational complexity and the computational complexity of the component to be identified, and provides modification suggestions.
[0284] The system displays both the upper limit of computational complexity and the computational complexity of the component to be identified for reference. Furthermore, if the upper limit of computational complexity is greater than the computational complexity of the component to be identified, a modification suggestion is given indicating no modification is needed; if the upper limit of computational complexity is less than or equal to the computational complexity of the component to be identified, a modification suggestion is given indicating that modification is required.
[0285] The third type of modification prompt also includes suggestions for modification.
[0286] In other words, when the computational complexity of the part to be identified is greater than or equal to the upper limit of computational complexity, it can not only prompt the animator to make modifications, but also provide specific directions for modification or optimization suggestions.
[0287] For example, the main sources of performance overhead can be inferred from the higher proportion of computational complexity of the component to be identified, and corresponding modification suggestions can be generated accordingly. If the second complexity of the collision stage is high, it can be suggested to reduce the number of collision sub-steps, reduce the number of colliders, or reduce the total number of collideable individuals. If the first complexity of the preprocessing stage is high, it can be suggested to reduce the number of joints or adjust the physical binding structure. If the third complexity of the constraint stage is high, it can be suggested to reduce the number of constraints, merge constraint structures, or reduce the number of material iterations.
[0288] See Figure 9 The figure is a schematic diagram of an interface for displaying modification prompts according to an embodiment of this application. After the animator adjusts the rigidity value of the outer group, the computer device displays the upper limit of the computational complexity as 13000 and the computational complexity of the outer group as 13087, and provides modification prompts that need to be made.
[0289] Therefore, by obtaining the time consumption and relationship coefficients of each frame, it is possible to determine the maximum computational complexity that computer equipment can withstand while ensuring the time consumption of each frame. Based on the generated modification prompts, animators can obtain clear feedback during the production stage, thereby avoiding the creation of complex parts that exceed the capabilities of computer equipment. This helps to improve animation production efficiency, enhance the stability of physical simulation, reduce the consumption of computing resources, and reduce rework in the later stages.
[0290] In one possible implementation, this application proposes a specific implementation method for determining the upper limit of computational complexity, namely, a specific implementation method for M2, as detailed in N1-N3:
[0291] N1: Obtain the coefficients of the first and second sub-relationships.
[0292] The first sub-relationship coefficient characterizes the relationship between the computational complexity parameter of the computer device and the character animation resolution time parameter, while the second sub-relationship coefficient characterizes the relationship between the character animation resolution time parameter and the frame update time parameter. The computational complexity parameter characterizes computational complexity, the character animation resolution time parameter characterizes the time spent by the computer device executing animation logic within a frame, and the frame update time parameter characterizes the frame update time. For example, animation logic could include character skeletal driving, animation blending, and pose calculation. Higher computational complexity means more physical calculations are required when executing animation resources, resulting in higher character animation resolution time.
[0293] The first and second sub-relation coefficients are illustrated below using Formulas 12 and 13 as examples.
[0294] (Formula 12)
[0295] in, Calculate the time consumption parameters for character animation. To calculate the complexity parameters, The coefficient of the first sub-relation. The size of the parameter used to indicate the time taken to solve character animations when the computational complexity parameter is 0.
[0296] (Formula 13)
[0297] in, For frame update time parameters, Calculate the time consumption parameters for character animation. The coefficient of the second sub-relation. The size of the frame update time parameter is used to indicate the time taken to solve character animation when the time taken parameter is 0.
[0298] N2: Determine the parameter values for the character animation solution time parameters based on the time consumed per frame and the second sub-relationship coefficient.
[0299] Continuing with Equations 12 and 13 as examples, by substituting Equation 12 into Equation 13, we can deduce that when the computational complexity parameter is 0, the time taken to solve the character animation is... Milliseconds. At this point, the average value of the frame update time parameter in the game thread is... millisecond.
[0300] If the time taken per frame of a computer device is The frame update time parameter can then be represented by Formula 14.
[0301] (Formula 14)
[0302] in, For frame update time parameters, The coefficient of the first sub-relation. The coefficient of the second sub-relation. The size of the frame update time parameter used to indicate when the character animation calculation time parameter is 0. The time taken per frame for a computer device.
[0303] Substituting Formula 14 into Formula 13 yields Formula 15, which is the parameter value for the character animation calculation time:
[0304] (Formula 15)
[0305] in, Calculate the parameter values for the time consumption parameters of character animation. The coefficient of the second sub-relation. The time taken per frame for a computer device. The size of the parameter used to indicate the time taken to solve character animations when the computational complexity parameter is 0.
[0306] N3: Determine the upper limit of computational complexity based on the parameter values of the time consumption parameters for character animation calculation and the coefficient of the first sub-relationship.
[0307] Referring to the previous formula derivation process, substituting Formula 15 into Formula 12 yields the upper limit of computational complexity as follows:
[0308] (Formula 16)
[0309] in, To calculate the upper limit of complexity, The coefficient of the first sub-relation. The coefficient of the second sub-relation. The time taken per frame for a computer device.
[0310] Therefore, the first sub-relation coefficient can reflect the impact of computational complexity on the time consumed by character animation calculation, and the second sub-relation coefficient can reflect the impact of the time consumed by character animation calculation on frame update time. Combining the two can cover the chain effect of animation logic and physical simulation on frame update time, making the determination of the upper limit of computational complexity more refined and accurate.
[0311] To facilitate a further understanding of the technical solutions provided in the embodiments of this application, the following description takes the execution subject of the method for determining the computational complexity of animation resources provided in the embodiments of this application as a server as an example, and provides an overall exemplary introduction to the method for determining the computational complexity of animation resources.
[0312] The process of determining the computational complexity of animation resources can be integrated into a plugin. See also Figure 10 The figure is a schematic diagram of a plugin interface proposed in an embodiment of this application. A method for determining the computational complexity of animation resources can be implemented by selecting a target plugin from all plugins.
[0313] As an implementation method, the core functionality of the Target plugin can provide physical simulation of multi-layered cloth, ribbons, and ropes. During game development, animators can use the Target plugin to create physically simulated assets, such as supporting physical simulation of various materials like clothing, hair, and soft surfaces. Figure 11 As shown. In Unreal Engine, physical simulation can be achieved through multiple animation nodes derived from the Skeletal Control Base (FAnimNode). Animators can bind bones of a skeleton mesh to the animation nodes in the animation blueprint, and these bound bones can then perform physical simulation. Therefore, the method for determining the computational complexity of animation resources proposed in this application can be applied to various software for creating animation resources via a plug-in approach, achieving plug-and-play convenience and speed.
[0314] See Figure 12 This figure is a schematic diagram of a viewport panel proposed in an embodiment of this application. When an animator is creating animation assets, the viewport panel in the editor can provide real-time feedback on the computational complexity of each component within the current animation node, as well as the computational complexity of the entire animation resource (which can be determined by the sum of the computational complexities of each component). Each time the animator performs a production operation on a component of the animation resource, the corresponding computational complexity is updated in real time. Simultaneously, when the animator previews animation resources at other Levels of Detail (LOD), the viewport panel will display the computational complexity corresponding to the currently previewed LOD. For example... Figure 12 As shown, the computational complexity of the outer skirt is 13087, and the computational complexity of the corresponding character is 18000.
[0315] It should be noted that when switching between different LODs, the computer device can update the parameters of the animation resources under the current LOD, and recalculate the computational complexity of the part to be identified based on the updated parameters, thereby realizing real-time updates of the computational complexity of different LODs.
[0316] As one possible implementation, the computer device can not only calculate the computational complexity of the component to be identified, but also perform batch calculations on each component in the animation resource based on the method for determining the computational complexity of the animation resource proposed in the embodiments of this application.
[0317] As one implementation method, the function of displaying computational complexity can be enabled or disabled.
[0318] In response to the method for determining the computational complexity of animation resources described above, this application also provides a corresponding apparatus for determining the computational complexity of animation resources, so that the above method for determining the computational complexity of animation resources can be applied and implemented in practice.
[0319] See Figure 13 This figure is a schematic diagram of a device for determining the computational complexity of animation resources according to an embodiment of this application. Figure 13 As shown, the device 1300 for determining the computational complexity of the animation resource includes a determining unit 1301 and an acquiring unit 1302;
[0320] The determining unit 1301 is used to determine the component to be identified, wherein the component to be identified is one of at least one component included in the animation resource;
[0321] The acquisition unit 1302 is used to acquire the number of joints, material iterations, collision substeps, total number of collideable individuals, number of colliders, and number of constraints of the component to be identified.
[0322] The determining unit 1301 is used to determine the computational complexity of the component to be identified based on the number of joints, the number of material iterations, the number of collision substeps, the total number of collideable individuals, the number of colliders, and the number of constraints.
[0323] As one possible implementation, the determining unit 1301 is specifically used for:
[0324] Based on the number of joints, determine the first complexity of the component to be identified in the preprocessing stage;
[0325] The second complexity of the component to be identified in the collision phase is determined based on the number of material iterations, the number of collision substeps, the total number of collideable individuals, and the number of colliders.
[0326] Based on the number of constraints, the third complexity of the component to be identified in the constraint phase is determined;
[0327] The computational complexity of the component to be identified is determined based on the first complexity, the second complexity, and the third complexity.
[0328] As one possible implementation, the device 1300 further includes a fabric collision individual determination unit, used for:
[0329] Obtain the structural lateral constraint coefficient, the number of particles for the structural lateral constraint, the structural longitudinal constraint coefficient, the number of particles for the structural longitudinal constraint, the diagonal constraint coefficient, and the number of particles for the diagonal constraint.
[0330] The total number of collideable individuals is determined based on the number of joints, the lateral constraint coefficient of the structure, the number of particles under lateral constraint, the longitudinal constraint coefficient of the structure, the number of particles under longitudinal constraint, the oblique constraint coefficient, and the number of particles under oblique constraint.
[0331] As one possible implementation, the determining unit 1301 is specifically used for:
[0332] Obtain the number of transverse constraints, longitudinal constraints, lateral bending constraints, longitudinal bending constraints, and diagonal constraints of the structure;
[0333] The number of constraints is obtained by summing the number of transverse constraints, the number of longitudinal constraints, the number of transverse bending constraints, the number of longitudinal bending constraints, and the number of oblique constraints.
[0334] The third complexity of the component to be identified in the constraint phase is determined based on the number of material iterations and the number of constraints.
[0335] As one possible implementation, the device 1300 further includes a type identification unit for:
[0336] Determine the type of the component to be identified;
[0337] If the component to be identified is a multi-layered fabric type, then the steps of obtaining the number of joints, material iterations, collision substeps, total number of collideable individuals, number of colliders, and number of constraints of the component to be identified, as well as subsequent steps, are executed.
[0338] As one possible implementation, the device 1300 further includes a ribbon complexity determination unit, used for:
[0339] If the component to be identified is a ribbon, then obtain the number of joints, the number of collision substeps, the number of collision bodies, and the number of constraints;
[0340] The computational complexity of the component to be identified is determined based on the number of joints, the number of collision substeps, the number of collision bodies, and the number of constraints.
[0341] As one possible implementation, the ribbon complexity determination unit is specifically used for:
[0342] Based on the number of joints, determine the first complexity of the component to be identified in the preprocessing stage;
[0343] The second complexity of the component to be identified in the collision phase is determined based on the number of joints, the number of collision sub-steps, and the number of collision bodies.
[0344] Based on the number of constraints, the third complexity of the component to be identified in the constraint phase is determined;
[0345] The computational complexity of the component to be identified is determined based on the first complexity, the second complexity, and the third complexity.
[0346] As one possible implementation, the second complexity is positively correlated with the number of joints, the second complexity is positively correlated with the number of collision substeps, and the second complexity is positively correlated with the number of colliders.
[0347] As one possible implementation, the ribbon complexity determination unit is specifically used for:
[0348] Obtain the number of longitudinal constraints in the structure;
[0349] The number of constraints is obtained based on the number of longitudinal constraints of the structure;
[0350] Based on the number of constraints, the third complexity of the component to be identified in the constraint phase is determined.
[0351] As one possible implementation, the device 1300 further includes a rope complexity determination unit, used for:
[0352] If the component to be identified is a rope type, then obtain the number of joints, the number of collision sub-steps, the total number of collideable individuals, the number of colliders, and the number of constraints;
[0353] The computational complexity of the component to be identified is determined based on the number of joints, the number of collision substeps, the total number of collideable individuals, the number of colliders, and the number of constraints.
[0354] As one possible implementation, the rope complexity determination unit is specifically used for:
[0355] Based on the number of joints, determine the first complexity of the component to be identified in the preprocessing stage;
[0356] The second complexity of the component to be identified in the collision phase is determined based on the number of collision sub-steps, the total number of collideable individuals, and the number of colliders.
[0357] Based on the number of constraints, the third complexity of the component to be identified in the constraint phase is determined;
[0358] The computational complexity of the component to be identified is determined based on the first complexity, the second complexity, and the third complexity.
[0359] As one possible implementation, the device 1300 further includes a unit for determining the total number of individuals that can collide with the rope:
[0360] The total number of collisionable individuals is determined based on the number of joints and the number of constraints.
[0361] As one possible implementation, the second complexity is positively correlated with the number of collision sub-steps, the second complexity is positively correlated with the total number of collidable individuals, and the second complexity is positively correlated with the number of colliders.
[0362] As one possible implementation, the determining unit 1302 is specifically used for:
[0363] If a production operation is performed on a target component among at least one component included in the animation resource, then the target component is identified as the component to be identified.
[0364] The method further includes:
[0365] This displays the computational complexity of the component to be identified.
[0366] As one possible implementation, the device 1300 further includes a complexity upper bound unit, used for:
[0367] Obtain the frame time and relationship coefficient, wherein the frame time is used to characterize the maximum time that the computer device can allocate to the physical simulation per frame, and the relationship coefficient is used to characterize the relationship between the computational complexity and the frame update time in the computer device;
[0368] The upper limit of the computational complexity of the computer device is determined based on the time consumed per frame and the relationship coefficient.
[0369] Based on the upper limit of computational complexity and the computational complexity of the component to be identified, a modification prompt is determined, which is used to indicate whether the component to be identified needs to be modified.
[0370] As one possible implementation, the upper limit unit of complexity is specifically used for:
[0371] Obtain a first sub-relation coefficient and a second sub-relation coefficient. The first sub-relation coefficient is used to characterize the relationship between the computational complexity parameter of the computer device and the character animation calculation time parameter. The second sub-relation coefficient is used to characterize the relationship between the character animation calculation time parameter and the frame update time parameter.
[0372] Based on the time consumed per frame and the second sub-relationship coefficient, the parameter value of the character animation calculation time parameter is determined;
[0373] The upper limit of computational complexity is determined based on the parameter values of the character animation calculation time parameters and the first sub-relationship coefficient.
[0374] This application also provides a computer device, which can be a server or a terminal device. The computer device provided in this application will be described below from a hardware implementation perspective. Figure 14 The diagram shown is a schematic of the server's structure. Figure 15 The diagram shown is a structural schematic of the terminal device.
[0375] See Figure 14 This figure is a schematic diagram of a server structure provided in an embodiment of this application. The server 1400 can vary considerably due to different configurations or performance. It may include one or more processors 1422, such as a central processing unit (CPU), memory 1432, and one or more storage media 1430 (e.g., one or more mass storage devices) for application programs 1442 or data 1444. The memory 1432 and storage media 1430 can be temporary or persistent storage. The program stored in the storage media 1430 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the server. Furthermore, the processor 1422 may be configured to communicate with the storage media 1430 and execute the series of instruction operations in the storage media 1430 on the server 1400.
[0376] Server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input / output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.
[0377] The steps performed by the server in the above embodiments can be based on this Figure 14 The server structure shown.
[0378] The processor 1422 is used to perform the following steps:
[0379] Identify the component to be identified, wherein the component to be identified is one of at least one components included in the animation resource;
[0380] Obtain the number of joints, material iterations, collision substeps, total number of collideable individuals, number of colliders, and number of constraints of the component to be identified;
[0381] The computational complexity of the component to be identified is determined based on the number of joints, the number of material iterations, the number of collision substeps, the total number of collideable individuals, the number of colliders, and the number of constraints.
[0382] Optionally, the processor 1422 may also execute method steps of any specific implementation of the method for determining the computational complexity of animation resources in the embodiments of this application.
[0383] See Figure 15 This figure is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. The description will be based on a smartphone as an example. Figure 15 The diagram shown is a block diagram of a portion of the structure of the smartphone, which includes: a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a Wi-Fi module 1570, a processor 1580, and a power supply 1590, among other components. Those skilled in the art will understand that... Figure 15 The smartphone structure shown does not constitute a limitation on smartphones and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0384] The following is combined Figure 15 A detailed introduction to the various components of a smartphone:
[0385] The RF circuit 1510 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 1580; in addition, it transmits uplink data to the base station.
[0386] The memory 1520 can be used to store software programs and modules, and the processor 1580 runs the software programs and modules stored in the memory 1520 to realize various functions and data processing of the smartphone.
[0387] The input unit 1530 can be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the smartphone. Specifically, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also known as a touch screen, can collect touch operations from the user on or near it and drive corresponding connected devices according to a pre-set program. In addition to the touch panel 1531, the input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, a joystick, etc.
[0388] The display unit 1540 can be used to display information input by the user or information provided to the user, as well as various menus of a smartphone. The display unit 1540 may include a display panel 1541, which may optionally be configured as a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0389] Smartphones may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. Other sensors that smartphones may also be equipped with, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be detailed here.
[0390] Audio circuit 1560, speaker 1561, and microphone 1562 provide an audio interface between the user and the smartphone. Audio circuit 1560 converts received audio data into electrical signals and transmits them to speaker 1561, where speaker 1561 converts them into sound signals for output. On the other hand, microphone 1562 converts collected sound signals into electrical signals, which are received by audio circuit 1560, converted into audio data, and then processed by processor 1580 before being transmitted via RF circuit 1510 to, for example, another smartphone, or the audio data can be output to memory 1520 for further processing.
[0391] The processor 1580 is the control center of the smartphone, connecting various parts of the smartphone through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 1520, and by calling data stored in the memory 1520. Optionally, the processor 1580 may include one or more processing units.
[0392] The smartphone also includes a power supply 1590 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.
[0393] Although not shown, smartphones may also include a camera, Bluetooth module, etc., which will not be described in detail here.
[0394] In this embodiment of the application, the memory 1520 included in the smartphone can store computer programs and transmit the computer programs to the processor.
[0395] The processor 1580 included in the smartphone can execute the method for determining the computational complexity of the animation resources provided in the above embodiments according to the instructions in the computer program.
[0396] This application also provides a computer-readable storage medium for storing a computer program that executes the method for determining the computational complexity of animation resources provided in the above embodiments.
[0397] On the other hand, embodiments of this application provide a computer program product including a computer program, which, when run on a computer device, causes the computer device to perform the computational complexity of animation resources provided in various optional implementations of the above aspects.
[0398] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk or optical disk, and other media that can store computer programs.
[0399] The terms “first,” “second,” “third,” “fourth,” etc., as used in this application (if applicable), are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0400] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0401] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects detailed in this application.
[0402] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used herein are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items. Depending on the context, the word “if,” as used herein, can be interpreted as “when,” “in response to a determination,” or “when…”.
[0403] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0404] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods.
Claims
1. A method for determining the computational complexity of animation resources, characterized in that, The method includes: Identify the component to be identified, wherein the component to be identified is one of at least one components included in the animation resource; Obtain the number of joints, material iterations, collision substeps, total number of collideable individuals, number of colliders, and number of constraints of the component to be identified; Based on the number of joints, determine the first complexity of the component to be identified in the preprocessing stage; The second complexity of the component to be identified in the collision phase is determined based on the number of material iterations, the number of collision substeps, the total number of collideable individuals, and the number of colliders. Based on the number of constraints, the third complexity of the component to be identified in the constraint phase is determined; The computational complexity of the component to be identified is determined based on the first complexity, the second complexity, and the third complexity.
2. The method according to claim 1, characterized in that, The method further includes: Obtain the structural lateral constraint coefficient, the number of particles for the structural lateral constraint, the structural longitudinal constraint coefficient, the number of particles for the structural longitudinal constraint, the diagonal constraint coefficient, and the number of particles for the diagonal constraint. The total number of collideable individuals is determined based on the number of joints, the lateral constraint coefficient of the structure, the number of particles under lateral constraint, the longitudinal constraint coefficient of the structure, the number of particles under longitudinal constraint, the oblique constraint coefficient, and the number of particles under oblique constraint.
3. The method according to claim 1, characterized in that, The step of determining the third complexity of the component to be identified in the constraint phase based on the number of constraints includes: Obtain the number of transverse constraints, longitudinal constraints, lateral bending constraints, longitudinal bending constraints, and diagonal constraints of the structure; The number of constraints is obtained by summing the number of transverse constraints, the number of longitudinal constraints, the number of transverse bending constraints, the number of longitudinal bending constraints, and the number of oblique constraints. The third complexity of the component to be identified in the constraint phase is determined based on the number of material iterations and the number of constraints.
4. The method according to claim 1, characterized in that, The method further includes: Determine the type of the component to be identified; If the component to be identified is a multi-layered fabric type, then the steps of obtaining the number of joints, material iterations, collision substeps, total number of collideable individuals, number of colliders, and number of constraints of the component to be identified, as well as subsequent steps, are executed.
5. The method according to claim 4, characterized in that, The method further includes: If the component to be identified is a ribbon, then obtain the number of joints, the number of collision substeps, the number of collision bodies, and the number of constraints; The computational complexity of the component to be identified is determined based on the number of joints, the number of collision substeps, the number of collision bodies, and the number of constraints.
6. The method according to claim 5, characterized in that, The step of determining the computational complexity of the component to be identified based on the number of joints, the number of collision sub-steps, the number of colliders, and the number of constraints includes: Based on the number of joints, determine the first complexity of the component to be identified in the preprocessing stage; The second complexity of the component to be identified in the collision phase is determined based on the number of joints, the number of collision sub-steps, and the number of collision bodies. Based on the number of constraints, the third complexity of the component to be identified in the constraint phase is determined; The computational complexity of the component to be identified is determined based on the first complexity, the second complexity, and the third complexity.
7. The method according to claim 6, characterized in that, The second complexity is positively correlated with the number of joints, the second complexity is positively correlated with the number of collision sub-steps, and the second complexity is positively correlated with the number of colliders.
8. The method according to claim 6, characterized in that, The step of determining the third complexity of the component to be identified in the constraint phase based on the number of constraints includes: Obtain the number of longitudinal constraints in the structure; The number of constraints is obtained based on the number of longitudinal constraints of the structure; Based on the number of constraints, the third complexity of the component to be identified in the constraint phase is determined.
9. The method according to claim 4, characterized in that, The method further includes: If the component to be identified is a rope type, then obtain the number of joints, the number of collision sub-steps, the total number of collideable individuals, the number of colliders, and the number of constraints; The computational complexity of the component to be identified is determined based on the number of joints, the number of collision substeps, the total number of collideable individuals, the number of colliders, and the number of constraints.
10. The method according to claim 9, characterized in that, The determination of the computational complexity of the component to be identified based on the number of joints, the number of collision sub-steps, the total number of collideable individuals, the number of colliders, and the number of constraints includes: Based on the number of joints, determine the first complexity of the component to be identified in the preprocessing stage; The second complexity of the component to be identified in the collision phase is determined based on the number of collision sub-steps, the total number of collideable individuals, and the number of colliders. Based on the number of constraints, the third complexity of the component to be identified in the constraint phase is determined; The computational complexity of the component to be identified is determined based on the first complexity, the second complexity, and the third complexity.
11. The method according to claim 10, characterized in that, The method further includes: The total number of collisionable individuals is determined based on the number of joints and the number of constraints.
12. The method according to claim 10, characterized in that, The second complexity is positively correlated with the number of collision sub-steps, the second complexity is positively correlated with the total number of collidable individuals, and the second complexity is positively correlated with the number of colliders.
13. The method according to claim 1, characterized in that, The process of determining the component to be identified includes: If a production operation is performed on a target component among at least one component included in the animation resource, then the target component is identified as the component to be identified. The method further includes: This displays the computational complexity of the component to be identified.
14. The method according to any one of claims 1-13, characterized in that, The method further includes: Obtain the frame time and relationship coefficient, wherein the frame time is used to characterize the maximum time that the computer device can allocate to the physical simulation per frame, and the relationship coefficient is used to characterize the relationship between the computational complexity and the frame update time in the computer device; The upper limit of the computational complexity of the computer device is determined based on the time consumed per frame and the relationship coefficient. Based on the upper limit of computational complexity and the computational complexity of the component to be identified, a modification prompt is determined, which is used to indicate whether the component to be identified needs to be modified.
15. The method according to claim 14, characterized in that, Determining the upper limit of computational complexity of the computer device based on the time consumed per frame and the relationship coefficient includes: Obtain a first sub-relation coefficient and a second sub-relation coefficient. The first sub-relation coefficient is used to characterize the relationship between the computational complexity parameter of the computer device and the character animation calculation time parameter. The second sub-relation coefficient is used to characterize the relationship between the character animation calculation time parameter and the frame update time parameter. Based on the time consumed per frame and the second sub-relationship coefficient, the parameter value of the character animation calculation time parameter is determined; The upper limit of computational complexity is determined based on the parameter values of the character animation calculation time parameters and the first sub-relationship coefficient.
16. A device for determining the computational complexity of an animation resource, characterized in that, The device includes a determining unit and an acquiring unit; The determining unit is used to determine the component to be identified, wherein the component to be identified is one of at least one component included in the animation resource; The acquisition unit is used to acquire the number of joints, material iterations, collision substeps, total number of collideable individuals, number of colliders, and number of constraints of the component to be identified. The determining unit is used to determine the computational complexity of the component to be identified based on the number of joints, the number of material iterations, the number of collision substeps, the total number of collideable individuals, the number of colliders, and the number of constraints. The determining unit is specifically used for: Based on the number of joints, determine the first complexity of the component to be identified in the preprocessing stage; The second complexity of the component to be identified in the collision phase is determined based on the number of material iterations, the number of collision substeps, the total number of collideable individuals, and the number of colliders. Based on the number of constraints, the third complexity of the component to be identified in the constraint phase is determined; The computational complexity of the component to be identified is determined based on the first complexity, the second complexity, and the third complexity.
17. The apparatus according to claim 16, characterized in that, The device also includes a fabric collision individual determination unit, used for: Obtain the structural lateral constraint coefficient, the number of particles for the structural lateral constraint, the structural longitudinal constraint coefficient, the number of particles for the structural longitudinal constraint, the diagonal constraint coefficient, and the number of particles for the diagonal constraint. The total number of collideable individuals is determined based on the number of joints, the lateral constraint coefficient of the structure, the number of particles under lateral constraint, the longitudinal constraint coefficient of the structure, the number of particles under longitudinal constraint, the oblique constraint coefficient, and the number of particles under oblique constraint.
18. The apparatus according to claim 16, characterized in that, The determining unit is specifically used for: Obtain the number of transverse constraints, longitudinal constraints, lateral bending constraints, longitudinal bending constraints, and diagonal constraints of the structure; The number of constraints is obtained by summing the number of transverse constraints, the number of longitudinal constraints, the number of transverse bending constraints, the number of longitudinal bending constraints, and the number of oblique constraints. The third complexity of the component to be identified in the constraint phase is determined based on the number of material iterations and the number of constraints.
19. The apparatus according to claim 16, characterized in that, The device further includes a type identification unit for: Determine the type of the component to be identified; If the component to be identified is a multi-layered fabric type, then the steps of obtaining the number of joints, material iterations, collision substeps, total number of collideable individuals, number of colliders, and number of constraints of the component to be identified, as well as subsequent steps, are executed.
20. The apparatus according to claim 19, characterized in that, The device further includes a ribbon complexity determination unit, used for: If the component to be identified is a ribbon, then obtain the number of joints, the number of collision substeps, the number of collision bodies, and the number of constraints; The computational complexity of the component to be identified is determined based on the number of joints, the number of collision substeps, the number of collision bodies, and the number of constraints.
21. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store computer programs and to transfer the computer programs to the processor; The processor is configured to perform the method according to any one of claims 1-15 according to the computer program.
22. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method according to any one of claims 1-15.
23. A computer program product comprising a computer program, characterized in that, When it is run on a computer device, it causes the computer device to perform the method described in any one of claims 1-15.