Model processing method and device, equipment, medium and program product
By calculating the movement difference information between high-precision model and low-precision model, the grid point weights and positions of the low-precision model are automatically updated, which solves the problem of high-precision model calculation pressure, reduces development cycle and workload, and improves game performance and fluency.
Patent Information
- Application Number
- CN202411790968.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-21
AI Technical Summary
In the prior art, high-precision models lead to high computational pressure when dealing with character models in PC games, especially in vision or character back scenes, manual remodeling increases the development cycle and workload.
By obtaining the movement difference information between the high-precision model and the low-precision model, the grid point weights and positions of the low-precision model are automatically updated so that it is close to the performance of the high-precision model when performing the same behavior.
Reduces the workload of manual remodeling, shortens development cycles, reduces computing pressure, and improves game performance and fluency.
Smart Images

Figure CN119672227A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a model processing method, device, equipment, medium and program product. Background Art
[0002] With the advancement of computer hardware and software technology, the accuracy of character models in modern PC games has been greatly improved, especially facial modeling, which can present extremely delicate changes in expression, enhancing the realism and immersion of the game. High-precision models mean huge amounts of data and complex computing requirements, which puts great pressure on the game engine. When dealing with distant views or character backs, high-precision models become an unnecessary burden.
[0003] In related technologies, manual remodeling is often used to create low-precision models. In scenarios where computing pressure needs to be reduced, the original high-precision model is replaced with a low-precision model. However, remodeling often increases the manual workload in the already tight development cycle and slows down the overall development progress.
[0004] Therefore, there is an urgent need for a model processing method that can reduce manual workload. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a model processing method. One or more embodiments of the present invention also relate to a model processing device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0006] According to a first aspect of an embodiment of the present invention, a model processing method is provided, comprising: Acquire first movement information of a reference model, wherein the reference model is a model in which each first grid point is bound to a first number of bones, and the first movement information is used to characterize movement information of the reference model executing a target behavior; Acquire second movement information of the initial model, wherein the initial model is a model in which each second grid point is bound to a second number of bones, the second number of bones is less than the first number of bones, the initial model and the reference model correspond to the same virtual object, and the second movement information is used to characterize movement information of the initial model executing the target behavior; Motion difference information is calculated based on the first movement information and the second movement information, and the initial model is updated based on the movement difference information, and the reference model is replaced by the updated initial model.
[0007] According to a second aspect of an embodiment of the present invention, there is provided a model processing device, comprising: A first acquisition module is configured to acquire first movement information of a reference model, wherein the reference model is a model in which each first grid point is bound to a first number of bones, and the first movement information is used to represent movement information of the reference model executing a target behavior; A second acquisition module is configured to acquire second movement information of an initial model, wherein the initial model is a model in which each second grid point is bound to a second number of bones, the second number of bones is less than the first number of bones, the initial model and the reference model correspond to the same virtual object, and the second movement information is used to characterize movement information of the initial model executing the target behavior; The calculation and updating module is configured to calculate movement difference information based on the first movement information and the second movement information, update the initial model based on the movement difference information, and replace the reference model with the updated initial model.
[0008] According to a third aspect of an embodiment of the present invention, there is provided a computing device, including: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above-mentioned model processing method are implemented.
[0009] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned model processing method when executed by a processor.
[0010] According to a fifth aspect of an embodiment of the present invention, there is provided a computer program product, comprising a computer program / instruction, which implements the steps of the above-mentioned model processing method when executed by a processor.
[0011] One embodiment of the present invention implements obtaining first movement information of a reference model, wherein the reference model is a model in which each first grid point is bound to a first number of bones, and the first movement information is used to characterize movement information of the reference model executing a target behavior; obtaining second movement information of an initial model, wherein the initial model is a model in which each second grid point is bound to a second number of bones, the second number of bones is less than the first number of bones, the initial model and the reference model correspond to the same virtual object, and the second movement information is used to characterize movement information of the initial model executing the target behavior; calculating movement difference information based on the first movement information and the second movement information, and updating the initial model based on the movement difference information, and replacing the reference model with the updated initial model. By automatically calculating the movement difference information between the high-precision model and the low-precision model, the low-precision model is updated, thereby reducing the workload of manual remodeling. Specifically, the movement information of the high-precision model is first obtained, and then the movement information of the low-precision model is obtained, and the movement difference between the two is calculated. Based on this difference information, the grid point weights and positions of the low-precision model are adjusted so that it can be closer to the performance of the high-precision model when performing the same behavior. This not only reduces the workload of developers and shortens the development cycle, but also reduces the computing pressure while maintaining the quality of model performance, especially when dealing with distant views or character backs, effectively improving the performance and smoothness of the game. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 is a structural interaction diagram of a model processing system provided by an embodiment of the present invention; Figure 2 is a flow chart of a model processing method provided by one embodiment of the present invention; Figure 3 is a processing flow chart of a model processing method provided by an embodiment of the present invention; Figure 4 is a structural schematic diagram of a model processing device provided by an embodiment of the present invention; Figure 5 It is a structural block diagram of a computing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0013] Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited to the specific implementation disclosed below.
[0014] The terms used in one or more embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present invention. The singular forms of "a", "said" and "the" used in one or more embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present invention refers to and includes any or all possible combinations of one or more associated listed items.
[0015] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present invention, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present invention, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0016] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0017] First, the terms involved in one or more embodiments of the present invention are explained.
[0018] Mesh: Also known as mesh, it is a basic structure that represents the surface of a 3D model. It consists of a series of grid points (Vertices), edges (Edges) and faces (Faces), which are used to define the geometric shape of an object.
[0019] With the rapid development of computer software and hardware technology, the accuracy of character models in modern PC games has been continuously improved, especially facial modeling, which can present extremely delicate expression changes and high-precision face-pinching forms. These high-precision models not only enhance the realism and immersion of the game, but also provide players with richer and more diverse character customization options. However, high-precision models also bring huge amounts of data and complex computing requirements, which puts great pressure on the game engine. When processing scenes such as distant views and character backs, high-precision models become an unnecessary burden, which not only wastes computing resources, but may also cause game performance to degrade and affect the player experience.
[0020] In related technologies, in order to save computing resources in scenes such as distant views or character backs, low-precision models are usually created by manual remodeling. These low-precision models replace high-precision models in scenes where computing pressure needs to be reduced to reduce the burden of rendering and calculation. However, manual remodeling is not only time-consuming and labor-intensive, but also increases the development cycle and slows down the overall development progress. In addition, manual modeling makes it difficult to ensure that the low-precision model is highly consistent with the high-precision model in terms of details and animation performance, which can easily lead to incoherent visual effects. Therefore, there is an urgent need for a method that can automatically and efficiently generate low-precision models to reduce manual workload, improve development efficiency, and maintain the performance quality of the model in different scenarios.
[0021] In view of the above problems, a model processing method is provided in the present invention. The present invention also relates to a model processing system, a model processing device, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0022] See also Figure 1 , Figure 1 It is a structural interaction diagram of a model processing system provided by an embodiment of the present invention. The model processing system includes a data recording end, a computing end and a rendering update end. The data recording end is used to record first movement information representing the execution of a target behavior by a reference model, and to record second movement information representing the execution of a target behavior by an initial model. The reference model is a model in which each first grid point is bound to a first number of bones, and the initial model is a model in which each second grid point is bound to a second number of bones, and the second number of bones is less than the first number of bones; the computing end is used to obtain the first movement information and the second movement information from the data recording end, and to calculate movement difference information based on the first movement information and the second movement information; the rendering update end is used to update the initial model based on the movement difference information, and to replace the reference model with the updated initial model.
[0023] Applied to the model processing system, the first movement information representing the reference model executing the target behavior and the second movement information representing the initial model executing the target behavior are recorded through the data recording end, wherein the reference model is a model in which each first grid point is bound to a first number of bones, and the initial model is a model in which each second grid point is bound to a second number of bones, and the second number of bones is less than the first number of bones; the computing end obtains the first movement information and the second movement information from the data recording end, and calculates movement difference information based on the first movement information and the second movement information; the rendering update end updates the initial model based on the movement difference information, and replaces the reference model with the updated initial model, and automatically calculates the high The low-precision model is updated based on the movement difference information between the high-precision model and the low-precision model, thereby reducing the workload of manual remodeling. Specifically, the movement information of the high-precision model is first obtained, and then the movement information of the low-precision model is obtained, and the movement difference between the two is calculated. Based on the difference information, the grid point weights and positions of the low-precision model are adjusted so that it can be closer to the performance of the high-precision model when performing the same behavior. This not only reduces the workload of developers and shortens the development cycle, but also reduces the computing pressure while maintaining the quality of model performance, especially when dealing with distant views or character backs, effectively improving the performance and smoothness of the game.
[0024] See also Figure 2 , Figure 2 It is a flow chart of a model processing method provided by an embodiment of the present invention, which specifically includes the following steps.
[0025] Step 202: Obtain first movement information of a reference model, wherein the reference model is a model in which each first grid point is bound to a first number of bones, and the first movement information is used to characterize movement information of the reference model executing a target behavior.
[0026] The reference model refers to a high-precision 3D model, where each grid point is bound to multiple bones. The first movement information refers to the motion trajectory and position change information of each grid point and bone when the reference model performs the target behavior. The first grid point is the grid point of each mesh in the reference model. The grid points include the vertices of the 3D model and any other points that can be bound to bones. These points are bound to multiple bones in the reference model and follow the motion trajectory and position change of the bones when performing the target behavior.
[0027] In practical applications, the system first needs to obtain a high-precision reference model. The reference model usually contains a large number of grid points, each of which is bound to a certain number of bones. These bones will move when the model performs the target behavior (such as walking, running, jumping, etc.), causing the position of the grid points to change. In order to obtain the first movement information, the system needs to record each key frame of the reference model when performing the target behavior. Specifically, the system records the position of each grid point in each frame and the motion trajectory of each bone in each frame. This information is usually stored in a data structure, such as a list containing multiple frames, each of which contains detailed data on the position of the grid points and the position of the bones.
[0028] For example, suppose the reference model is a high-precision human character model that contains 1,000 grid points, each of which is bound to 16 bones. When the character performs walking behavior, the system records the position of each grid point and the motion trajectory of each bone in each frame. These data can be stored in a multidimensional array, where the first dimension of the array represents the frame number, the second dimension represents the index of the grid point or bone, and the third dimension represents the coordinates of the position (x, y, z).
[0029] When recording the positions of the mesh points, the system captures the exact coordinates of each mesh point in each frame. For example, the position of mesh point 1 in frame 1 might be (1.0, 2.0, 3.0), and the position in frame 2 might be (1.1, 2.1, 3.1). Similarly, the system records the position and rotation information of each bone in each frame. For example, the position of bone 1 in frame 1 might be (0.0, 0.0, 0.0), and the rotation might be (0.0, 0.0, 0.0), and the position in frame 2 might be (0.1, 0.1, 0.1), and the rotation might be (0.1, 0.1, 0.1).
[0030] To ensure the accuracy and completeness of the data, the system can use professional animation software or tools to generate and record this movement information. These tools usually provide detailed animation editing functions, which can accurately control the movement trajectory of each bone and mesh point. The recorded movement information will be used as a reference in subsequent steps to calculate the movement difference information of the low-precision model and optimize the mesh point weights and positions of the low-precision model.
[0031] In a specific embodiment of the present invention, it is assumed that there is a high-precision human character model, which contains 1000 grid points, and each grid point is bound to 16 bones. The system needs to record the movement information of the model when performing walking behavior. First, the system uses animation software to design a walking animation for the character, and the animation contains 30 frames. In each frame, the system records the position of each grid point and the motion trajectory of each bone. For example, in the first frame, the position of grid point 1 is (1.0, 2.0, 3.0), the position of bone 1 is (0.0, 0.0, 0.0), and the rotation is (0.0, 0.0, 0.0). In the second frame, the position of grid point 1 is (1.1, 2.1, 3.1), the position of bone 1 is (0.1, 0.1, 0.1), and the rotation is (0.1, 0.1, 0.1). The system stores these data in a multidimensional array for subsequent processing.
[0032] Further, obtaining the first movement information of the reference model includes: initializing the reference model in the virtual environment to obtain the initial first coordinates of each first grid point; determining a target behavior instruction in the pre-configured behavior instructions, running the target behavior instruction to make the reference model perform the target behavior, and recording the trajectory information of the first coordinate during the execution as the first movement information, wherein the target behavior instruction is any pre-configured behavior instruction. The initial first coordinate is the position coordinate of the first grid point of the reference model in the virtual environment after the position is initialized.
[0033] In practical applications, the system first needs to initialize the reference model in the virtual environment. The reference model contains a large number of grid points, each of which is bound to a certain number of bones. During the initialization process, the system records the initial coordinates of each grid point, which represent the position of the grid point when the model is at rest. For example, suppose the reference model is a high-precision human character model containing 1,000 grid points, each of which is bound to 16 bones. The system records the initial coordinates of each grid point, for example, the initial coordinates of grid point 1 can be (1.0, 2.0, 3.0).
[0034] Next, the system selects a target behavior instruction from the pre-configured behavior instructions. These behavior instructions can include walking, running, jumping, etc. The system runs the selected target behavior instruction to make the reference model perform the corresponding action. During the execution process, the system records the position changes of each grid point in each frame, and these position changes constitute the first movement information. Specifically, the system records the coordinates of each grid point in each frame. For example, the position of grid point 1 in the 1st frame can be (1.0, 2.0, 3.0), and the position in the 2nd frame can be (1.1, 2.1, 3.1). The system continues to record the position of each grid point in each frame until the target behavior is completed.
[0035] To ensure the accuracy and completeness of the data, the system can use professional animation software or tools to generate and record this movement information. These tools usually provide detailed animation editing functions, which can accurately control the movement trajectory of each bone and mesh point. The recorded movement information will be used as a reference in subsequent steps to calculate the movement difference information of the low-precision model and optimize the vertex weights and positions of the low-precision model.
[0036] In a specific embodiment of the present invention, it is assumed that there is a high-precision human character model containing 1,000 vertices, and each vertex is bound to 16 bones. The system first initializes the model in a virtual environment and records the initial coordinates of each vertex. Then, the system selects a target behavior instruction from pre-configured behavior instructions, such as "walk". The system runs the "walk" behavior instruction to make the reference model perform a walking action. During the execution process, the system records the position change of each vertex in each frame. For example, in the first frame, the position of vertex 1 is (1.0, 2.0, 3.0); in the second frame, the position of vertex 1 is (1.1, 2.1, 3.1). The system stores these data in a multidimensional array for subsequent processing.
[0037] Based on this, the system initializes the reference model in a virtual environment and records its detailed movement information when performing the target behavior, providing accurate reference data for subsequent low-precision model optimization.
[0038] Step 204: Obtain second movement information of the initial model, wherein the initial model is a model in which each second vertex is bound to a second number of bones, the second number of bones is less than the first number of bones, the initial model and the reference model correspond to the same virtual object, and the second movement information is used to characterize the movement information of the initial model executing the target behavior.
[0039] Among them, the initial model refers to a 3D model with lower precision, and each grid point is bound to a smaller number of bones. The second movement information refers to the motion trajectory and position change information of each grid point and bone when the initial model performs the target behavior. The second grid point is the grid point of each mesh in the initial model.
[0040] In practical applications, the system first needs to obtain a low-precision initial model. The initial model usually contains fewer grid points, and each grid point is bound to a smaller number of bones. These bones will move when the model performs the target behavior (such as walking, running, jumping, etc.), causing the position of the grid points to change. In order to obtain the second movement information, the system needs to record each key frame of the initial model when performing the target behavior. Specifically, the system records the position of each grid point in each frame and the motion trajectory of each bone in each frame. This information is usually stored in a data structure, such as a list containing multiple frames, each of which contains detailed data on the grid point position and the bone position.
[0041] For example, suppose the initial model is a low-precision human character model containing 1,000 grid points, each bound to 4 bones. When the character performs walking behavior, the system records the position of each grid point and the motion trajectory of each bone in each frame. These data can be stored in a multidimensional array, where the first dimension of the array represents the frame number, the second dimension represents the index of the grid point or bone, and the third dimension represents the coordinates of the position (x, y, z).
[0042] When recording the positions of the mesh points, the system captures the exact coordinates of each mesh point in each frame. For example, the position of mesh point 1 in frame 1 might be (1.0, 2.0, 3.0), and the position in frame 2 might be (1.1, 2.1, 3.1). Similarly, the system records the position and rotation information of each bone in each frame. For example, the position of bone 1 in frame 1 might be (0.0, 0.0, 0.0), and the rotation might be (0.0, 0.0, 0.0), and the position in frame 2 might be (0.1, 0.1, 0.1), and the rotation might be (0.1, 0.1, 0.1).
[0043] To ensure the accuracy and completeness of the data, the system can use professional animation software or tools to generate and record this movement information. These tools usually provide detailed animation editing functions, which can accurately control the movement trajectory of each bone and mesh point. The recorded movement information will be used as a reference in subsequent steps to calculate the movement difference information of the low-precision model and optimize the mesh point weights and positions of the low-precision model.
[0044] In a specific embodiment of the present invention, it is assumed that there is a low-precision human character model, which contains 1000 grid points, and each grid point is bound to 4 bones. The system needs to record the movement information of the model when performing walking behavior. First, the system uses animation software to design a walking animation for the character, and the animation contains 30 frames. In each frame, the system records the position of each grid point and the motion trajectory of each bone. For example, in the first frame, the position of grid point 1 is (1.0, 2.0, 3.0), the position of bone 1 is (0.0, 0.0, 0.0), and the rotation is (0.0, 0.0, 0.0). In the second frame, the position of grid point 1 is (1.1, 2.1, 3.1), the position of bone 1 is (0.1, 0.1, 0.1), and the rotation is (0.1, 0.1, 0.1). The system stores these data in a multidimensional array for subsequent processing.
[0045] Furthermore, obtaining the second movement information of the initial model includes: initializing the initial model in the virtual environment to obtain the initial second coordinates of each second grid point; running the target behavior instruction to make the initial model perform the target behavior, and recording the trajectory information of the second coordinate during the execution as the second movement information.
[0046] The initial model and the reference model are used to represent the same virtual object, and the number of grid points of the initial model and the reference model is the same and corresponds one to one. The initial second coordinates are the position coordinates of each second grid point of the initial model in the virtual environment after the position is initialized.
[0047] In practical applications, the system first needs to initialize the initial model in the virtual environment. The initial model contains the same number of grid points as the reference model, and each grid point is bound to a smaller number of bones. During the initialization process, the system records the initial coordinates of each grid point, which represent the position of the grid point when the model is at rest. For example, suppose the initial model is a low-precision human character model containing 1000 grid points, each of which is bound to 4 bones. The system records the initial coordinates of each grid point, for example, the initial coordinates of grid point 1 can be (1.0, 2.0, 3.0).
[0048] Next, the system runs the same target behavior instructions as the reference model. These behavior instructions can include walking, running, jumping, etc. The system runs the selected target behavior instructions to make the initial model perform the corresponding actions. During the execution process, the system records the position changes of each grid point in each frame, and these position changes constitute the second movement information. Specifically, the system records the coordinates of each grid point in each frame. For example, the position of grid point 1 in the 1st frame can be (1.0, 2.0, 3.0), and the position in the 2nd frame can be (1.1, 2.1, 3.1). The system continues to record the position of each grid point in each frame until the target behavior is completed.
[0049] To ensure the accuracy and completeness of the data, the system can use professional animation software or tools to generate and record this movement information. These tools usually provide detailed animation editing functions, which can accurately control the movement trajectory of each bone and mesh point. The recorded movement information will be used as a reference in subsequent steps to calculate the movement difference information of the low-precision model and optimize the mesh point weights and positions of the low-precision model.
[0050] In a specific embodiment of the present invention, it is assumed that there is a high-precision human character model (reference model) and a low-precision human character model (initial model), both of which contain 1000 grid points, but each grid point of the reference model is bound to 16 bones, while each grid point of the initial model is bound to 4 bones. The system first initializes the initial model in the virtual environment and records the initial coordinates of each grid point. Then, the system runs the same target behavior instruction as the reference model, such as "walk". The system runs the "walk" behavior instruction to make the initial model perform a walking action. During the execution process, the system records the position change of each grid point in each frame. For example, in the first frame, the position of grid point 1 is (1.0, 2.0, 3.0); in the second frame, the position of grid point 1 is (1.1, 2.1, 3.1). The system stores these data in a multidimensional array for subsequent processing.
[0051] Based on this, the system initializes the initial model in a virtual environment and records its detailed movement information when performing the same target behavior as the reference model, providing accurate reference data for subsequent low-precision model optimization.
[0052] Step 206: Calculate movement difference information based on the first movement information and the second movement information, update the initial model based on the movement difference information, and replace the reference model with the updated initial model.
[0053] Among them, the movement difference information refers to the differences in the positions of each grid point and the bone movement when the high-precision model (reference model) and the low-precision model (initial model) perform the same target behavior.
[0054] In actual applications, the system first obtains the first movement information of the high-precision model (reference model), which includes the position of each grid point in each frame and the motion trajectory of each bone. Similarly, the system obtains the second movement information of the low-precision model (initial model), which includes the position of each grid point in each frame and the motion trajectory of each bone. Next, the system compares the first movement information with the second movement information and calculates the movement difference information between the two. Specifically, for each grid point i in each frame t, the system calculates its position v in the high-precision model it and the position w in the low-precision model ij S j t +u i The difference between ij is the weight of binding mesh point i to bone j, S j t is the position of bone j at frame t, u i is the initial position of the grid point i. This difference information can be expressed as a vector or scalar value that quantifies the deviation between the two models.
[0055] Based on the calculated movement difference information, the system updates the low-precision model. Specifically, the system adjusts the weight w of each grid point in the low-precision model ij and position u i , so that when the low-precision model performs the same behavior, its grid point position can be as close as possible to the actual reference position v of the high-precision model i t The method of adjusting the weights and positions can use an optimization algorithm, such as the gradient descent method, to gradually optimize the grid point positions and weights of the low-precision model by minimizing the error function. During the optimization process, the system can also add additional constraints, such as ensuring that the sum of the weights of each grid point is 1 and the weights are non-negative.
[0056] For example, suppose the high-precision model has 1,000 grid points, each bound to 16 bones, and the low-precision model has 1,000 grid points, each bound to 4 bones. The system first records the position of each grid point in each frame and the motion trajectory of each bone when the high-precision model performs walking behavior. Then, the system records the corresponding information of the low-precision model under the same behavior. Next, the system calculates the position difference of each grid point in each frame and generates movement difference information. Based on this difference information, the system uses the gradient descent method to adjust the weight and position of each grid point in the low-precision model, so that when the low-precision model performs walking behavior, its grid point position can be as close as possible to the real reference position of the high-precision model. After multiple iterations of optimization, the grid point position and weight of the low-precision model gradually converge, and finally achieve a highly consistent effect with the high-precision model.
[0057] In a specific embodiment of the present invention, it is assumed that there is a high-precision human character model, including 1000 grid points, each of which is bound to 16 bones, and a low-precision human character model, including 1000 grid points, each of which is bound to 4 bones. The system first records the motion trajectory of each grid point and bone of the high-precision model when performing walking behavior. Then, the system records the corresponding information of the low-precision model under the same behavior. Next, the system calculates the position difference of each grid point in each frame to generate movement difference information. Based on this difference information, the system uses the gradient descent method to adjust the weight and position of each grid point in the low-precision model, so that when the low-precision model performs walking behavior, its grid point position can be as close as possible to the real reference position of the high-precision model. After multiple iterations of optimization, the grid point position and weight of the low-precision model gradually converge, and finally achieve a highly consistent effect with the high-precision model. The system replaces the original high-precision model with the optimized low-precision model for use in scenes such as distant views or the back of the character, thereby reducing the consumption of computing resources.
[0058] Furthermore, the movement difference information is calculated based on the first movement information and the second movement information, including: constructing a movement difference equation based on the first movement information and the second movement information; initializing an initial model in a virtual environment, obtaining an initial second coordinate of each second grid point, and constructing a movement constraint equation based on the initial second coordinate and the second movement information; in response to selecting a configuration operation, determining a rigid grid point in each second grid point, and constructing a rigid constraint equation based on the rigid coordinates initialized by the rigid grid point and the second movement information; calculating the movement difference information based on the movement difference equation, the movement constraint equation and the rigid constraint equation.
[0059] Among them, the movement difference equation is used to calculate the difference in the movement trajectory of each grid point when the reference model and the initial model perform the same behavior, thereby quantifying the movement deviation between the two. The movement constraint equation is used to ensure that the grid points of the initial model maintain a certain distance relationship during the movement process to prevent the model from unnatural stretching or compression when deforming. The rigid constraint equation is used to ensure that the rigid components specified in the initial model maintain rigid body characteristics during the movement, that is, the relative distance between each rigid grid point remains unchanged to maintain the structural stability of the model. Rigid grid points refer to grid points designated as rigid components in the model, which maintain a relatively fixed distance and position relationship during movement to ensure that certain parts of the model maintain rigid characteristics when deforming.
[0060] In actual applications, the system first constructs a motion difference equation based on the first motion information of the reference model and the second motion information of the initial model. Specifically, the system compares the position change of each grid point in each frame and calculates the difference between the high-precision model and the low-precision model. The system records the position of each grid point in the high-precision model in each frame, and the position of the corresponding grid point in the low-precision model in each frame, and calculates the motion difference of each grid point by comparing these two positions.
[0061] Next, the system obtains the initial coordinates of each grid point in the initial model and constructs a motion constraint equation based on these initial coordinates and the second motion information. The motion constraint equation is used to ensure that the weight and position of each grid point meet certain conditions during the optimization process, such as the weight sum is 1 and non-negative. This step ensures that the low-precision model will not undergo unreasonable changes during the optimization process.
[0062] In addition, in response to the configuration operation, the system determines rigid mesh points among the mesh points of the initial model. Rigid mesh points refer to mesh points that maintain rigid deformation (such as translation and rotation, without distortion) in certain specific situations, such as eyes or teeth. The system constructs rigid constraint equations based on the initial coordinates and second movement information of these rigid mesh points. The rigid constraint equations are used to ensure that these mesh points maintain their shapes unchanged when performing the target behavior without distortion or deformation.
[0063] Finally, the system calculates the movement difference information based on the movement difference equation, the movement constraint equation, and the rigid constraint equation. Specifically, the system uses an optimization algorithm (such as gradient descent) to minimize the error in the movement difference equation while satisfying the movement constraint equation and the rigid constraint equation. During the optimization process, the system adjusts the weight and position of each grid point in the low-precision model so that when the low-precision model performs the same behavior, its grid point position can be as close as possible to the actual reference position of the high-precision model.
[0064] In a specific embodiment of the present invention, it is assumed that there is a high-precision human character model (reference model) and a low-precision human character model (initial model), both of which contain 1000 grid points, but each grid point of the reference model is bound to 16 bones, while each grid point of the initial model is bound to 4 bones. The system first records the position change of each grid point of the reference model when performing walking behavior, and constructs the first movement information. Then, the system records the position change of each grid point of the initial model when performing the same walking behavior, and constructs the second movement information. Then, the system calculates the position difference of each grid point in each frame based on these movement information, and constructs the movement difference equation. The system obtains the initial coordinates of each grid point in the initial model, and constructs the movement constraint equation to ensure that the weight sum of each grid point is 1 and non-negative. The system also determines the rigid grid points (such as eyes and teeth) in the initial model in response to the selection configuration operation, and constructs the rigid constraint equation based on the initial coordinates of these grid points and the second movement information. Finally, the system uses the gradient descent method to optimize the weight and position of each grid point in the low-precision model, so that when the low-precision model performs walking behavior, the position of its grid point can be as close as possible to the real reference position of the high-precision model.
[0065] Based on this, the system can accurately calculate the movement difference information between the high-precision model and the low-precision model by constructing the movement difference equation, the movement constraint equation and the rigid constraint equation.
[0066] Furthermore, there is a corresponding relationship between each first grid point and each second grid point; a movement difference equation is constructed based on the first movement information and the second movement information, including: based on the first movement information, determining the movement first coordinates of each first grid point in each movement frame; based on the second movement information, determining the movement second coordinates of each second grid point in each movement frame; for the target second coordinate of the target second grid point in the target movement frame, determining the corresponding target first coordinate in the first coordinate based on the corresponding relationship, wherein the target second grid point is any second grid point, and the target movement frame is any movement frame; a movement difference equation is constructed based on the target first coordinate, the target second coordinate and the preset movement difference parameter.
[0067] The target second coordinate is the moved second coordinate of the second grid point, and the target first coordinate is the moved first coordinate of the first grid point.
[0068] In practical applications, the system first determines the first coordinate of each first grid point in the reference model in each moving frame based on the first moving information of the reference model. Specifically, the system records the position of each grid point in each frame when the reference model performs the target behavior. For example, assuming that the reference model has 1000 grid points, the position of each grid point in each frame will be recorded to form the first moving information. Next, the system determines the second coordinate of each second grid point in the initial model in each moving frame based on the second moving information of the initial model. Specifically, the system records the position of each grid point in each frame when the initial model performs the same target behavior. For example, assuming that the initial model also has 1000 grid points, the position of each grid point in each frame will also be recorded to form the second moving information. Then, the system determines the corresponding target first coordinate in the first coordinate for any target second grid point in the initial model in any target moving frame based on the corresponding relationship between the grid points. For example, assuming that the target second grid point is grid point 1 in the initial model and the target moving frame is the 10th frame, the system will find the target first coordinate of grid point 1 in the 10th frame of the reference model. This correspondence ensures that the positions of the grid points of the reference model and the initial model in each frame can be directly compared. Finally, the system constructs a motion difference equation based on the target first coordinate, the target second coordinate, and the preset motion difference parameters. The motion difference equation is used to describe the difference between the position of the target second grid point in the target motion frame and the position of the corresponding target first grid point in the same frame.
[0069] In a specific embodiment of the present invention, it is assumed that there is a high-precision human character model (reference model) and a low-precision human character model (initial model), both of which contain 1000 grid points, but each grid point of the reference model is bound to 16 bones, while each grid point of the initial model is bound to 4 bones. The system first records the position of each grid point of the reference model in each frame when performing walking behavior, and constructs the first movement information. Then, the system records the position of each grid point of the initial model in each frame when performing the same walking behavior, and constructs the second movement information. Next, the system determines the position difference of each grid point in each frame based on the corresponding relationship between the grid points of the reference model and the initial model. For example, assuming that the position of grid point 1 in the initial model in the 10th frame is (1.1, 2.1, 3.1), and the position of grid point 1 in the reference model in the 10th frame is (1.0, 2.0, 3.0), the system can calculate the position difference of grid point 1 in the 10th frame. The system uses this difference information in subsequent optimization steps by adjusting the weight and position of each grid point in the initial model so that the grid point position of the initial model can be as close as possible to the actual reference position of the reference model when performing the same behavior.
[0070] Based on this, the system can accurately calculate the movement difference information between the high-precision model and the low-precision model by constructing the movement difference equation, which provides an optimization basis for the subsequent optimization of the initial model.
[0071] Furthermore, the initial model is initialized in the virtual environment to obtain the initial second coordinates of each second grid point, and a movement constraint equation is constructed based on the initial second coordinates and the second movement information, including: initializing the initial model in the virtual environment to obtain the initial second coordinates of each second grid point; for the target second grid point, calculating the initial distance information between the target second grid point and the adjacent grid points based on the initial second coordinates; and constructing a movement constraint equation based on the initial distance information, the second movement information and preset movement constraint parameters.
[0072] The movement constraint equation is used to ensure that each grid point meets certain conditions during the optimization process, such as keeping the distance between adjacent grid points unchanged.
[0073] In actual applications, the system first obtains the initial second coordinates of each second grid point in the initial model. Specifically, the system records the position of each grid point when the initial model is in a stationary state, and these position information constitute the initial second coordinates. For example, assuming that the initial model has 1000 grid points, the system will record the coordinates of each grid point in a stationary state, for example, the initial coordinates of grid point 1 can be (1.0, 2.0, 3.0).
[0074] Next, the system calculates the initial distance information between the target second grid point and the adjacent grid points based on the initial second coordinates. Specifically, the system calculates the initial distance between each grid point and its adjacent grid points. For example, assuming that the adjacent grid points of grid point 1 are grid point 2 and grid point 3, the system calculates the initial distance between grid point 1 and grid point 2 and the initial distance between grid point 1 and grid point 3.
[0075] Then, the system constructs a mobile constraint equation based on the initial distance information, the second movement information and the preset mobile constraint parameters. The mobile constraint equation is used to ensure that the distance between each grid point and its adjacent grid points remains relatively stable during the optimization process. In order to increase the robustness of the weights, the system also needs to add smooth constraints, such as penalizing the change in the distance between the two grid points after movement and the static distance through Laplacian regularization. Specifically, the system can ensure smooth changes in the relative positions between grid points through smooth constraints to avoid skin breakage problems caused by noise sensitivity.
[0076] For example, assuming that the position of mesh point 1 in frame 10 is (1.1, 2.1, 3.1), the position of mesh point 2 in frame 10 is (1.2, 2.2, 3.2), and the position of mesh point 3 in frame 10 is (1.3, 2.3, 3.3), the system will calculate the current distance between mesh point 1 and mesh point 2 and the current distance between mesh point 1 and mesh point 3. Then, the system will construct movement constraint equations to ensure that these distances remain close to the initial distances during the optimization process. At the same time, the system will add smooth constraints to ensure that the relative position changes between mesh points are smooth to avoid skin breakage problems caused by noise sensitivity.
[0077] In a specific embodiment of the present invention, it is assumed that there is a low-precision human character model (initial model) containing 1000 grid points, each of which is bound to 4 bones. The system first records the position of each grid point of the initial model when it is in a stationary state and constructs the initial second coordinates. For example, the initial coordinates of grid point 1 may be (1.0, 2.0, 3.0). Next, the system calculates the initial distance between grid point 1 and its adjacent grid points (such as grid point 2 and grid point 3). Then, the system records the position of each grid point in each frame when the initial model performs walking behavior and constructs the second movement information. For example, assuming that the position of grid point 1 in the 10th frame is (1.1, 2.1, 3.1), the position of grid point 2 in the 10th frame is (1.2, 2.2, 3.2), and the position of grid point 3 in the 10th frame is (1.3, 2.3, 3.3), the system will calculate the current distance between grid point 1 and grid point 2 and the current distance between grid point 1 and grid point 3. The system constructs the motion constraint equation based on these distance information and preset motion constraint parameters, and adds smooth constraints to ensure that the relative position changes between grid points are smooth, avoiding skin breakage problems caused by noise sensitivity.
[0078] Based on this, the system can ensure that the distance between adjacent grid points of the low-precision model is stable during the optimization process by constructing movement constraint equations and adding smooth constraints, avoiding the problem of skin breakage caused by noise sensitivity. This process not only improves the robustness of the model, but also ensures that when the low-precision model performs the same behavior, the position of its grid points can be as close as possible to the real reference position of the high-precision model, thereby improving the consistency of model performance and the naturalness of animation.
[0079] Furthermore, the initial model includes multiple components; in response to selecting a configuration operation, a rigid grid point is determined among each second grid point, and a rigid constraint equation is constructed based on the rigid coordinates initialized from the rigid grid point and the second movement information, including: in response to selecting a configuration operation, a rigid component identifier is determined; based on the rigid component identifier, a rigid component is determined among multiple components, and the second grid point of the rigid component is determined as a rigid grid point; initial rigid coordinates initialized from each rigid grid point are obtained; based on the initial rigid coordinates, rigid distance information between each target rigid grid point is calculated; and a rigid constraint equation is constructed based on the rigid distance information, the second movement information and preset rigid constraint parameters.
[0080] Among them, rigid grid points refer to grid points that maintain rigid deformation (such as translation and rotation, without distortion) in certain specific situations. Rigid constraint equations are used to ensure that these grid points maintain their shape unchanged when performing target behaviors.
[0081] In actual applications, the system first responds to the selection configuration operation and determines the rigid component identification. Specifically, the user can specify which components need to maintain rigid deformation through the selection configuration operation. For example, the user can select the eyes, teeth, etc. of the character as rigid components.
[0082] Next, the system determines the rigid component among the multiple components based on the rigid component identifier, and determines the second grid point of the rigid component as a rigid grid point. Specifically, the system finds the corresponding rigid component from the multiple components of the initial model based on the rigid component identifier selected by the user, and marks all grid points in these components as rigid grid points. For example, assuming that the user selects the eye as a rigid component, the system will mark all grid points in the eye as rigid grid points.
[0083] Then, the system obtains the initial rigid coordinates of each rigid grid point. Specifically, the system records the position of the rigid grid point when the initial model is static, and these position information constitute the initial rigid coordinates. For example, assume that the initial coordinates of rigid grid point 1 can be (1.0, 2.0, 3.0).
[0084] Next, the system calculates the rigid distance information between each target rigid grid point based on the initial rigid coordinates. Specifically, the system calculates the initial distance between each rigid grid point and its adjacent rigid grid point. For example, assuming that the adjacent rigid grid points of rigid grid point 1 are rigid grid point 2 and rigid grid point 3, the system calculates the initial distance between rigid grid point 1 and rigid grid point 2 and the initial distance between rigid grid point 1 and rigid grid point 3.
[0085] Finally, the system constructs a rigid constraint equation based on the rigid distance information, the second movement information and the preset rigid constraint parameters. The rigid constraint equation is used to ensure that the relative positions between the rigid grid points remain unchanged during the optimization process to prevent the rigid parts from being twisted or deformed. Specifically, the system calculates the position changes of the rigid grid points in each frame and ensures that these changes meet the rigid constraint conditions. For example, assuming that the position of rigid grid point 1 in the 10th frame is (1.1, 2.1, 3.1), the position of rigid grid point 2 in the 10th frame is (1.2, 2.2, 3.2), and the position of rigid grid point 3 in the 10th frame is (1.3, 2.3, 3.3), the system calculates the current distance between rigid grid point 1 and rigid grid point 2 and the current distance between rigid grid point 1 and rigid grid point 3, and ensures that these distances remain close to the initial distances during the optimization process.
[0086] In a specific embodiment of the present invention, it is assumed that there is a low-precision human character model (initial model), which contains 1000 grid points, each grid point is bound to 4 bones, and the model is divided into multiple parts, such as head, body, arms, etc. The user selects eyes and teeth as rigid parts by selecting a configuration operation. The system determines the grid points of the eyes and teeth as rigid grid points based on the user's selection. The system records the positions of these rigid grid points when the initial model is stationary. For example, the initial coordinates of rigid grid point 1 can be (1.0, 2.0, 3.0). Next, the system calculates the initial distance between rigid grid point 1 and its adjacent rigid grid points. Then, the system records the position of each rigid grid point in each frame when the initial model performs walking behavior. For example, assuming that the position of rigid grid point 1 in the 10th frame is (1.1, 2.1, 3.1), the position of rigid grid point 2 in the 10th frame is (1.2, 2.2, 3.2), and the position of rigid grid point 3 in the 10th frame is (1.3, 2.3, 3.3), the system will calculate the current distance between rigid grid point 1 and rigid grid point 2 and the current distance between rigid grid point 1 and rigid grid point 3. The system constructs rigid constraint equations based on these distance information and preset rigid constraint parameters to ensure that the relative positions between rigid grid points remain unchanged during the optimization process to avoid distortion or deformation of rigid components.
[0087] Based on this, the system constructs rigid constraint equations to ensure that the rigid parts in the low-precision model maintain their shape when performing the target behavior, avoiding the problem of distortion or deformation of the rigid parts. This process not only improves the robustness of the model, but also ensures that the rigid parts of the low-precision model perform more naturally and realistically when performing the same behavior. Furthermore, the mobile difference information is calculated based on the mobile difference equation, the mobile constraint equation and the rigid constraint equation, including: receiving the mobile constraint coefficient and the rigid constraint coefficient sent by the front end; based on the mobile constraint coefficient and the rigid constraint coefficient, performing weighted calculation on the mobile difference equation, the mobile constraint equation and the rigid constraint equation to obtain the mobile difference information.
[0088] In actual applications, the system first receives the mobile constraint coefficient and rigid constraint coefficient sent by the front end. These coefficients are used to adjust the importance of the mobile constraint equation and the rigid constraint equation when calculating the movement difference information. For example, the front end can provide a mobile constraint coefficient α and a rigid constraint coefficient β to balance the influence of different constraints.
[0089] Next, the system performs weighted calculations on the mobile difference equation, mobile constraint equation, and rigid constraint equation based on the mobile constraint coefficient and the rigid constraint coefficient to obtain the mobile difference information. Specifically, the system multiplies the mobile difference equation, mobile constraint equation, and rigid constraint equation by the corresponding coefficients, and then performs comprehensive calculations to obtain the final mobile difference information. This process ensures that different types of constraints can be flexibly adjusted according to actual needs during the optimization process.
[0090] For example, assuming that the movement difference equation is Ed, the movement constraint equation is Es, the rigid constraint equation is Er, the movement constraint coefficient is α, and the rigid constraint coefficient is β, the system can perform the following weighted calculation: E=Ed+αEs+βEr.
[0091] Based on this, the system can flexibly adjust the importance of different constraints by weighted calculation of the mobile difference equation, mobile constraint equation and rigid constraint equation, ensuring that different types of constraints can be balanced according to actual needs during the optimization process. This process not only improves the robustness and performance consistency of the model, but also ensures that when the low-precision model performs the same behavior, its grid point position can be as close as possible to the actual reference position of the high-precision model, thereby improving the naturalness and realism of the model performance.
[0092] Furthermore, the initial model is updated based on the movement difference information, and the reference model is replaced by the updated initial model, including: for the target second grid point, determining the bone binding weight of the target second grid point in each movement frame based on the movement difference information; updating the initial model based on the bone binding weight; and replacing the reference model with the updated initial model in the target virtual scene when a preset switching condition is triggered.
[0093] The preset switching condition refers to the condition that triggers the model replacement under specific circumstances, such as the switching between the long-view and short-view.
[0094] In actual applications, the system first updates the initial model based on the movement difference information. Specifically, the system determines the bone binding weights of the target second grid point in each movement frame based on the movement difference information for the target second grid point in the initial model. The system analyzes the movement difference information to determine which bones should affect each grid point in each frame and the degree of their influence. For example, assuming that the target second grid point is grid point 1 in the initial model, the system will calculate the influence weights of each bone on grid point 1 in each frame based on the movement difference information.
[0095] Next, the system updates the initial model based on the determined bone binding weights. Specifically, the system adjusts the bone binding weights of each grid point in the initial model so that the grid point positions of the initial model are as close as possible to the actual reference positions of the high-precision model when performing the same behavior. For example, the system adjusts the position of grid point 1 in each frame based on the calculated bone binding weights to make it closer to the position of the corresponding grid point in the reference model. The system makes similar adjustments to all grid points to ensure that the grid point positions of the initial model are as close as possible to the actual reference positions of the high-precision model when performing the same behavior.
[0096] Finally, when the preset switching condition is triggered, the system replaces the reference model with the updated initial model in the target virtual scene. The preset switching condition can be a long-distance to short-distance switching situation. For example, when the character switches from a short-distance to a long-distance, the system detects that the switching condition is triggered, that is, the character is far away from the camera. At this time, the system replaces the high-precision reference model with an optimized low-precision initial model to reduce the consumption of computing resources and improve performance.
[0097] In a specific embodiment of the present invention, it is assumed that there is a low-precision human character model (initial model) containing 1,000 grid points, each of which is bound to 4 bones. The system first determines the bone binding weights of each grid point in the initial model in each moving frame based on the movement difference information. For example, suppose that the weight of grid point 1 affected by bone 1 in the 10th frame is 0.4, the weight of bone 2 is 0.3, the weight of bone 3 is 0.2, and the weight of bone 4 is 0.1. Based on these weights, the system adjusts the position of grid point 1 in the 10th frame to make it closer to the position of the corresponding grid point in the reference model. The system makes similar adjustments to all grid points to ensure that the grid point positions of the initial model are as close as possible to the actual reference positions of the high-precision model when performing the same behavior.
[0098] Next, the system replaces the reference model with the updated initial model when the preset switching condition is triggered. For example, when the character switches from a close view to a distant view, the system detects that the switching condition is triggered, that is, the character is far away from the camera. At this time, the system replaces the high-precision reference model with an optimized low-precision initial model to reduce the consumption of computing resources and improve performance. In the distant view, using the optimized low-precision model can significantly reduce the computing load and improve the smoothness of the game.
[0099] Based on this, the system updates the initial model based on the movement difference information and replaces the reference model with the updated initial model when a preset switching condition is triggered.
[0100] One embodiment of the present invention implements obtaining first movement information of a reference model, wherein the reference model is a model in which each first grid point is bound to a first number of bones, and the first movement information is used to characterize movement information of the reference model executing a target behavior; obtaining second movement information of an initial model, wherein the initial model is a model in which each second grid point is bound to a second number of bones, the second number of bones is less than the first number of bones, the initial model and the reference model correspond to the same virtual object, and the second movement information is used to characterize movement information of the initial model executing the target behavior; calculating movement difference information based on the first movement information and the second movement information, and updating the initial model based on the movement difference information, and replacing the reference model with the updated initial model. By automatically calculating the movement difference information between the high-precision model and the low-precision model, the low-precision model is updated, thereby reducing the workload of manual remodeling. Specifically, the movement information of the high-precision model is first obtained, and then the movement information of the low-precision model is obtained, and the movement difference between the two is calculated. Based on this difference information, the grid point weights and positions of the low-precision model are adjusted so that it can be closer to the performance of the high-precision model when performing the same behavior. This not only reduces the workload of developers and shortens the development cycle, but also reduces the computing pressure while maintaining the quality of model performance, especially when dealing with distant views or character backs, effectively improving the performance and smoothness of the game.
[0101] The following combination Figure 3 , taking the simplified application of the model processing method provided by the present invention in a 3D facial model as an example, the model processing method is further described. Figure 3 It is a processing flow chart of a model processing method provided by an embodiment of the present invention, which specifically includes the following steps.
[0102] Step 302: Read high-precision model data.
[0103] Specifically, given a specific high-link model H (i.e., the reference model), read the coordinates of each mesh point (i.e., the first coordinates of the first mesh point), the coordinates and weights of all bones. Set the possible motion trajectory of the model (the first movement information) in advance, including extreme test actions (i.e., the pre-configured behavior instructions).
[0104] Step 304: Initialize the low-precision model.
[0105] Specifically, for the low link model L (ie, the aforementioned initial model), the coordinates and motion trajectory transfer equations of all bones (ie, the aforementioned second movement information) are read, and the weights of the bones to all mesh points are initialized.
[0106] Step 306: construct an approximation function.
[0107] Specifically, let all mesh points of the low-precision model approach the high-precision model in each frame and establish the equation. Specifically: for each mesh point i, its position in each frame t is determined by the position S of the bone j to which it is bound j t and its initial position u i At the same time, according to the animation data of the high-link model we already have, for each mesh point, its position v in each frame is known i t As the reference position. At this point, an approximation can be constructed to make the mesh points of the low-precision model move as close to the coordinates of the reference position as possible for each frame, that is,
[0108] Where B is the number of bones in the model, w ij is the binding weight of bone j to point i, S j t u i is the position of bone j in frame t, and all bones determine the position of mesh point i in frame t. Therefore, for the entire model, the objective function can be constructed
[0109] , , ,
[0110] Where N is the number of meshes in the model, T is the total number of motion frames of the model, Ensure that for each point, the sum of the weights of all bones is 1, It limits each point i to have at most 4 non-negative weights.
[0111] Step 308: Construct a smooth constraint function.
[0112] Concrete, E D It is noise-sensitive, especially after adding sparse constraints, which may cause the skin to break during movement. Therefore, it is necessary to add smooth constraints to increase the robustness of the weights. Specifically, for example, the following constraint formula can be used to penalize the change in the distance between two mesh points after movement and the static distance to ensure the smoothness of the mesh surface.
[0113]
[0114]
[0115] in,
[0116] N(i) represents the neighboring points adjacent to point i. S Using L as the coefficient, constrain the distance change between each point and the surrounding points during the movement; d ik It is related to the difference between the distance between two adjacent points i and k in the tth frame and their distance in the 0th frame, so as to ensure that two originally close points will not be too far apart during the entire movement process, resulting in an unsmooth model.
[0117] Step 310: Construct a rigid constraint function.
[0118] Specifically, the functions of step 306 and step 308 will result in a tendency for all points to move in a consistent manner with the surroundings. However, for some parts of the face, they will not deform with certain movements of the surroundings, but will maintain their shape and only undergo rigid deformation (translation and rotation, without distortion). For example, the eyeball will not deform as the eyelids open, but will maintain its own shape. Therefore, an objective function that can maintain local position details is also required. For example, the following energy function:
[0119] in,
[0120] w ik It is composed of the cotangent of the opposite angle of the mesh polygon. It maintains the area and relative angle of the mesh polygon, thereby keeping the local shape of the model rigid and not stretched.
[0121] Step 312: weighting and aggregating the approximation function, the smooth constraint function, and the rigid constraint function into an objective function.
[0122] Specifically, the deformation objective function, the smoothness objective function and the elastic energy objective function are combined to form the overall objective function. SGD can be used for iterative optimization to obtain reasonable bone weights for the low-link model.
[0123]
[0124] Among them, λ1 and λ2 are coefficient parameters input by developers, and the optimal λ1 and λ2 can be obtained based on tests.
[0125] The model simplification problem is abstracted into a dynamic optimization problem of the model weights. According to the model's usage scenario, a spatiotemporal optimization goal is constructed to make the low-precision model as close to the high-precision model as possible at each point and at each moment. At the same time, in order to make the low-precision model maintain as much range of motion and accuracy as possible, maintain the shape and smoothness of the model, increase the smoothing loss, and make the low-binding model prioritize reasonable deformation rather than the local optimum of each mesh point. Finally, for the special local structure of the model, the optimization goal of maintaining rigid deformation is used so that the inherent structures such as eyeballs and teeth of the character's facial model will not deform when making expressions.
[0126] Corresponding to the above method embodiment, the present invention also provides a model processing device embodiment, Figure 4 FIG. 1 is a schematic diagram of a model processing device provided by an embodiment of the present invention. Figure 4 As shown, the device comprises: A first acquisition module 402 is configured to acquire first movement information of a reference model, wherein the reference model is a model in which each first grid point is bound to a first number of bones, and the first movement information is used to represent movement information of the reference model executing a target behavior; The second acquisition module 404 is configured to acquire second movement information of the initial model, wherein the initial model is a model in which each second grid point is bound to a second number of bones, the second number of bones is less than the first number of bones, the initial model and the reference model correspond to the same virtual object, and the second movement information is used to characterize movement information of the initial model executing the target behavior; The calculation and updating module 406 is configured to calculate movement difference information based on the first movement information and the second movement information, and update the initial model based on the movement difference information, and replace the reference model with the updated initial model.
[0127] Optionally, the first acquisition module 402 is further configured to initialize the reference model in the virtual environment to obtain the initial first coordinates of each first grid point; determine the target behavior instruction in the pre-configured behavior instructions, run the target behavior instruction to make the reference model perform the target behavior, and record the trajectory information of the first coordinate during the execution process as the first movement information, wherein the target behavior instruction is any pre-configured behavior instruction.
[0128] Optionally, the second acquisition module 404 is further configured to initialize the initial model in the virtual environment to obtain the initial second coordinates of each second grid point; run the target behavior instruction to make the initial model perform the target behavior, and record the trajectory information of the second coordinates during the execution as the second movement information.
[0129] Optionally, the calculation update module 406 is further configured to construct a movement difference equation based on the first movement information and the second movement information; initialize the initial model in the virtual environment, obtain the initial second coordinates of each second grid point, and construct a movement constraint equation based on the initial second coordinates and the second movement information; in response to selecting a configuration operation, determine a rigid grid point in each second grid point, and construct a rigid constraint equation based on the rigid coordinates initialized by the rigid grid point and the second movement information; calculate the movement difference information based on the movement difference equation, the movement constraint equation and the rigid constraint equation.
[0130] Optionally, the calculation update module 406 is further configured to determine the moving first coordinates of each first grid point in each moving frame based on the first movement information; determine the moving second coordinates of each second grid point in each moving frame based on the second movement information; determine the corresponding target first coordinates in the first coordinates for the target second coordinates of the target second grid point in the target moving frame based on the corresponding relationship, wherein the target second grid point is any second grid point and the target moving frame is any moving frame; and construct a movement difference equation based on the target first coordinates, the target second coordinates and the preset movement difference parameters.
[0131] Optionally, the calculation update module 406 is further configured to initialize the initial model in the virtual environment to obtain the initial second coordinates of each second grid point; for the target second grid point, calculate the initial distance information between the target second grid point and the adjacent grid points based on the initial second coordinates; and construct a movement constraint equation based on the initial distance information, the second movement information and the preset movement constraint parameters.
[0132] Optionally, the initial model includes multiple components; accordingly, the calculation update module 406 is further configured to determine the rigid component identifier in response to the selection of the configuration operation; determine the rigid component among the multiple components based on the rigid component identifier, and determine the second grid point of the rigid component as the rigid grid point; obtain the initial rigid coordinates initialized for each rigid grid point; calculate the rigid distance information between each target rigid grid point based on the initial rigid coordinates; and construct a rigid constraint equation based on the rigid distance information, the second movement information and the preset rigid constraint parameters.
[0133] Optionally, the calculation update module 406 is further configured to receive the mobile constraint coefficient and the rigid constraint coefficient sent by the front end; based on the mobile constraint coefficient and the rigid constraint coefficient, perform weighted calculation on the mobile difference equation, the mobile constraint equation and the rigid constraint equation to obtain the mobile difference information.
[0134] Optionally, the calculation update module 406 is further configured to determine the bone binding weight of the target second grid point in each moving frame based on the movement difference information; update the initial model based on the bone binding weight; and replace the reference model with the updated initial model in the target virtual scene when a preset switching condition is triggered.
[0135] Applied to the model processing device, first the first acquisition module 402 acquires the movement information of the high-precision model, and then the second acquisition module 404 acquires the movement information of the low-precision model, and calculates the movement difference between the two. Based on the difference information, the calculation update module 406 adjusts the grid point weights and positions of the low-precision model so that it can be closer to the performance of the high-precision model when performing the same behavior. This not only reduces the workload of developers and shortens the development cycle, but also reduces the calculation pressure while maintaining the quality of model performance, especially when processing distant views or character backs, effectively improving the performance and smoothness of the game.
[0136] The above is a schematic scheme of a model processing device of this embodiment. It should be noted that the technical scheme of the model processing device and the technical scheme of the above-mentioned model processing method belong to the same concept, and the details not described in detail in the technical scheme of the model processing device can be referred to the description of the technical scheme of the above-mentioned model processing method.
[0137] Figure 5 The block diagram of a computing device 500 provided according to an embodiment of the present invention is shown. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.
[0138] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0139] In one embodiment of the present invention, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present invention. Those skilled in the art may add or replace other components as needed.
[0140] The computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 500 may also be a mobile or stationary server.
[0141] The processor 520 is used to execute the following computer program / instructions, which implement the steps of the above-mentioned model processing method when executed by the processor.
[0142] Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computing device embodiment, since it is basically similar to the model processing method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the model processing method embodiment.
[0143] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned model processing method when executed by a processor.
[0144] Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer-readable storage medium embodiment, since it is basically similar to the model processing method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the model processing method embodiment.
[0145] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned model processing method when executed by a processor.
[0146] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above-mentioned model processing method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above-mentioned model processing method.
[0147] The above describes specific embodiments of the present invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0148] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0149] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of the present invention.
[0150] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0151] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of the present invention. The present invention selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A model processing method, characterized in that: include: Acquire first movement information of a reference model, wherein the reference model is a model in which each first grid point is bound to a first number of bones, and the first movement information is used to represent movement information of the reference model executing a target behavior; Acquire second movement information of an initial model, wherein the initial model is a model in which each second grid point is bound to a second number of bones, the second number of bones is less than the first number of bones, the initial model and the reference model correspond to the same virtual object, and the second movement information is used to characterize movement information of the initial model executing the target behavior; Motion difference information is calculated based on the first movement information and the second movement information, and the initial model is updated based on the movement difference information, and the reference model is replaced by the updated initial model.
2. The method according to claim 1, characterized in that The obtaining first movement information of the reference model includes: Initializing the reference model in the virtual environment to obtain initial first coordinates of each first grid point; Determine a target behavior instruction in preconfigured behavior instructions, run the target behavior instruction to make the reference model perform a target behavior, and record the trajectory information of the first coordinate during the execution process as the first movement information, wherein the target behavior instruction is any preconfigured behavior instruction.
3. The method according to claim 2, characterized in that The obtaining of the second movement information of the initial model comprises: Initializing the initial model in the virtual environment to obtain initial second coordinates of each second grid point; The target behavior instruction is executed to make the initial model execute the target behavior, and the trajectory information of the second coordinate during the execution is recorded as the second movement information.
4. The method according to claim 1, characterized in that: The calculating movement difference information based on the first movement information and the second movement information includes: constructing a movement difference equation based on the first movement information and the second movement information; Initializing the initial model in the virtual environment, obtaining initial second coordinates of each second grid point, and constructing a movement constraint equation based on the initial second coordinates and the second movement information; In response to selecting a configuration operation, determining a rigid grid point among the second grid points, and constructing a rigid constraint equation based on rigid coordinates initialized from the rigid grid point and the second movement information; Motion difference information is calculated based on the movement difference equation, the movement constraint equation, and the rigid constraint equation.
5. The method according to claim 4, characterized in that There is a corresponding relationship between the first grid points and the second grid points; The constructing a movement difference equation based on the first movement information and the second movement information includes: Determining first moving coordinates of each first grid point in each moving frame based on the first moving information; Determining, based on the second movement information, a second movement coordinate of each second grid point in each movement frame; For a target second coordinate of a target second grid point in a target moving frame, determining a corresponding target first coordinate in the first coordinate based on the corresponding relationship, wherein the target second grid point is any second grid point, and the target moving frame is any moving frame; A movement difference equation is constructed based on the target first coordinate, the target second coordinate and a preset movement difference parameter.
6. The method according to claim 4, characterized in that The obtaining of the initial second coordinates of each second grid point initialized, and constructing a movement constraint equation based on the initial second coordinates and the second movement information includes: Obtaining the initial second coordinates of each second grid point initialization; For the target second grid point, calculating initial distance information between the target second grid point and adjacent grid points based on the initial second coordinates; A movement constraint equation is constructed based on the initial distance information, the second movement information and preset movement constraint parameters.
7. The method according to claim 4, characterized in that The initial model includes a plurality of components; in response to the configuration selection operation, a rigid grid point is determined among the second grid points, and a rigid constraint equation is constructed based on the rigid coordinates initialized by the rigid grid point and the second movement information, including: In response to selecting a configuration operation, determining a rigid component identification; Determine a rigid component among the plurality of components based on the rigid component identifier, and determine a second grid point of the rigid component as a rigid grid point; Obtaining initial rigid coordinates of each rigid grid point initialization; Calculate the rigid distance information between each target rigid grid point based on the initial rigid coordinates; A rigid constraint equation is constructed based on the rigid distance information, the second movement information and preset rigid constraint parameters.
8. The method according to claim 4, characterized in that The calculating the movement difference information based on the movement difference equation, the movement constraint equation and the rigid constraint equation comprises: Receive the mobile constraint coefficient and rigid constraint coefficient sent by the front end; Based on the movement constraint coefficient and the rigid constraint coefficient, weighted calculation is performed on the movement difference equation, the movement constraint equation and the rigid constraint equation to obtain movement difference information.
9. The method according to claim 1, characterized in that: The updating of the initial model based on the movement difference information and replacing the reference model with the updated initial model includes: For the target second grid point, determining the bone binding weight of the target second grid point in each movement frame based on the movement difference information; Updating the initial model based on the bone binding weights; When the preset switching condition is triggered, the reference model is replaced by the updated initial model in the target virtual scene.
10. A model processing device, characterized in that: include: A first acquisition module is configured to acquire first movement information of a reference model, wherein the reference model is a model in which each first grid point is bound to a first number of bones, and the first movement information is used to represent movement information of the reference model executing a target behavior; A second acquisition module is configured to acquire second movement information of an initial model, wherein the initial model is a model in which each second grid point is bound to a second number of bones, the second number of bones is less than the first number of bones, the initial model and the reference model correspond to the same virtual object, and the second movement information is used to represent movement information of the initial model executing the target behavior; The calculation and updating module is configured to calculate movement difference information based on the first movement information and the second movement information, update the initial model based on the movement difference information, and replace the reference model with the updated initial model.
11. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the model processing method according to any one of claims 1 to 9 are implemented.
12. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which, when executed by a processor, implements the steps of the model processing method described in any one of claims 1 to 9.
13. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the model processing method according to any one of claims 1 to 9.