Model generation method, device, equipment and storage medium

By generating an irregular mesh that adapts to the surface of the virtual model and performing adaptive rotation and scaling, the problem of unsatisfactory visual effects of patch models on complex curved surfaces is solved, achieving a natural and uniform visual arrangement effect.

CN122244301APending Publication Date: 2026-06-19SHANGHAI NETEASE CUICAN NETWORK TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI NETEASE CUICAN NETWORK TECHNOLOGY CO LTD
Filing Date
2026-02-27
Publication Date
2026-06-19

Smart Images

  • Figure CN122244301A_ABST
    Figure CN122244301A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, and storage medium for generating a model. The method includes: acquiring a first virtual model and generating a mesh based on the geometric properties of the model's vertices; determining rotation and scaling parameters based on the surface properties and vertex density distribution of the neighborhood of the mesh vertices; and processing the second virtual model generated at the corresponding mesh vertices based on the rotation and scaling parameters to obtain a target virtual model. The solution provided by this application effectively ensures that the target virtual model at each mesh vertex fits the surface of the first virtual model without overlapping, while also presenting a more natural and relatively uniform visual arrangement, thereby improving the user's visual experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a method, apparatus, device, and storage medium for generating a model. Background Technology

[0002] In digital content creation, to enhance the user's visual experience, it is often necessary to generate models such as modular patches (e.g., scales, armor plates) on the outer surface of virtual prop models.

[0003] However, the models generated on the outer surface of virtual models are usually pre-made patch models that are evenly distributed and pasted into the regular grid cells of the virtual model. This results in less than ideal visual effects, such as arrangement, orientation and density, of the patch models on some virtual models with complex shapes, such as multi-curved surfaces. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for generating a model, aiming to improve the visual effect of patch models on virtual models, so that they can adapt to the curved surface characteristics of the virtual model and thus present a more natural distribution effect.

[0005] Firstly, this application provides a method for generating a model, comprising:

[0006] Obtain a first virtual model, and generate a mesh on the surface of the first virtual model based on the geometric properties of the model vertices of the first model; The rotation parameters of each grid vertex are determined based on the surface properties of the neighborhood of each grid vertex in the grid, and the scaling parameters of each grid vertex are determined based on the vertex density distribution of the neighborhood of each grid vertex. Based on the rotation and scaling parameters of each mesh vertex, the second virtual model generated at the corresponding mesh vertex is processed to obtain the target virtual model.

[0007] Secondly, this application also provides an apparatus for generating a surface adhesion model, comprising: A generation module is used to obtain a first virtual model and generate a mesh on the surface of the first virtual model according to the geometric properties of the model vertices of the first virtual model. The determination module is used to determine the rotation parameters of each mesh vertex based on the surface properties of the neighborhood of each mesh vertex in the mesh, and to determine the scaling parameters of each mesh vertex based on the vertex density distribution of the neighborhood of each mesh vertex. The processing module is used to process the second virtual model generated at the corresponding mesh vertex according to the rotation parameters and scaling parameters of each mesh vertex to obtain the target virtual model.

[0008] Thirdly, this application also provides a computer device, the computer device comprising: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the surface adhesion model generation method as described above.

[0009] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute the surface adhesion model generation method as described above.

[0010] The model generation method provided in this application generates a mesh on the surface of the first virtual model that can adapt to the surface details of the initial virtual model based on the geometric properties of the model vertices of the first virtual model. Then, rotation parameters and scaling parameters are determined based on the surface properties of the neighborhood of the mesh vertices and the vertex density distribution information, so as to perform corresponding rotation and scaling processing on the second virtual model generated at each corresponding mesh vertex. While ensuring that the target virtual model at each mesh vertex can effectively fit the surface of the first virtual model and not overlap with each other, it can present a more natural and relatively unified visual arrangement effect, thereby improving the user's visual experience. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 A schematic flowchart illustrating the steps of a model generation method provided in an embodiment of this application; Figure 2 This application provides a schematic diagram illustrating the specific steps involved in generating a mesh. Figure 3a A schematic diagram illustrating the effect of subdividing the surface of a first virtual model according to an embodiment of this application; Figure 3b This is a schematic diagram illustrating the effect of mesh reconstruction on the surface of a first virtual model provided in an embodiment of this application; Figure 4a This is a schematic diagram illustrating the effect of a second virtual model provided in an embodiment of this application; Figure 4bA schematic diagram illustrating the local effect of the first virtual model when the second virtual model is instantiated to a mesh vertex, as provided in an embodiment of this application; Figure 4c This is a schematic diagram illustrating the effect of visually displaying the density distribution of a target virtual model based on different colors, according to an embodiment of this application. Figure 5a This is a schematic diagram illustrating the visual effect of performing an extrusion operation on a target virtual model to improve the three-dimensionality of the target virtual model, as provided in an embodiment of this application. Figure 5b A schematic diagram illustrating the effect of a first virtual model with specific visual effects on its surface, provided in an embodiment of this application; Figure 6 A schematic diagram of a model generation device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0014] The use of "applies to" or "configured to" in this application implies open and inclusive language, which does not exclude the applicability to or configuration to devices performing additional tasks or steps. Additionally, the use of "based on" implies openness and inclusivity, because processes, steps, calculations, or other actions "based on" one or more of the stated conditions or values ​​may in practice be based on additional conditions or values ​​beyond those stated.

[0015] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0016] To clearly understand the model generation method provided in this application embodiment, the relevant application background of the model generation method will first be explained. Specifically, the model generation method provided in this application is generally used in the field of digital content creation, such as the creation of virtual object models in film, television, or games. Taking games as an example, in order to improve the user's visual experience in the game, modular patches, such as scales, armor plates, spikes, etc., can usually be created and generated on the outer surface of virtual prop models, such as virtual weapons and virtual clothing, so that the appearance of virtual props presents special visual effects.

[0017] Currently, the model generation scheme of related technologies usually chooses to uniformly distribute and attach the patch model within the regular grid cells of the virtual model. However, in practical applications, it has been found that this method often leads to the visual effect of the patch model, such as the arrangement, orientation or density, being less than ideal for some virtual models with complex shapes, especially those with multiple curved surfaces. It is often difficult to reflect the visual experience of adapting to the details of the model surface.

[0018] To address the aforementioned issues, this application provides a model generation method, apparatus, device, and storage medium. By reconstructing the outer mesh of the initial model and using the surface properties and density distribution information of the neighborhood of mesh vertices as rotation and scaling parameters for the patch model, adaptive rotation and scaling are applied to the initial patch model at corresponding vertices. This ensures that the processed patch model effectively conforms to the surface of the initial model without overlapping, while also presenting a more natural and relatively uniform visual arrangement. Specifically, the following will describe this in conjunction with specific embodiments.

[0019] Please see Figure 1 , Figure 1 This application provides a schematic flowchart of a model generation method, specifically including steps S110-S130: S110, Obtain the first virtual model, and generate a mesh on the surface of the first virtual model according to the geometric properties of the model vertices of the first virtual model.

[0020] In the embodiments of this application, the first virtual model refers to the virtual model on which a patch model needs to be created. For example, the first virtual model can be a virtual weapon model, a virtual clothing model, or a virtual prop model in a game, etc., while the patch model usually refers to a modular patch attached to the surface of the first virtual model, so that the first virtual model can present a special visual effect, such as scales, armor plates, or spikes. For ease of description, in the subsequent embodiments of this application, the first virtual model is mainly a virtual weapon model, and the patch model is scales, as an example for illustration. The related solutions provided in the embodiments of this application are merely some possible implementation solutions and should not be construed as limiting the technical solutions of this application. Other patch models on the surface of the first virtual model that can be generated by those skilled in the art based on the embodiments of this application, such as the generation of armor plates on a virtual clothing model, etc., should all be considered within the scope of protection claimed in this application.

[0021] Specifically, the first virtual model is typically created in advance by artists using Digital Content Creation (DCC) software. This application does not limit the creation process of the first virtual model. Generally, the first virtual model consists of several model vertices and edges and faces formed by those vertices. It can be understood that the geometric properties of the model vertices in the first virtual model can be used to indicate the geometric features of the corresponding virtual object at a specific location, especially the geometric properties of the model vertices on its outer surface, such as changes in curvature or edge length, which can describe the detailed features of the virtual object's outer surface at a specific location. Therefore, in one embodiment of this application, upon determining that a first virtual model for creating patch models is needed, a mesh that adapts to the details of the model surface is further created on the surface of the first virtual model based on the geometric properties of the model vertices, thus providing a foundation for the subsequent generation of patch models.

[0022] Specifically, in some embodiments of this application, the mesh generated on the surface of the first virtual model based on the geometric properties of the model vertices of the first virtual model can typically be an irregular mesh, particularly referring to meshes with different shapes or sizes. For example, taking a triangular mesh as an example, the irregular mesh generated here means that the side lengths of each triangular mesh are not all the same. Of course, the above-described solution is only an example of a triangular mesh. Similarly, based on actual needs, the irregular mesh here can also be a quadrilateral mesh or a mesh with more sides. Of course, it can also be a mixture of multiple meshes, such as a mixture of triangular meshes and quadrilateral meshes. This application does not limit this; it is feasible to generate irregular meshes with different shapes or sizes on the surface of the initial virtual model based on the geometric properties of the model vertices to indicate the surface details of the initial virtual model.

[0023] Specifically, for a better understanding of the implementation scheme of generating a mesh on the surface of the first virtual model based on the geometric properties of the model vertices, please refer to [link to documentation]. Figure 2 , Figure 2 This application provides a schematic flowchart illustrating specific steps for generating a mesh, specifically including steps S210 to S220: S210, for each model vertex of the first virtual model, determine the mesh cell size corresponding to the model vertex based on the geometric properties of the model vertex.

[0024] In one embodiment of this application, the geometric properties of model vertices can specifically be curvature or edge length variations, or other geometric properties used to reflect the surface details of the first virtual model. Specifically, for ease of understanding, taking curvature as an example, it can be understood that a model vertex with high curvature indicates that it is usually located at a position where the model surface is undergoing drastic changes, while a model vertex with low curvature indicates that it is usually located at a flat position of the model. For example, taking a virtual tool model as an example, the model vertices located at the tip of the virtual tool model or at the connection between the blade and the shank usually have higher curvature and often have richer surface detail variations, while the model vertices located on the blade usually have lower curvature and generally do not have rich surface detail variations. Therefore, the mesh cell size at the corresponding model vertex can be determined based on the surface details of the first virtual model indicated by the geometric properties of the model vertices. In other words, the mesh cell size is related to the surface details of the first virtual model indicated by the geometric properties. In particular, the mesh cell size is usually negatively correlated with the richness of the surface details of the first virtual model indicated by the geometric properties. That is, the higher the richness of the surface details of the first virtual model (the higher the curvature), the smaller the mesh cell size can be reconstructed to make the surface details present a higher resolution, thereby improving the visual performance of the subsequent patch model.

[0025] Of course, the embodiments provided above are merely illustrative examples using curvature. In fact, other geometric properties that can reflect the surface details of the first virtual model, such as changes in side length, can be used in a similar manner to determine the mesh cell size corresponding to the model vertices. For example, model vertices with large changes in side length usually indicate that they are located at positions where the model surface is undergoing drastic changes, while model vertices with small changes in side length (i.e., model vertices where the mesh size distribution is relatively uniform) usually indicate that they are located at flat positions in the first virtual model. Therefore, based on a similar approach to curvature, changes in side length can also be used to determine the mesh cell size corresponding to the model vertices.

[0026] Of course, when determining the specific mesh cell size, in order to ensure the visual visibility of the patch model, it is usually required that the mesh cell size not be lower than the minimum cell size. At the same time, in order to ensure a smooth transition between the mesh cell sizes of each mesh, in one embodiment of this application, the process of determining the mesh cell size corresponding to the model vertex based on the geometric properties of the model vertex of the first virtual model can be specifically determined by the following formula:

[0027] in, Represents the model vertices i The size of the grid cells at that location, This indicates the preset minimum grid cell size. This indicates the preset global default grid cell size, while This indicates a geometric property. Related functions, for example, as can be seen from the foregoing description, include model vertices. i The higher the curvature, the richer the surface details, which requires a smaller mesh unit size to improve resolution. Specifically, it could be a pair The negative correlation function, specifically its expression, can be configured based on the visual effect of the patch model during practical applications; this embodiment does not impose any limitations on this. Of course, here... It can also be other geometric properties, including but not limited to the changes in side length mentioned above.

[0028] S220, based on the mesh unit size corresponding to each of the model vertices, perform mesh reconstruction on the surface mesh of the first virtual model to obtain an irregular mesh that adapts to the surface details.

[0029] After obtaining the mesh cell size corresponding to each model vertex through the aforementioned method, the surface mesh of the first virtual model is reconstructed based on this information, resulting in an irregular mesh that adapts to the surface details. In other words, at locations with rich surface details in the first virtual model, such as complex curved surfaces, the mesh cell size of the irregular mesh is usually smaller. This allows for the generation of more and finer patch models at higher resolution, improving the visual performance of the patch models at locations with rich surface details.

[0030] Specifically, the above-mentioned mesh reconstruction can usually be achieved based on the functional nodes integrated in digital content creation software, such as the ReMesh node. Of course, it is also feasible to implement mesh reconstruction based on other methods.

[0031] The solution provided in this application determines the mesh cell size corresponding to the model vertex by associating the surface details of the first virtual model with the geometric attributes of the model vertex. Based on the mesh cell size, the surface mesh is reconstructed, so that the resulting irregular mesh can be adapted to the surface details of the first virtual model. This allows the arrangement density of the subsequent patch model to be adapted to the curved surface features of the virtual model, thereby improving the visual effect of the patch model.

[0032] Building upon the aforementioned solutions, to further improve the creation effect of irregular meshes, in another embodiment of this application, the surface mesh of the first virtual model can be further subdivided to obtain a more refined mesh with higher resolution, thereby further improving the local geometric resolution. In other words, in one embodiment of this application, the method further includes: The surface mesh of the first virtual model is divided to obtain a subdivided mesh.

[0033] At this point, the process of reconstructing the surface mesh of the first virtual model based on the mesh cell size corresponding to each of the model vertices to obtain an irregular mesh adapted to the surface details includes: Based on the mesh cell size corresponding to each model vertex, the subdivided mesh is reconstructed to obtain an irregular mesh that adapts to the surface details.

[0034] Specifically, in one embodiment of this application, the surface mesh is divided to increase the mesh density, thereby further improving the effect of subsequent adaptive weight generation of irregular meshes.

[0035] Specifically, the division of the surface mesh can also rely on the functional nodes integrated in digital content creation software, such as the subdivide node. Based on this, after determining the mesh unit size corresponding to each model vertex according to the method provided in any of the aforementioned embodiments, the subdivided mesh can be reconstructed based on the mesh unit size corresponding to each model vertex, thereby obtaining an irregular mesh that adapts to the surface details.

[0036] Of course, in the process of dividing the surface mesh to obtain a subdivided mesh, the mesh cell size corresponding to the model vertex can also be determined based on the geometric properties of the model vertex of the first virtual model and the geometric properties of the subdivided mesh. That is, in a further embodiment of this application, determining the mesh cell size corresponding to the model vertex based on the geometric properties of the model vertex of the first virtual model includes: Based on the geometric properties of the model vertices of the first virtual model and the geometric properties of the subdivided mesh, the mesh cell size corresponding to the model vertex is determined.

[0037] It is understandable that, similar to the geometric properties of model vertices, the geometric properties of subdivision meshes, such as surface curvature, can also be used to characterize the richness of details on the model surface. Therefore, the mesh cell size corresponding to the model vertex can be determined by weighting the geometric properties of the model vertices and the geometric properties of the subdivision meshes, thereby further improving the performance of irregular meshes generated on the surface of the initial virtual model.

[0038] Specifically, for a better understanding of the relevant descriptions provided in the embodiments of this application, please refer to... Figure 3a and Figure 3b , Figure 3a This is a schematic diagram illustrating the effect of subdividing the surface of a first virtual model according to an embodiment of this application. It can be seen that... Figure 3a In the provided schematic diagram, the surface of the first virtual model is divided into a smaller, denser subdivision mesh 310. And... Figure 3b This is a schematic diagram illustrating the effect of mesh reconstruction of the surface of a first virtual model provided in an embodiment of this application. It can be seen that, based on... Figure 3a The provided subdivided mesh generates more irregular triangular meshes 320 on the surface of the first virtual model. In particular, the mesh size of each triangular mesh 320 is not exactly the same at different positions. For example, the mesh size of the triangular mesh 320 at the blade position is larger, while the mesh size of the triangular mesh 320 at the blade tip or blade back position is relatively smaller.

[0039] The solution provided in this application embodiment allows for the generation of an irregular mesh that adapts to the surface details of the model by meshing and reconstructing the surface of the first virtual model. This facilitates the subsequent generation of a patch model that adapts to the surface details of the model, thereby improving the visual experience of the patch model.

[0040] S120, determine the rotation parameters of each mesh vertex based on the surface properties of the neighborhood of each mesh vertex in the mesh, and determine the scaling parameters of each mesh vertex based on the vertex density distribution of the neighborhood of each mesh vertex.

[0041] After reconstructing the surface mesh of the first virtual model through the aforementioned embodiments, it can be understood that by copying the pre-created patch model to each mesh vertex in an instantiated manner, the patch can present a density distribution that is more adapted to the surface details of the first virtual model, such as curved surface features. Furthermore, to ensure that the final generated patch model effectively fits the surface of the first virtual model without overlapping, and presents a more natural texture distribution, in one embodiment of this application, the scaling and rotation parameters of the patch model can be further controlled based on the relevant attributes of each mesh vertex, such as the curved surface attributes of the neighborhood or the vertex density distribution, thereby adjusting the initial patch model at the corresponding mesh vertex.

[0042] To facilitate understanding of the above content, the following will explain the determination of rotation parameters based on neighborhood surface properties and the determination of scaling parameters based on neighborhood vertex density distribution. Specifically, in the process of determining the rotation parameters of the surface attachment model based on the surface properties of the neighborhood of each mesh vertex in the mesh, the surface properties of the neighborhood of each mesh vertex can typically include the normal vector of that mesh vertex on the first virtual model. It can be understood that this normal vector can be used to determine the tangent plane of that mesh vertex on the first virtual model. Therefore, the first rotation parameter determined based on this normal vector can be used to control the initial patch model at the corresponding mesh vertex to rotate into the tangent plane, so that the rotated patch model can just fit with the surface of the first virtual model (that is, be tangent at the mesh vertex).

[0043] Building upon the foregoing, in one embodiment of this application, the surface properties of the neighborhood may further include a slope in a preset direction. This slope further determines the orientation of the patch model within the tangent plane, allowing the arrangement direction of the patch model to conform to the geometric flow (i.e., trend) of the first virtual model. This results in a more natural and regular arrangement of the patch model, avoiding the problem of messy texture direction. In other words, in one embodiment of this application, the surface properties of the neighborhood include the normal vector at the mesh vertex on the first virtual model and the slope of the mesh vertex in a preset direction. The step of determining the rotation parameters of each mesh vertex based on the surface properties of the neighborhood of each mesh vertex in the mesh includes: For each grid vertex in the grid, a first rotation parameter of the grid vertex is determined based on the normal vector at the grid vertex. The first rotation parameter is used to rotate the second virtual model to a tangent plane perpendicular to the normal vector so as to fit the surface of the first virtual model. The second rotation parameter of the mesh vertex is determined based on the slope of the mesh vertex in a preset direction. The second rotation parameter is used to control the orientation of the second virtual model on the cutting plane.

[0044] Specifically, to facilitate understanding of the above content, in one embodiment of this application, taking a common coordinate system establishment method in 3D modeling as an example, for a virtual weapon model, such as a virtual gun model, the barrel of the virtual gun model usually points to the Z-axis (the horizontal direction in screen space), the side of the gun body faces the X-axis (the direction perpendicular to the screen), and the top / bottom of the gun body faces the Y-axis (the vertical direction in screen space). At this time, the preset direction can be the Y-direction. The slope in the Y-direction can be understood as the local geometric gradient in the Y-direction, that is, in the height direction of the gun. It can usually be calculated by projecting the local Y-direction onto the curved surface of the weapon. The specific formula is:

[0045] Here, 'up' can be understood as a second rotational parameter that controls the orientation of the patch model within the tangent plane. Let Y be the world coordinate component of the mesh vertex, and u be the local parameterization direction.

[0046] The solution provided above, based on the calculated slope and stored as a control for the orientation of the scales on the cutting plane, allows the scales to be arranged in a direction that conforms to the geometric flow of the gun body, such as arranging them along the arc of the gun barrel. This avoids the abnormal visual appearance of messy texture caused by randomly arranged scales.

[0047] Furthermore, to enable the generated patch models at mesh vertices to adapt to local density and thus avoid overlapping of patch models, in the embodiments of this application, the scaling parameters of the patch models can be determined based on the vertex density distribution of the neighborhood of each mesh vertex. Specifically, the vertex density distribution of the neighborhood of a mesh vertex can usually be determined based on the distance between the mesh vertex and its neighboring mesh vertices. Neighboring mesh vertices typically refer to several mesh vertices whose distance from the mesh vertex is within a preset distance, usually adjacent to that mesh vertex. It can be understood that the shorter the distance between a mesh vertex and its neighboring mesh vertices, the higher the density distribution of the patch model at that mesh vertex. Therefore, to avoid overlapping of patch models at multiple mesh vertices, the patch models can be scaled down. Conversely, the longer the distance between a mesh vertex and its neighboring mesh vertices, the lower the density distribution of the patch model at that mesh vertex. In this case, the patch models can be appropriately enlarged to avoid abnormal visual effects such as holes (i.e., no patch model coverage) appearing on the surface of the first virtual model. Specifically, in one embodiment of this application, determining the scaling parameter of each mesh vertex based on the vertex density distribution of the neighborhood of each mesh vertex includes: For each vertex in the grid, obtain the distance between the vertex and its multiple adjacent vertices; The scaling parameters of the grid vertices are determined based on statistical values ​​of multiple distances, wherein the statistical values ​​include extreme values ​​and / or average values.

[0048] For example, as one possible implementation, the distances between a mesh vertex and its nearest neighboring mesh vertices can be obtained. Based on this, the scaling parameters of the patch model can be further determined based on the statistical values ​​of the distances. The scaling parameters of the patch model are typically positively correlated with the statistical values ​​of the distances. For instance, a higher statistical value, such as the minimum or average distance, indicates a lower density distribution of mesh vertices, in which case a higher scaling parameter can be set to control the patch model to be enlarged. Conversely, a lower statistical value, such as the minimum or average distance, indicates a higher density distribution of mesh vertices, in which case a lower scaling parameter can be set to control the patch model to be reduced.

[0049] Specifically, the methods for calculating the surface properties of a mesh vertex's neighborhood or the vertex density distribution of the mesh's neighborhood can also be implemented using functional nodes integrated into digital content creation software. For example, the `gradient` node can be used to calculate the slope `up` in a preset direction; the `point_scale` node can be used to calculate the minimum distance `pscale` (indicating the vertex density distribution of the mesh vertex's neighborhood) between each point and its nearest neighbor; and the `Normal` node can be used to calculate the normals of the mesh vertices. These details are not elaborated upon in this embodiment. The calculated results can be stored as point attribute information, such as `up`, `pscale`, or normals. This allows for automatic adaptation of the patch model's orientation and scaling based on the corresponding point attributes, such as `up`, `pscale`, or normals, when the patch model is subsequently instantiated to the corresponding mesh vertex position. Further details will be provided in subsequent embodiments.

[0050] S130, based on the rotation and scaling parameters of each mesh vertex, the second virtual model generated at the corresponding mesh vertex is processed to obtain the target virtual model.

[0051] Building upon the aforementioned solution, after storing the rotation and scaling parameters corresponding to each mesh vertex as point attributes, by instantiating pre-created individual second virtual models at each mesh vertex, the orientation and scaling of the second virtual model at each mesh vertex can be automatically adaptively adjusted according to the attributes of each mesh vertex, such as rotation and scaling parameters. This ultimately generates target virtual models of varying sizes and orientations at each mesh vertex. These target virtual models effectively conform to the surface of the first virtual model without overlapping, resulting in a more natural and relatively uniform visual arrangement. Here, the second virtual models generated at each mesh vertex are patch models with the same style, such as scales or armor plates, while the target virtual models are patch models of different sizes and orientations obtained by processing the parameters of each mesh vertex. Specifically, for ease of understanding, the following description will be provided in conjunction with the accompanying drawings of specific embodiments.

[0052] For details, please refer to Figure 4a , Figure 4a This is a schematic diagram illustrating the effect of a second virtual model provided in an embodiment of this application. The schematic diagram uses a scale-like patch model as an example for illustration. Specifically, artists can create a single scale-shaped second virtual model, i.e., a patch model, using model creation nodes (such as circle, clip, polyextrude, subdivide, smooth, etc.) in digital content creation software. Furthermore, the specific shape and proportions of the second virtual model can be adjusted in the attribwrangle node. This embodiment of the application does not limit the process of creating the second virtual model.

[0053] Building upon the aforementioned method, by using copy-to-points in digital content creation software, the created second virtual model is instantiated onto the surface of the first virtual model, specifically at each vertex of the mesh. Then, by incorporating the relevant properties of each mesh vertex, such as rotation and scaling parameters, the orientation and scaling of the second virtual model are adaptively adjusted. For details, please refer to [link to relevant documentation]. Figure 4b , Figure 4b This diagram illustrates a partial effect of the first virtual model when the second virtual model is instantiated at a mesh vertex. It can be seen that... Figure 4b In the partial effect diagram of the first virtual model shown, the surface patch models all exhibit a relatively uniform arrangement direction, thereby avoiding messy textures after rendering. In addition, the scale size is adaptively adjusted along the direction of the blade tip to avoid abnormal overlap of patch models in the detail area, and all patch models are effectively attached to the outer surface of the first virtual model to avoid abnormal lifting of the first attached model.

[0054] Furthermore, to facilitate artists' viewing of the scaling distribution of the patch models on the surface of the first virtual model, thereby enabling them to adjust the corresponding patch models, some embodiments of this application also provide a technical solution that visualizes the scaling distribution of the patch models through color mapping. Specifically, the method further includes: The target virtual model is colored according to the color value associated with the scaling parameter, so as to indicate the distribution of the target virtual model on the first virtual model based on the color distribution of the target virtual model on the first virtual model.

[0055] In one embodiment of this application, scaling parameters, such as the minimum distance from a mesh vertex to its neighboring vertices, can be stored as color values ​​in the color attributes of the mesh vertex. Thus, when the patch model, i.e. the second virtual model, is instantiated onto the corresponding mesh vertex, the adjusted target virtual model can be colored based on the corresponding color values, thereby indicating the distribution of the target virtual model on the first virtual model based on the color distribution of the target virtual model on the first virtual model.

[0056] For example, in one possible implementation, density visualization can be achieved by using the ramp function to map the minimum distance to a color gradient:

[0057] in, That is, grid vertices i color value, That is, grid vertices i The minimum distance value used to indicate the mesh vertices. i Density distribution at a location.

[0058] For a clearer understanding of the above, please refer to [link / reference]. Figure 4c , Figure 4c This diagram illustrates the effect of visualizing the density distribution of the surface-attached model using different colors. Specifically, it can be seen that areas with richer local details in the initial model, such as the blade tip or the junction of the blade and handle, are painted a darker color, indicating a higher density distribution of the patch model in that area. Conversely, the blade area is painted a relatively lighter color, indicating a lower density distribution of the patch model in that area. By visualizing the density distribution of the patch model, more precise adjustments to the patch model on the surface of the first virtual model can be made more effectively. For example, if the color distribution on the surface of the first virtual model is uneven, it indicates that the density distribution of the patch model in that location is uneven, thus requiring further adjustments to the patch model in that area.

[0059] Of course, it should be noted that the aforementioned solution is merely an example of instantiating the patch model, i.e., the second virtual model, onto the surface of the first virtual model, thereby displaying multiple patch models on the surface of the first virtual model. In fact, to ultimately improve the performance of the first virtual model, it is often necessary to merge the first virtual model with multiple patch models on its surface to construct a virtual model that exhibits a visual effect corresponding to the patch model, such as scale-like virtual weapons or armor-like virtual clothing. That is, in one embodiment of this application, after processing the second virtual model generated at the corresponding mesh vertex according to the rotation and scaling parameters corresponding to each mesh vertex to obtain the target virtual model, the process further includes: The target virtual model is merged with the first virtual model to generate a first virtual model whose surface has the visual effects corresponding to the target virtual model.

[0060] Specifically, to further improve the visual performance of the final generated first virtual model, some embodiments of this application further provide optimization processing for the instantiated target virtual model, such as scales, so that it can be merged with the original object to achieve a more complete surface scale effect of the virtual object. Specifically, merging the target virtual model with the first virtual model to generate a first virtual model with visual effects corresponding to the target virtual model includes: The target virtual model on the first virtual model is processed to be three-dimensional to obtain the enhanced target virtual model; The enhanced target virtual model is smoothed to merge the smoothed target virtual model with the first virtual model, generating a first virtual model with visual effects corresponding to the target virtual model on its surface.

[0061] In one embodiment of this application, a functional node integrated into digital content creation software, such as a polyextrude node, can be used to perform stereoscopic processing on the target virtual model, thereby enhancing its visual stereoscopic effect. Specifically, the polyextrude node enhances the visual stereoscopic effect of the target virtual model by increasing its thickness and adjusting its rotation. Of course, it is also feasible to adjust the thickness and rotation of the target virtual model in other ways to enhance its visual stereoscopic effect, and this application embodiment does not limit this approach.

[0062] For a clearer understanding of the above, please refer to [link / reference]. Figure 5a , Figure 5aThis is a schematic diagram illustrating a visual effect of performing an extrusion operation on a target virtual model to enhance its three-dimensionality, as provided in an embodiment of this application. It can be seen that... Figure 4b Compared to the schematic diagram showing the instantiation effect of the target virtual model, Figure 5a This presents the target virtual model with a more three-dimensional visual experience. Of course, it is understandable that, based on the visual requirements of the actual virtual model, this three-dimensional processing is only an optional step.

[0063] Furthermore, in order to improve the merging effect of the target virtual model and the first virtual model and make the first virtual model present a smoother visual experience, the target virtual model or the enhanced target virtual model can also be smoothed, so as to merge the smoothed target virtual model with the first virtual model.

[0064] Specifically, smoothing the target virtual model typically includes a secondary subdivision operation on the target virtual model and normal recalculation (for shading). That is, in one embodiment of this application, the smoothing of the enhanced target virtual model includes: The enhanced target virtual model is subjected to mesh subdivision processing to obtain a subdivided target virtual model; Determine the vertex normals of the subdivided target virtual model; The target virtual model is smoothed by applying the vertex normals to obtain the smoothed target virtual model.

[0065] Specifically, similar to the subdivision operation on the first virtual model, the mesh subdivision processing of the enhanced target virtual model refers to dividing the target virtual model into finer, denser subdivision meshes. By increasing the number of faces of the scales through subdivision, the sharp edges caused by the extrusion operation can be effectively eliminated, so that each patch model unit can present a rounded visual effect.

[0066] Based on this, the calculation of vertex normals is mainly used for subsequent smoothing shading, thereby ensuring that the patch models on the first virtual model, such as the scales on the virtual weapon, visually present a smooth curved surface rather than a polyhedral style.

[0067] For a clearer understanding of the above, please refer to [link / reference]. Figure 5b , Figure 5bThis illustration shows a schematic diagram of the effect of a virtual model with specific visual effects on its surface, provided by an embodiment of this application. It can be seen that the solution provided by this embodiment can ultimately achieve a complete surface scale effect with adaptive distribution, natural orientation, and scaling. Furthermore, in the complete solution, the instance position, scaling, and orientation of the patch model can be automatically calculated, reducing manual adjustments and effectively improving rendering pipeline efficiency.

[0068] The model generation method provided in this application generates a mesh on the surface of the first virtual model that can adapt to the surface details of the initial virtual model based on the geometric properties of the model vertices of the first virtual model. Then, based on the surface properties of the neighborhood of the mesh vertices and the vertex density distribution information, the rotation parameters and scaling parameters of the surface-attached model are determined respectively, so as to perform corresponding rotation and scaling processing on the second virtual model generated at each corresponding mesh vertex. While ensuring that the target virtual model at each mesh vertex can effectively fit the surface of the first virtual model and not overlap with each other, it can present a more natural and relatively unified visual arrangement effect, thereby improving the user's visual experience.

[0069] To better implement the model generation method provided in the embodiments of this application, based on the model generation method provided in the embodiments of this application, this application also provides a model generation apparatus, such as... Figure 6 As shown, the model generation device includes: The generation module 610 is used to obtain a first virtual model and generate a mesh on the surface of the first virtual model according to the geometric properties of the model vertices of the first virtual model. The determining module 620 is used to determine the rotation parameters of each mesh vertex based on the surface properties of the neighborhood of each mesh vertex in the mesh, and to determine the scaling parameters of each mesh vertex based on the vertex density distribution of the neighborhood of each mesh vertex. The processing module 630 is used to process the second virtual model generated at the corresponding mesh vertex according to the rotation parameters and scaling parameters of each mesh vertex to obtain the target virtual model.

[0070] In some embodiments of this application, the generation module 610 is further configured to determine the mesh cell size corresponding to each model vertex of the first virtual model based on the geometric properties of the model vertex, wherein the mesh cell size is associated with the surface details of the first virtual model indicated by the geometric properties; Based on the mesh cell size corresponding to each of the model vertices, the surface mesh of the first virtual model is reconstructed to obtain an irregular mesh that adapts to the surface details.

[0071] In some embodiments of this application, the generation module 610 is further configured to divide the surface mesh of the first virtual model to obtain a subdivided mesh; Based on the mesh cell size corresponding to each model vertex, the subdivided mesh is reconstructed to obtain an irregular mesh that adapts to the surface details.

[0072] In some embodiments of this application, the generation module 610 is further configured to determine the mesh cell size corresponding to the model vertex based on the geometric properties of the model vertices of the first virtual model and the geometric properties of the subdivided mesh.

[0073] In some embodiments of this application, the determining module 620 is further configured to determine a first rotation parameter of the mesh vertex based on the normal vector at the mesh vertex for each mesh vertex in the mesh, the first rotation parameter being used to rotate the second virtual model to a tangent plane perpendicular to the normal vector so as to fit the surface of the first virtual model; The second rotation parameter of the mesh vertex is determined based on the slope of the mesh vertex in a preset direction. The second rotation parameter is used to control the orientation of the second virtual model on the cutting plane.

[0074] In some embodiments of this application, the determining module 620 is further configured to obtain the distance between each grid vertex and its multiple adjacent grid vertices for each grid vertex in the grid; The scaling parameters of the grid vertices are determined based on statistical values ​​of multiple distances, wherein the statistical values ​​include extreme values ​​and / or average values.

[0075] In some embodiments of this application, the processing module 630 is further configured to color the target virtual model according to the color value associated with the scaling parameter, so as to indicate the distribution of the target virtual model on the first virtual model based on the color distribution of the target virtual model on the first virtual model.

[0076] In some embodiments of this application, the processing module 630 is further configured to perform stereoscopic processing on the target virtual model on the first virtual model to obtain an enhanced target virtual model; The enhanced target virtual model is smoothed to merge the smoothed target virtual model with the first virtual model, generating a first virtual model with visual effects corresponding to the target virtual model on its surface.

[0077] In some embodiments of this application, the processing module 630 is further configured to perform mesh subdivision processing on the enhanced target virtual model to obtain a subdivided target virtual model; Determine the vertex normals of the subdivided target virtual model; The target virtual model is smoothed by applying the vertex normals to obtain the smoothed target virtual model.

[0078] The model generation apparatus provided in this application generates a mesh on the surface of the first virtual model that can adapt to the surface details of the first virtual model based on the geometric attributes of the model vertices of the first virtual model. Then, rotation parameters and scaling parameters are determined based on the surface attributes of the neighborhood of the mesh vertices and the vertex density distribution information, so as to perform corresponding rotation and scaling processing on the second virtual model generated at each corresponding mesh vertex. While ensuring that the target virtual model at each mesh vertex can effectively fit the surface of the first virtual model and not overlap with each other, it can present a more natural and relatively unified visual arrangement effect, thereby improving the user's visual experience.

[0079] In some embodiments of this application, the model generation method can be implemented as a computer program, which can be implemented in, for example... Figure 7 It runs on the computer device shown. The computer device's memory can store the various program modules that make up the generating apparatus of the model, for example, Figure 6 The generation module 610, determination module 620, and processing module 630 are shown. The computer program, comprised of these modules, causes the processor to execute the steps in the model generation methods of the various embodiments of this application described in this specification.

[0080] For example, Figure 7 The computer equipment shown can be used as follows Figure 6 The generation module 610 in the model generation apparatus shown executes step S110. The computer device can execute step S120 via the determination module 620. The computer device can execute step S130 via the processing module 630. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device provides computational and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with external computer devices via a network connection. When the computer program is executed by the processor, it implements a model generation method.

[0081] Those skilled in the art will understand that Figure 7The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0082] In some embodiments of this application, a computer device is provided, including one or more processors; memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to perform the following steps: Obtain a first virtual model, and generate a mesh on the surface of the first virtual model based on the geometric properties of the model vertices of the first model; The rotation parameters of each grid vertex are determined based on the surface properties of the neighborhood of each grid vertex in the grid, and the scaling parameters of each grid vertex are determined based on the vertex density distribution of the neighborhood of each grid vertex. Based on the rotation and scaling parameters of each mesh vertex, the second virtual model generated at the corresponding mesh vertex is processed to obtain the target virtual model.

[0083] In some embodiments of this application, a computer-readable storage medium is provided, storing a computer program that is loaded by a processor, causing the processor to perform the following steps: Obtain a first virtual model, and generate a mesh on the surface of the first virtual model based on the geometric properties of the model vertices of the first model; The rotation parameters of each grid vertex are determined based on the surface properties of the neighborhood of each grid vertex in the grid, and the scaling parameters of each grid vertex are determined based on the vertex density distribution of the neighborhood of each grid vertex. Based on the rotation and scaling parameters of each mesh vertex, the second virtual model generated at the corresponding mesh vertex is processed to obtain the target virtual model.

[0084] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0085] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0086] The foregoing has provided a detailed description of a model generation method, apparatus, device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for generating a model, characterized in that, include: Obtain a first virtual model, and generate a mesh on the surface of the first virtual model based on the geometric properties of the model vertices of the first virtual model; The rotation parameters of each grid vertex are determined based on the surface properties of the neighborhood of each grid vertex in the grid, and the scaling parameters of each grid vertex are determined based on the vertex density distribution of the neighborhood of each grid vertex. Based on the rotation and scaling parameters of each mesh vertex, the second virtual model generated at the corresponding mesh vertex is processed to obtain the target virtual model.

2. The method according to claim 1, characterized in that, The step of generating a mesh on the surface of the first virtual model based on the geometric properties of the model vertices of the first virtual model includes: For each vertex of the first virtual model, the mesh cell size corresponding to the vertex is determined based on the geometric properties of the vertex, wherein the mesh cell size is associated with the surface details of the first virtual model indicated by the geometric properties; Based on the mesh cell size corresponding to each of the model vertices, the surface mesh of the first virtual model is reconstructed to obtain an irregular mesh that adapts to the surface details.

3. The method according to claim 2, characterized in that, The method further includes: The surface mesh of the first virtual model is divided to obtain a subdivided mesh; The step of reconstructing the surface mesh of the first virtual model based on the mesh cell size corresponding to each of the model vertices to obtain an irregular mesh adapted to the surface details includes: Based on the mesh cell size corresponding to each model vertex, the subdivided mesh is reconstructed to obtain an irregular mesh that adapts to the surface details.

4. The method according to claim 3, characterized in that, Determining the mesh cell size corresponding to the model vertex based on the geometric properties of the model vertex includes: Based on the geometric properties of the model vertices of the first virtual model and the geometric properties of the subdivided mesh, the mesh cell size corresponding to the model vertex is determined.

5. The method according to claim 1, characterized in that, The surface properties of the neighborhood include the normal vector at the grid vertex on the first virtual model and the slope of the grid vertex in a preset direction; The step of determining the rotation parameters of each mesh vertex based on the surface properties of the neighborhood of each mesh vertex in the mesh includes: For each grid vertex in the grid, a first rotation parameter of the grid vertex is determined based on the normal vector at the grid vertex. The first rotation parameter is used to rotate the second virtual model to a tangent plane perpendicular to the normal vector so as to fit the surface of the first virtual model. The second rotation parameter of the mesh vertex is determined based on the slope of the mesh vertex in a preset direction. The second rotation parameter is used to control the orientation of the second virtual model on the cutting plane.

6. The method according to claim 1, characterized in that, The step of determining the scaling parameters of each grid vertex based on the vertex density distribution of the neighborhood of each grid vertex includes: For each vertex in the grid, obtain the distance between the vertex and its multiple adjacent vertices; The scaling parameters of the grid vertices are determined based on statistical values ​​of multiple distances, wherein the statistical values ​​include extreme values ​​and / or average values.

7. The method according to claim 1, characterized in that, The method further includes: The target virtual model is colored according to the color value associated with the scaling parameter, so as to indicate the distribution of the target virtual model on the first virtual model based on the color distribution of the target virtual model on the first virtual model.

8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: The target virtual model on the first virtual model is processed to be three-dimensional to obtain the enhanced target virtual model; The enhanced target virtual model is smoothed to merge the smoothed target virtual model with the first virtual model, generating a first virtual model with visual effects corresponding to the target virtual model on its surface.

9. The method according to claim 8, characterized in that, The smoothing process for the enhanced target virtual model includes: The enhanced target virtual model is subjected to mesh subdivision processing to obtain a subdivided target virtual model; Determine the vertex normals of the subdivided target virtual model; The target virtual model is smoothed by applying the vertex normals to obtain the smoothed target virtual model.

10. A model generation apparatus, characterized in that, include: A generation module is used to obtain a first virtual model and generate a mesh on the surface of the first virtual model according to the geometric properties of the model vertices of the first virtual model. The determination module is used to determine the rotation parameters of each mesh vertex based on the surface properties of the neighborhood of each mesh vertex in the mesh, and to determine the scaling parameters of each mesh vertex based on the vertex density distribution of the neighborhood of each mesh vertex. The processing module is used to process the second virtual model generated at the corresponding mesh vertex according to the rotation parameters and scaling parameters of each mesh vertex to obtain the target virtual model.

11. A computer device, characterized in that, The computer device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the method of generating the model as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the method for generating the model as described in any one of claims 1 to 9.