Three-dimensional model rendering method and device and storage medium
By dividing the surface of a 3D model into multiple regions and adjusting the resolution of the texture maps, the problem of high rendering computation caused by high-resolution texture maps is solved, thereby optimizing the rendering effect and saving computing resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT DIGITAL (SHENZHEN) CO LTD
- Filing Date
- 2024-11-22
- Publication Date
- 2026-05-22
AI Technical Summary
In existing technologies, the high resolution of texture mapping results in a large amount of computation for rendering 3D models, and it is difficult to optimize the rendering process to improve the effect.
The surface of the 3D model is divided into multiple regions, and different adjustment strategies are used for each region to adjust the resolution of the texture map, forming multiple second texture maps with different resolutions to optimize the rendering process.
By adjusting the resolution of texture maps in different regions, the rendering effect of 3D models was optimized, while the amount of computation was reduced, achieving a reasonable allocation of resources.
Smart Images

Figure CN122072993A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer graphics technology, and in particular to a method, device and storage medium for rendering three-dimensional models. Background Technology
[0002] Texture mapping refers to mapping the texture in a texture map onto the surface of a 3D model, thereby rendering the 3D model.
[0003] The higher the resolution of the texture map, the better the rendering effect, but the greater the computational load for rendering the 3D model. Further research is needed on how to reasonably adjust the texture map to optimize the rendering process of the 3D model. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for rendering three-dimensional models. The technical solutions provided by this application are as follows:
[0005] According to one aspect of the embodiments of this application, a method for rendering a three-dimensional model is provided, the method comprising:
[0006] Divide the surface of at least one 3D model into N regions, where N is an integer greater than 1;
[0007] For each of the N regions, a first texture map is obtained, resulting in N first texture maps, which are used to provide the texture for the N regions;
[0008] For the N first texture maps, the resolution is adjusted according to the corresponding adjustment strategy to obtain N second texture maps. Among the N first texture maps, at least two first texture maps correspond to different adjustment strategies, and the N second texture maps have at least two different resolutions.
[0009] The at least one 3D model is rendered by applying the N second texture maps.
[0010] According to one aspect of the embodiments of this application, a rendering apparatus for a three-dimensional model is provided, the apparatus comprising:
[0011] The partitioning module is used to divide the surface of at least one 3D model into N regions, where N is an integer greater than 1;
[0012] The acquisition module is used to obtain a first texture map for each of the N regions, resulting in N first texture maps, which are used to provide the texture of the N regions;
[0013] An adjustment module is used to adjust the resolution of the N first texture maps according to the corresponding adjustment strategy to obtain N second texture maps. Among the N first texture maps, at least two first texture maps correspond to different adjustment strategies, and the N second texture maps have at least two different resolutions.
[0014] The rendering module is used to apply the N second texture maps to render the at least one 3D model.
[0015] According to one aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-described rendering method for a three-dimensional model.
[0016] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, the computer program being loaded and executed by a processor to implement the above-described rendering method for a three-dimensional model.
[0017] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program stored in a computer-readable storage medium, and a processor reading from the computer-readable storage medium and executing the computer program to implement the above-described rendering method for a three-dimensional model.
[0018] The technical solutions provided in this application have at least the following beneficial effects:
[0019] For N regions on the surface of at least one 3D model, the resolution of the texture map (first texture map) is adjusted using corresponding adjustment strategies. Since at least two regions among the N regions correspond to different adjustment strategies, the above method can regionally adjust the texture map for at least one 3D model. After the adjustment is completed, the texture map (second texture map) of each of the N regions has at least two different resolutions. That is to say, some regions on the surface of at least one 3D model use higher-resolution texture maps to optimize the display effect of the 3D model, while other regions use relatively lower-resolution texture maps to reduce the computational cost of rendering the 3D model. Therefore, the above method achieves reasonable allocation of texture maps for at least one 3D model, optimizing the rendering effect of at least one 3D model while controlling the computational cost of rendering at least one 3D model. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the rendering process of a three-dimensional model provided in one embodiment of this application;
[0021] Figure 2 This is a schematic diagram of a rendering method for a three-dimensional model provided in one embodiment of this application;
[0022] Figure 3 This is a schematic diagram of a computer system provided in one embodiment of this application;
[0023] Figure 4 This is a flowchart of a three-dimensional model rendering method provided in one embodiment of this application;
[0024] Figure 5 This is a flowchart of a three-dimensional model rendering method provided in another embodiment of this application;
[0025] Figure 6 This is a schematic diagram of the imaging principle in three-dimensional space provided in one embodiment of this application;
[0026] Figure 7 This is a schematic diagram of texture changes in a three-dimensional model provided in one embodiment of this application;
[0027] Figure 8 This is a schematic diagram of the region division of a three-dimensional model provided in one embodiment of this application;
[0028] Figure 9 This is a schematic diagram of a mesh provided in one embodiment of this application;
[0029] Figure 10 This is a schematic diagram illustrating the effect of an enhanced normal vector on light, provided in one embodiment of this application.
[0030] Figure 11 This is a schematic diagram of the decomposition and reconstruction of the Pyramid of Laplace provided in one embodiment of this application;
[0031] Figure 12 This is a flowchart of a three-dimensional model rendering method provided in another embodiment of this application;
[0032] Figure 13 This is a schematic diagram of a first neural network provided in one embodiment of this application;
[0033] Figure 14 This is a schematic diagram of the first extraction layer provided in one embodiment of this application;
[0034] Figure 15 This is a schematic diagram of a transition sub-region within a transition region provided in one embodiment of this application;
[0035] Figure 16 This is a schematic diagram of a texture replacement process provided in one embodiment of this application;
[0036] Figure 17 This is a block diagram of a rendering apparatus for a three-dimensional model provided in one embodiment of this application;
[0037] Figure 18 This is a structural block diagram of a computer device provided in one embodiment of this application. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0039] Before introducing the technical solutions of this application, some terms involved in this application will be explained. The following related explanations are optional solutions and can be arbitrarily combined with the technical solutions of the embodiments of this application, all of which fall within the protection scope of the embodiments of this application. The embodiments of this application include at least some of the following contents.
[0040] 3D model: A polygonal representation of an object. A 3D model can represent real-world entities or virtual objects.
[0041] Mesh: Also known as mesh face or patch, it is the basic unit that makes up a 3D model. A 3D model includes at least two meshes, and the vertices of a 3D model are the vertices of the meshes of the 3D model.
[0042] Texture image: A two-dimensional image used to describe the texture of a 3D model. Each pixel in the texture image can be mapped to different positions on the surface of the 3D model, thus providing information such as the color, texture, bumps, and lighting of the 3D model.
[0043] Texture mapping: Texture mapping is obtained from texture images and used to render corresponding areas on the surface of a 3D model. For example, during the rendering of a certain area of the surface of a 3D model, mapping the texture map corresponding to that area from the texture image onto that area can make the 3D model appear more realistic.
[0044] Resolution: Used to reflect the amount of information stored in a two-dimensional image. It can be measured by the number of pixels in an image area of a set size. For a certain area of a three-dimensional model, the higher the resolution of the texture map in that area, the better the detail of the three-dimensional model in that area. The lower the resolution of the texture map in that area, the blurrier the area will be.
[0045] Position vector: The position vector is used to indicate the position of a point in three-dimensional space. For a certain point, the position vector of the point is the vector pointing from the origin of the coordinate system in three-dimensional space to the point. In the embodiments of this application, the position of the origin of the coordinate system in three-dimensional space is not limited. For example, the origin of the coordinate system can be set outside the three-dimensional model in three-dimensional space, or the origin of the coordinate system can be set at the center point of the three-dimensional model in three-dimensional space.
[0046] like Figure 1 As shown, the initial 3D model is a meshed 3D model. To display this 3D model, the corresponding texture map needs to be mapped onto the surface of the 3D model, thereby rendering the 3D model. The resolution of the texture map directly affects the computing resources consumed in rendering the 3D model and the rendering effect of the 3D model. In some scenarios, due to certain defects in the initial texture map, the 3D model may experience rendering failures, excessively long rendering times, and unsatisfactory rendering effects. Therefore, it is necessary to adjust the initial texture map. For ease of explanation, in this embodiment, the original texture map with the resolution to be adjusted is referred to as the "first texture map," and the texture map with the adjusted resolution is referred to as the "second texture map."
[0047] Please refer to Figure 2 This diagram illustrates a rendering method for a 3D model provided in one embodiment of this application. The method includes the following stages:
[0048] 1. Scene Partitioning: In various fields such as games and videos where 3D models may be used, a single isolated 3D model can be displayed, or a 3D scene including at least two 3D models can be displayed, such as... Figure 2 As shown, a 3D scene is constructed in 3D space. Object 21 and background 22 in this 3D scene are both 3D models composed of meshes. In practical applications, there are relatively important areas in a 3D scene that require priority rendering and detailed rendering, as well as areas of relatively low importance with relatively blurry original texture maps. Based on this, the 3D scene can be divided into N regions (that is, the surfaces of each 3D model in the 3D scene are divided into N regions), where N is an integer greater than 1. For example... Figure 2 As shown, for example, object 21 is a relatively complex human model. Compared to the background 22, the quality of its rendering has a greater impact on the final display effect of the 3D scene. Therefore, the area on the surface of object 21 can be divided into one region, and the area on the surface of the background 22 can be divided into another region. It should be noted that the above-described region division for the 3D scene is only an illustrative example. Those skilled in the art should understand that the surface of a single 3D model can also be divided into N regions. For example, when object 21 is a human model, the facial area with more details can be divided into one region, and the body area with relatively fewer details can be divided into another region.
[0049] 2. Texture Adjustment: In this stage, corresponding adjustment strategies will be used to adjust the resolution of the first texture maps of the aforementioned N regions. At least two regions will have different adjustment strategies, thus achieving effective resource allocation and optimization. For example, for the region on object 21, the resolution of the first texture map in that region will be increased to enrich the details and features. In some cases, for the region on background 22, since its initial first texture map resolution is low and very blurry, its first texture map resolution can be increased to a certain extent (to prevent background 22 from consuming excessive computing resources, its second texture map resolution should still be lower than that of object 21), thus making the transition between the texture of background 22 and the texture of object 21 more natural. In other cases, for the region on background 22, since the resolution of its first texture map is lower than that of object 21, the resolution of its first texture map will be increased. Figure 1 This consumes significant computing resources. However, it's possible to reduce the resolution of the first texture map of the background 22 while ensuring a natural texture transition with object 21. For example, please refer to... Figure 2 After the texture mapping adjustment is completed, for two image regions 23 of the same size, the image region 23 on the second texture mapping of object 21 contains more pixels than the image region 23 on the second texture mapping of background 22. That is, the resolution of the second texture mapping of object 21 is greater than the resolution of the second texture mapping of background 22.
[0050] 3. Mapping Rendering: In this stage, the second texture maps of the aforementioned N regions are mapped onto at least one 3D model in the 3D scene, thereby achieving the rendering of at least one 3D model. For example... Figure 2 As shown, since the first texture maps of object 21 and background 22 were adjusted according to different strategies, a better rendering effect can be achieved by utilizing relatively reasonable computing resources.
[0051] Please refer to Figure 3 The diagram illustrates a computer system provided in one embodiment of this application. The computer system includes at least one of the following: a terminal device 10 and a server 20.
[0052] Terminal device 10 can be an electronic device such as a mobile phone, tablet computer, multimedia playback device, PC (Personal Computer), wearable device, in-vehicle terminal device, VR (Virtual Reality) device, AR (Augmented Reality) device, MR (Mixed Reality) device, etc. Terminal device 10 can run a client of a target application. The target application is an application that requires the use of a 3D model, or it is an application used to construct a 3D model. For example, the target application may include: a game application, a video application, a game engine application, a modeling application, etc. In some embodiments, terminal device 10 also has a texture adjustment application installed for optimizing a first texture map of the 3D model. In the target application, at least one 3D model with poor display quality and its corresponding first texture map are exported to the texture adjustment application. The texture adjustment application adjusts the first texture map to obtain a second texture map. In some embodiments, the second texture map is returned from the texture adjustment application to the client of the target application, and the client of the target application re-renders at least one 3D model based on the second texture map. In some embodiments, the texture adjustment application renders at least one 3D model based on a second texture map and returns the rendered at least one 3D model to the client of the target application.
[0053] Server 20 can be used to provide background services for the client of the aforementioned target application (such as a game application). For example, server 20 may be the background server for the aforementioned target application. In some embodiments, during the operation of the target application, at least one 3D model to be rendered (or at least one 3D model that failed to render or had unsatisfactory rendering effects) and the original first texture map (texture image) are uploaded to server 20. Server 20 adjusts the received first texture map and returns a second texture map (or the rendered at least one 3D model) to the client of the target application to achieve real-time display of the rendered at least one 3D model. Server 20 can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center.
[0054] Terminal device 10 can communicate with server 20 via a network, such as a wireless or wired network.
[0055] Furthermore, in this embodiment, the implementation form of the target application is not limited. For example, it can be an application that needs to be downloaded and installed, a mini-program that does not require installation, a web application, etc.
[0056] Please refer to Figure 4 The diagram illustrates a flowchart of a rendering method for a three-dimensional model according to an embodiment of this application. The execution entity for each step of this method is a computer device, which can be the terminal device 10 in the above embodiment or a server 20. The method includes at least one of the following steps 410 to 440.
[0057] Step 410: Divide the surface of at least one 3D model into N regions.
[0058] N is an integer greater than 1.
[0059] In some embodiments, please refer to Figure 5 Step 410 includes at least one of the following sub-steps 412 to 414.
[0060] Sub-step 412: Based on the reference information, the surface of at least one 3D model is divided into G-class regions.
[0061] G is an integer less than or equal to N.
[0062] In some embodiments, regions of different classes within the G class region have varying degrees of influence on the display effect of at least one 3D model.
[0063] In some embodiments, the G-type region includes a first-type region, a second-type region, and a transitional region. The transitional region is used to connect the first-type region and the second-type region. The first-type region has a greater influence on the display effect of at least one 3D model than the second-type region.
[0064] By dividing the surface of a 3D model into the aforementioned first and second types of regions, the resolution of these two types of regions, which have different importance (different degrees of impact on the display effect), can be adjusted using different strategies. Furthermore, developing separate resolution adjustment strategies for transitional regions connecting the first and second types ensures a natural transition from the first to the second type of region when displaying at least one 3D model. In other words, the above method achieves texture mapping optimization by employing three resolution adjustment strategies to adjust the texture map of at least one 3D model without needing to develop too many resolution adjustment strategies.
[0065] The influence of a region on the display effect of at least one 3D model can be measured by various factors. For example, the more complex the mesh structure of a region, the greater its influence on the display effect of at least one 3D model. Similarly, the lower the smoothness of the texture map and the more frequent the color changes in a region, the greater its influence on the display effect of at least one 3D model. Furthermore, when displaying at least one 3D model on a terminal device, the closer a region is to the center of the screen (center of view), the greater its influence on the display effect of at least one 3D model. In the following embodiments, a more detailed explanation will be given of how to divide the surface of at least one 3D model into G-class regions.
[0066] The reference information includes at least one of the following: structural data of at least one three-dimensional model, texture data of at least one three-dimensional model, and marking information of objects in three-dimensional space.
[0067] Structural data of at least one 3D model is used to describe the structure of at least one 3D model. Texture data of at least one 3D model is used to describe the surface texture of at least one 3D model. Labeling information of objects in 3D space is used to label objects in 3D space. Objects in 3D space can be points in 3D space, 3D models in 3D space, regions of the surface of 3D models in 3D space, etc. For example, for a point in 3D space, the labeling information includes the coordinates of the point to label the point. For example, for at least one 3D model in 3D space, the labeling information includes a label value for each of the at least one 3D model, which indicates whether the 3D model is labeled, such as a label value of 1 indicating that the 3D model is labeled, and a label value of 0 indicating that the 3D model is not labeled. For example, for regions of the surface of at least one 3D model, the labeling information includes a label value for each mesh of the at least one 3D model, which indicates whether the mesh is labeled, such as a label value of 1 indicating that the mesh is labeled, and a label value of 0 indicating that the mesh is not labeled. For example, the labeling information includes the vertex coordinates of the meshes to label regions of the surface of at least one 3D model.
[0068] In the above embodiments, structural data and texture data can reflect the structure and surface texture of at least one three-dimensional model, while the objects marked by the marking information can be arbitrarily adjusted according to the actual application scenario of at least one three-dimensional model, which improves the flexibility of region division. By combining the above three types of reference information, the surface of at least one three-dimensional model can be accurately and automatically divided into G-class regions that meet the requirements of technicians in various scenarios.
[0069] In some embodiments, sub-step 412 above includes at least one of the following steps:
[0070] 1. Based on the structural data of at least one three-dimensional model, obtain the curvature of each mesh of at least one three-dimensional model. The curvature of each mesh is used to reflect the degree of bending of at least one three-dimensional model at each mesh.
[0071] It should be noted that in this application, the curvature of the mesh does not mean that the mesh is a curved surface. The curvature of the mesh is used to reflect the degree of bending of at least one 3D model as a whole at that mesh, rather than reflecting the degree of bending of a single mesh.
[0072] In some embodiments, structural data of at least one 3D model is used to indicate the position of each vertex of the at least one 3D model in 3D space. In some embodiments, the structural data of at least one 3D model includes position vectors of each vertex of the at least one 3D model.
[0073] In some embodiments, the step includes at least one of the following steps:
[0074] (1) Based on the position vectors of each vertex of at least one three-dimensional model, obtain the normal vectors of each mesh of at least one three-dimensional model.
[0075] The following example illustrates the process of obtaining the curvature of the first mesh in a 3D model, where the first mesh is any mesh in the 3D model.
[0076] In some embodiments, for a first mesh in at least one three-dimensional model, the normal vector of the first mesh is obtained based on the position vectors of each vertex of the first mesh.
[0077] In some embodiments, the first grid includes 3 vertices. The position vector of the first vertex of the first grid is subtracted from the position vector of the second vertex of the first grid to obtain a first intermediate vector. The position vector of the first vertex of the first grid is subtracted from the position vector of the first vertex of the first grid to obtain a second intermediate vector. The cross product of the first intermediate vector and the second intermediate vector is divided by the norm of the cross product of the first intermediate vector and the second intermediate vector to obtain the normal vector of the first grid.
[0078] In some embodiments, the normal vector of the first mesh is obtained using the following formula:
[0079]
[0080] Where V1, V2, and V3 are the position vectors of the three vertices of the first grid, and n is the normal vector of the first grid.
[0081] (2) Based on the normal vectors of each mesh of at least one three-dimensional model, obtain the curvature of each mesh of at least one three-dimensional model.
[0082] In some embodiments, the curvature of the first grid is obtained based on the normal vector of the first grid and the magnitude of the gradient of the normal vector of the first grid.
[0083] In some embodiments, the curvature of the first grid is obtained by dividing the magnitude of the gradient of the normal vector of the first grid by the norm of the normal vector of the first grid.
[0084] In some embodiments, the curvature of the first grid is obtained using the following formula:
[0085]
[0086] in, This refers to the magnitude of the gradient of the normal vector of the first mesh. The magnitude of the gradient of the normal vector of the first mesh is used to reflect the degree of change of the normal vector of the 3D model surface at the first mesh.
[0087] In some embodiments, the gradient of the normal vector of the first grid is obtained based on the normal vectors of the adjacent grids of the first grid. The adjacent grids of the first grid share the same edges as the first grid. In some embodiments, the normal vector of the first grid is subtracted from the normal vector of the adjacent grids of the first grid to obtain a difference vector, and the magnitude of this difference vector is determined as the magnitude of the gradient of the normal vector of the first grid. In some embodiments, the first grid has at least two adjacent grids, and the magnitude of the largest difference vector among the magnitudes of the difference vectors corresponding to the at least two adjacent grids is determined as the magnitude of the gradient of the normal vector of the first grid.
[0088] 2. Based on the curvature of each mesh, divide at least one type of region from the surface of at least one 3D model into G-type regions.
[0089] In some embodiments, meshes with curvature greater than or equal to a first curvature threshold are identified as meshes of the first type of region within the G-type region, in order to delineate the first type of region from the surface of at least one 3D model. That is, the first type of region can be a region on the surface of at least one 3D model with large curvature and complex geometry.
[0090] In some embodiments, meshes with curvature less than a second curvature threshold are identified as meshes of the second type of region within the G-type region, in order to delineate the second type of region from the surface of at least one 3D model. That is, the second type of region can be a region with smaller curvature and smoother surface on at least one 3D model.
[0091] In some embodiments, grids with curvature less than a first curvature threshold and greater than or equal to a second curvature threshold are defined as grids in transitional regions within the G-type region. The first curvature threshold is greater than the second curvature threshold.
[0092] The first curvature threshold and the second curvature threshold mentioned above can be set by the technician as needed. The technician can also set more or fewer curvature thresholds to divide more or fewer regions from the surface of the three-dimensional model according to the curvature. This application does not limit this.
[0093] In the above embodiment, the curvature of the mesh is used as the basis for dividing the region, so as to accurately identify at least one region with complex geometric structure and frequent structural changes (human face region) and relatively smooth region with less structural changes (such as background, ground, etc.) on the surface of the three-dimensional model. Thus, from the perspective of model structure, it is possible to distinguish regions with different importance on the surface of at least one three-dimensional model.
[0094] In some embodiments, step 412 above includes at least one of the following steps:
[0095] 1. Divide the surface of at least one 3D model into at least two unit regions.
[0096] In some embodiments, the surface of at least one three-dimensional model is divided into at least two unit regions with the same area.
[0097] In some embodiments, the surface of at least one three-dimensional model is divided into at least two unit regions having the same number of grids.
[0098] 2. Obtain the first texture map for each of at least two unit regions from the texture data of at least one 3D model.
[0099] In some embodiments, the texture data of at least one three-dimensional model includes at least one texture image, the at least one texture image being used to provide the texture of at least one three-dimensional model, and first texture maps of at least two unit regions being obtained from the at least one texture image.
[0100] 3. Based on the first texture map of each of the at least two unit regions, determine the evaluation index for each of the at least two unit regions.
[0101] Evaluation metrics per unit area include at least one of the following: texture smoothness per unit area, texture energy per unit area, and texture contrast per unit area.
[0102] In some embodiments, based on a first texture map of a unit region, the variance of the pixel values of the first texture map of the unit region is determined, and this variance is used to reflect the smoothness of the texture of the unit region. This variance is negatively correlated with the smoothness of the texture of the unit region.
[0103] Right now, Where, σ 2Let U be the variance of the pixel values of the first texture map in a unit region, where U is the number of pixels in the first texture map of that unit region, and U is an integer greater than 1. a Let a be the pixel value of the a-th pixel in the first texture map of this unit region. This refers to the average pixel value of the first texture map for this unit area. Pixel values are used to reflect the color, brightness, grayscale, etc. of a pixel, but this application does not limit this aspect.
[0104] In some embodiments, the energy of a unit region is determined based on the gray level co-occurrence matrix (GLCM) of the first texture map of the unit region.
[0105] The gray-level co-occurrence matrix (GLCM) is used to reflect the characteristics of the gray-level values of pixels in a first texture map of a unit region. For a first texture map of a certain unit region, the element (x, y) in the x-th row and y-th column of the GLCM is used to reflect the probability that the pixel value is y at a set relative position (the set relative position is set by the technician as needed, such as the pixel to the right of the pixel with gray-level value x) in the first texture map.
[0106] The gray-level co-occurrence matrix of the first texture map for a unit region is obtained based on the gray-level values of each pixel in the first texture map of the unit region. For example, for the first texture map of a certain unit region, if there are z pixels with a pixel value of x in the first texture map, and the pixel values of the adjacent pixels to the right of these z pixels are all y, then the value at (x, y) in the gray-level co-occurrence matrix of the first texture map is z, where x, y, and z are all 0 or positive integers.
[0107] In some embodiments, the energy of the texture of a unit region is determined based on the values of each element in the gray-level co-occurrence matrix of that unit region.
[0108] In some embodiments, the energy of the texture of a unit region is obtained by summing the squares of the values of each element in the gray-level co-occurrence matrix of the unit region.
[0109] In some embodiments, the energy of the texture per unit area is determined by the following formula:
[0110]
[0111] Where P(x,y) is the value at (x,y) in the gray-level co-occurrence matrix of the first texture map of the unit region. The above energy is used to reflect the uniformity of gray level within the unit region (this energy is positively correlated with the uniformity of gray level; if the energy is small, the gray level within the unit region is not uniform and the texture is relatively fine; if the energy is large, it reflects that the texture of the unit region is more uniform and regular).
[0112] In some embodiments, the contrast of a unit region is determined based on the gray-level co-occurrence matrix of a first texture map of that unit region.
[0113] In some embodiments, for each element in the gray-level co-occurrence matrix, the contrast value of the element is obtained by multiplying the square of the difference between the horizontal and vertical coordinates of the element in the gray-level co-occurrence matrix by the value of the element. The contrast values of all elements in the gray-level co-occurrence matrix are added together to obtain the contrast of the texture of a unit area.
[0114] In some embodiments, the contrast of the texture per unit area is determined by the following formula:
[0115]
[0116] Among them, (xy) 2 P(x,y) is the contrast value at (x,y) in the gray-level co-occurrence matrix of the first texture map of this unit region.
[0117] 4. Based on the evaluation indicators of at least two unit regions, divide at least one type of region from the surface of at least one three-dimensional model into G-type regions.
[0118] In some embodiments, index values for at least two unit regions are determined based on their respective evaluation metrics. The index values of the unit regions are used to reflect the texture characteristics of the unit regions.
[0119] In some embodiments, a unit region whose index value is greater than or equal to a first index threshold is determined as a unit region belonging to the first type of region in the G type region, so as to divide the first type of region from the surface of at least one three-dimensional model.
[0120] In some embodiments, unit regions with index values less than a second index threshold are identified as unit regions belonging to the second type of region in the G type region, so as to divide the second type of region from the surface of at least one three-dimensional model.
[0121] In some embodiments, unit regions with index values less than a first index threshold and greater than or equal to a second index threshold are defined as unit regions belonging to the transitional category of the G-type regions, so as to delineate transitional category regions from the surface of at least one 3D model. The first index threshold is greater than the second index threshold.
[0122] In some embodiments, the index value per unit area is the variance of the pixel values of the first texture map of the unit area (which reflects the smoothness in the evaluation index). Accordingly, the first type of area is an area on the surface of at least one 3D model where the pixel values vary greatly, and the second type of area is an area on the surface of at least one 3D model where the pixel values vary gently and are relatively smooth.
[0123] In some embodiments, the index value per unit area is negatively correlated with the energy of the texture per unit area (e.g., the negative value or reciprocal value of the energy). Accordingly, the first type of area is the area on the surface of at least one 3D model with low texture energy and relatively fine texture, and the second type of area is the area on the surface of at least one 3D model with high texture energy and relatively uniform texture.
[0124] In some embodiments, the index value of a unit region is the contrast of the texture of the unit region. Accordingly, the first type of region is a region on the surface of at least one 3D model with high texture contrast and relatively clear texture, and the second type of region is a region on the surface of at least one 3D model with low texture contrast and relatively blurry texture.
[0125] In some embodiments, the variance of the pixel values of the first texture map of the unit region, the energy of the texture of the unit region, and the contrast of the texture of the unit region are weighted and summed to obtain the index value.
[0126] The first and second index thresholds mentioned above can be set by technicians as needed. Technicians can also set more or fewer index thresholds to divide more or fewer regions from the surface of the 3D model based on the texture data. This application does not limit this.
[0127] In the above embodiments, evaluation metrics per unit area are used as the basis for dividing the area. These metrics include texture characteristics such as smoothness, energy, and contrast. This allows for the accurate identification of at least one area on the surface of a 3D model that uses a more complex and detailed texture, as well as areas with a relatively simple texture. Thus, from the perspective of model texture, it is possible to distinguish regions with different importance on the surface of at least one 3D model.
[0128] In some embodiments, the texture data includes at least one texture image. The at least one texture image is used to render at least one 3D model.
[0129] In some embodiments, step 412 above includes at least one of the following steps:
[0130] 1. For a first texture image in at least one texture image, determine the category of each pixel in the first texture image based on the magnitude of the gradient at each pixel in the first texture image, and the category of each pixel corresponds to a region of type G.
[0131] The first texture image is any texture image among at least one texture image. Here, the classification of pixels in the first texture image is only used as an example for illustration. Among at least one texture image, other texture images besides the first texture image can all adopt the pixel classification method of the first texture image.
[0132] It should be noted that, in the embodiments of this application, the gradient at a pixel in the texture image refers to the gradient of the pixel value of each pixel in the texture image at that pixel.
[0133] In some embodiments, the first texture image is convolved with a Sobel operator in a first direction and a Sobel operator in a second direction to obtain the magnitude of the gradient of a pixel in the first image in the first direction and the magnitude of the gradient in the second direction. The square root of the sum of the squares of the magnitudes of the gradients of the pixel in the first direction and the squares of the magnitudes of the gradients in the second direction is then taken to obtain the magnitude of the gradient of the pixel. The first direction and the second direction are two mutually perpendicular directions.
[0134] In some embodiments, the magnitude of the gradient at pixel (x,y) in the first texture image is calculated using the following formula: G x =I*S x G y =I*S y , in, S is the magnitude of the gradient at (x,y). x and S y It is the Sobel operator, I is the first texture image, G x G is the magnitude of the gradient of a pixel in the first image in the first direction. y It is the magnitude of the gradient of a pixel in the first image in the second direction.
[0135] In some embodiments, pixels whose gradient magnitude is greater than or equal to a first gradient threshold are defined as first-class pixels, and second-class pixels correspond to second-class regions.
[0136] In some embodiments, pixels whose gradient magnitude is less than a second gradient threshold are identified as second-class pixels, and the second-class pixels correspond to the second-class regions.
[0137] In some embodiments, pixels whose gradient magnitude is less than a first gradient threshold and greater than or equal to a second gradient threshold are identified as transitional pixels. Transitional pixels correspond to transitional regions.
[0138] 2. Based on the category of each pixel in at least one texture image, divide at least one type of region from the surface of at least one three-dimensional model into regions of type G.
[0139] In some embodiments, the mapping area of the first type of pixels on the surface of at least one 3D model is divided into a first type of region. That is, the first type of region is the region on the surface of at least one 3D model where the pixel value of the texture changes significantly and the texture changes frequently.
[0140] In some embodiments, the mapping area of the second type of pixels on the surface of at least one 3D model is divided into a second type of region. That is, the second type of region is the region on the surface of at least one 3D model where the pixel value of the texture changes little and the texture changes less.
[0141] In some embodiments, the mapping area of transitional pixels on the surface of at least one 3D model is divided into transitional regions.
[0142] The first and second gradient thresholds mentioned above can be set by the technician as needed. The technician can also set more or fewer gradient thresholds to divide more or fewer regions from the surface of the three-dimensional model according to the magnitude of the gradient of the pixels in the texture image. This application does not limit this.
[0143] In the above embodiment, the gradient magnitude of pixels in the texture image is used as the basis for region division. This enables the accurate identification of regions with frequent and complex texture changes, as well as regions with relatively uniform and simple textures, on at least one 3D model surface. Thus, from the perspective of model texture, regions with different importance on at least one 3D model surface can be distinguished.
[0144] In some embodiments, the objects marked by the tagging information include at least one of the following: a region of the surface of at least one three-dimensional model, the center of view displaying at least one three-dimensional model, and a virtual camera in three-dimensional space.
[0145] In some embodiments, step 412 above includes: identifying a region on the surface of at least one 3D model marked with the tagging information as a type of region within a G-class region. Exemplarily, the region marked with the tagging information is an area determined by a technician to be highlighted, such as the facial area of a virtual character. Exemplarily, at least one 3D model is displayed by a game application, and the region marked with the tagging information is an area on an important character in the game, an important object frequently interacted with by the player, etc.
[0146] In some embodiments, the area of the surface of at least one three-dimensional model marked with the marking information is determined as a first type of region in the G-type region.
[0147] In some embodiments, step 412 includes: dividing at least one type of region from the surface of at least one three-dimensional model into regions of type G based on the position of the field of view center in three-dimensional space.
[0148] Please refer to Figure 6 This diagram illustrates the imaging principle in three-dimensional space according to an embodiment of this application. In three-dimensional space, at least one three-dimensional model is projected onto an imaging plane 61, and the image on the imaging plane 61 is the actual image displayed by the at least one three-dimensional model. The imaging plane 61 is located between the optical center 62 of the virtual camera in three-dimensional space and the at least one three-dimensional model.
[0149] In some embodiments, the center of the field of view of at least one 3D model is marked on the imaging plane; that is, the center of the field of view can be considered as a point on the imaging plane. The marking information includes the coordinates of the center of the field of view on the imaging plane. In some embodiments, the imaging region projected onto the imaging plane from the at least one 3D model is classified based on the coordinates of the center of the field of view on the imaging plane to delineate at least one type of region from the surface of the at least one 3D model within a G-class region.
[0150] In some embodiments, for an imaging point in the imaging region, a center discrimination value for the imaging point is determined based on the coordinates of the center of the field of view on the imaging plane and the coordinates of the imaging point in the imaging plane. The center discrimination value of the imaging point is used to reflect the distance between the imaging point and the center of the field of view. In some embodiments, the magnitude of the center discrimination value of the imaging point is negatively correlated with the distance between the imaging point and the center of the field of view.
[0151] In some embodiments, the Gaussian function with the coordinates of the center of the field of view as the center coordinates is calculated at the imaging point to obtain the center discrimination value of the imaging point.
[0152] In some embodiments, the center discriminant value is determined using the following formula:
[0153]
[0154] Where H(u,v) is the center discrimination value of the imaging point with coordinates (u,v) on the imaging plane, (u c ,v c ) is the coordinate of the center of the field of view on the imaging plane, and σ is an adjustable parameter.
[0155] In some embodiments, an imaging region in which the center discrimination value of each imaging point is greater than or equal to a first center threshold is defined as a first type of imaging region, and the region corresponding to the first type of imaging region on the surface of at least one 3D model is divided into the first type of region in the G-type region. That is, the first type of region is the area near the center of the field of view on the surface of at least one 3D model. For example, at least one 3D model is displayed by a game application, and since the first type of region is close to the center of the field of view, it is an area that receives high attention from the player.
[0156] In some embodiments, an imaging region in which the center discrimination value of each imaging point is less than a second center threshold is defined as a second type of imaging region, and the region corresponding to the second type of imaging region on the surface of at least one 3D model is classified as a second type of region within a G-type region. That is, the second type of region is the region on the surface of at least one 3D model that is far from the center of the field of view. For example, at least one 3D model is displayed by a game application, and since the first type of region is far from the center of the field of view, it is an area with low player attention.
[0157] In some embodiments, an imaging region in which the center discrimination value of each imaging point is greater than or equal to a second center threshold and less than a first center threshold is defined as a transitional imaging region. The region corresponding to the transitional imaging region on the surface of at least one 3D model is classified as a transitional region within a G-class region. For example, at least one 3D model is displayed by a game application, and the transitional region is the region at the edge of the player's field of view.
[0158] The first and second center thresholds mentioned above can be set by technicians as needed. Technicians can also set more or fewer center thresholds to divide more or fewer areas from the surface of the three-dimensional model according to the position of the center of the field of view. This application does not limit this.
[0159] In some embodiments, step 412 includes: dividing at least one type of region from the surface of at least one three-dimensional model into regions of type G based on the position of the virtual camera in three-dimensional space.
[0160] A virtual camera can also be viewed as a point in three-dimensional space. In some embodiments, the marking information includes the coordinates of the virtual camera in three-dimensional space.
[0161] In some embodiments, a first type of region is defined as the area on the surface of at least one 3D model where the distance between each point and the virtual camera is less than a first distance threshold. That is, the first type of region is the area on the surface of at least one 3D model that is relatively close to the virtual camera. For example, at least one 3D model is displayed by a game application, and the virtual camera moves with the player-controlled character; the first type of region is the area close to the player-controlled character.
[0162] In some embodiments, a second type of region is defined as the area on the surface of at least one 3D model where the distance between each point and the virtual camera is greater than or equal to a second distance threshold. That is, the second type of region is the area on the surface of at least one 3D model that is relatively far from the virtual camera. For example, at least one 3D model is displayed by a game application, and the virtual camera moves with the player-controlled character; the second type of region is the area far from the player-controlled character, such as the background scenery in a game.
[0163] In some embodiments, regions on the surface of at least one 3D model where the distance between each point and the virtual camera is greater than or equal to a first distance threshold and less than a second distance threshold are classified as transitional regions.
[0164] The first and second distance thresholds mentioned above can be set by the technicians as needed. The technicians can also set more or fewer distance thresholds to divide more or fewer areas from the surface of the three-dimensional model according to the position of the virtual camera. This application does not limit this.
[0165] In the above embodiment, marking information is used as the basis for region division. The objects marked by the marking information include: the surface area of at least one 3D model, the center of view displaying at least one 3D model, and a virtual camera in 3D space. The logic for displaying at least one 3D model is considered. This allows for dynamic region division and resolution adjustment during the display of at least one 3D model. For example, if at least one 3D model is displayed by a game application, the position and center of view of the virtual camera will change as the player controls the character to move, and the division of the G-type region will also change. This allows for increasing the texture resolution when the player approaches a scene or object and decreasing the texture resolution when the player moves away from a scene or object. For example, please refer to... Figure 7 This illustration shows a schematic diagram of texture changes in a three-dimensional model provided in one embodiment of this application. In this example, the position of the virtual camera or the center of view in three-dimensional space changes as the virtual character 70 controlled by the player moves. Therefore, if the technical solution provided in this embodiment of the application is used to perform region division and rendering, when the virtual character 70 approaches the three-dimensional model 71 in three-dimensional space, the resolution of the texture on the surface of the three-dimensional model 71 will increase, and when the virtual character 70 moves away from the three-dimensional model 71 in three-dimensional space, the resolution of the texture on the surface of the three-dimensional model 71 will decrease.
[0166] It should be noted that the various methods for classifying the surface regions of a 3D model described above can be used individually or in any combination. For example, based on the curvature of the mesh, all G-class regions can be directly divided (such as first-class regions, second-class regions, and transitional regions). Another example is to first classify a type of region (such as the first-class region) within the G-class regions based on labeling information, and then classify other regions on the surface of the 3D model based on other reference information (other regions may also contain areas classified as first-class regions).
[0167] Sub-step 414: Based on the position of the G-class region on the surface of at least one 3D model, determine N regions.
[0168] In some embodiments, sub-step 414 includes: for each type of region in the G-class region, if the region of that type is connected on the surface of at least one 3D model, then the region of that type is identified as one of the N regions; if the region of that type includes at least two regions that are not connected to each other on the surface of at least one 3D model, then the aforementioned at least two regions that are not connected to each other on the surface of at least one 3D model are identified as at least two regions in the N regions.
[0169] For example, please refer to Figure 8 This diagram illustrates a region division of a three-dimensional model provided in one embodiment of this application. The surface of the three-dimensional model 80 is divided into a type a region 81 and a type b region 82. Since the type a region 81 is connected on the surface of the three-dimensional model 80, it can be directly identified as one of the N regions. Since the type b region 82 includes two non-connected regions on the surface of the three-dimensional model 80, these two non-connected regions can be identified as two regions of the N regions. Finally, the surface of the three-dimensional model 80 is divided into 3 regions, i.e., N equals 3.
[0170] Additionally, it should be noted that in the embodiments of this application, the surface regions of different three-dimensional models are not connected. A certain type of region in the G-type region can be distributed on the surface of different three-dimensional models in at least two three-dimensional models, while a certain region in the N-type regions will not be distributed on the surface of different three-dimensional models.
[0171] Step 420: Obtain the first texture map for each of the N regions, resulting in N first texture maps.
[0172] N first texture maps are used to provide textures for N regions.
[0173] In some embodiments, a texture image is obtained for at least one 3D model, and the texture image of the 3D model is used to provide the texture of the 3D model. In the embodiments of this application, the texture image of the 3D model may be drawn by a technician or exported from the target application, and this application does not limit this.
[0174] In some embodiments, step 420 includes: for each of the N regions, obtaining the first texture map of that region from the corresponding texture image, thereby obtaining N first texture maps, wherein the texture image corresponding to the region refers to the texture image of the three-dimensional model in which the region is located.
[0175] In some embodiments, for each of the N regions, the mapping region of that region on the corresponding texture image is determined as the first texture map of that region.
[0176] In some embodiments, each vertex of the 3D model, in addition to its coordinates in 3D space, also has texture coordinates in a texture image of the 3D model. These texture coordinates indicate the mapped position of the vertex in the texture image and are preset by a technician. For one of N regions, the mapped region in the corresponding texture image can be determined based on the texture coordinates of the vertices of the meshes that overlap with that region. For example, please refer to... Figure 9 For a mesh 90 in a 3D model, it has three vertices A, B, and C with texture coordinates A(u1, v1), B(u2, v2), and C(u3, v3), respectively. The texture coordinates of any point on mesh 90, such as point D, are obtained by a linear combination of the texture coordinates of A, B, and C. For example, this can be achieved using the following formula: (u4, v4) = γ1(u1, v1) + γ2(u2, v2) + γ3(u3, v3), where (u4, v4) are the texture coordinates of point D, γ1 is the ratio of the area of triangle BCD to the area of mesh 90, γ2 is the ratio of the area of triangle ACD to the area of mesh 90, and γ3 is the ratio of the area of triangle ABD to the area of mesh 90. Therefore, knowing the texture coordinates of the vertices of the meshes that overlap with the region, the texture coordinates of any point in the region can be determined, thus mapping the entire region onto the corresponding texture image to obtain the mapped region (the first texture map).
[0177] Step 430: Adjust the resolution of each of the N first texture maps according to the corresponding adjustment strategy to obtain N second texture maps.
[0178] Among N first texture maps, at least two first texture maps correspond to different adjustment strategies, and among N second texture maps, at least two have different resolutions. Having at least two different resolutions among N second texture maps means that at least two of the N second texture maps have different resolutions.
[0179] In some embodiments, among the N first texture maps, the first texture maps belonging to different classes correspond to different adjustment strategies.
[0180] In some embodiments, step 430 includes: increasing the resolution of a first texture map in a first region to obtain a second texture map in the first region; increasing the resolution of a first texture map in a second region to obtain a second texture map in the second region; and decreasing the resolution of a first texture map in a transition region to obtain a second texture map in the transition region. The strategies for increasing the resolution of the first texture map in the first region and the strategies for increasing the resolution of the first texture map in the second region are different. The first region is a region belonging to a first type of region among N regions; there can be one or at least two first regions. The second region is a region belonging to a second type of region among N regions; there can be one or at least two second regions. The transition region is a region belonging to a transition type of region among N regions; there can be one or at least two transition regions.
[0181] The above adjustment strategy can be formulated by technicians as needed. For example, the resolution of the first texture map in the second region can also be reduced in step 430. This application does not limit this.
[0182] Step 440: Apply N second texture maps to render at least one 3D model.
[0183] In some embodiments, step 430 includes: using N second texture maps to render N regions of the surface of at least one three-dimensional model in a one-to-one correspondence, thereby rendering at least one three-dimensional model.
[0184] It should be noted that in the embodiments of this application, the N regions, N first texture maps, and N second texture maps are in one-to-one correspondence (one region corresponds to one first texture map and one second texture map). When rendering at least one 3D model using N second texture maps, the texture map corresponding to the region will be used to render that region. Regardless of whether there is one or at least two 3D models, the second texture map of one region will not be used to render another region. For example, if there is one 3D model, and the 3D model is divided into 3 regions, 3 second texture maps will be used. Figure 1These three regions are rendered in a one-to-one correspondence to create the 3D model. For example, if there are two 3D models, the first is divided into two regions, and the second into three regions, resulting in a total of five regions (five regions in total), then five second texture maps will be used. Figure 1 Render these 5 regions in a one-to-one correspondence.
[0185] In some embodiments, step 430 includes: mapping N second texture maps to corresponding regions of N regions to render at least one 3D model. For example, mapping a second texture map of a first region to a first region, mapping a second texture map of a second region to a second region, and mapping a second texture map of a transition region to a transition region to render at least one 3D model.
[0186] The technical solution provided in this application adjusts the resolution of texture maps (first texture maps) for N regions on the surface of at least one 3D model using corresponding adjustment strategies. Since at least two regions among the N regions correspond to different adjustment strategies, the above method can regionally adjust the texture maps for at least one 3D model. After adjustment, the texture maps (second texture maps) of each of the N regions have at least two different resolutions. That is, some regions on the surface of at least one 3D model use higher-resolution texture maps to optimize the display effect of the 3D model, while other regions use relatively lower-resolution texture maps to reduce the computational cost of rendering the 3D model. Therefore, the above method achieves reasonable allocation of texture maps for at least one 3D model, optimizing the rendering effect of at least one 3D model while controlling the computational cost of rendering at least one 3D model.
[0187] After dividing the surface of at least one 3D model into N regions, in addition to adjusting the resolution, other methods can be used to optimize the display effect of the 3D model. For details, please refer to the examples below.
[0188] In some embodiments, prior to step 430, the rendering method for the above-described three-dimensional model further includes at least one of the following steps:
[0189] 1. Perform wavelet transform on the first texture map of the first region among the N first texture maps to decompose the first texture map of the first region into at least two components.
[0190] Wavelet transform is a transformation method that uses wavelet functions as basis functions to decompose an image.
[0191] The above steps can be represented by the following formula:
[0192]
[0193] Where I(x,y) represents the pixel values in the first texture map, c jk ψ jk (x,y) represents the components obtained from wavelet transform decomposition, ψ jk (x,y) is a wavelet function used as a basis function, c jk These are wavelet coefficients. In wavelet transform, different components have different frequencies.
[0194] In some embodiments, the first texture map of the first region is input into a high-pass filter and a low-pass filter respectively, and the high-pass filter outputs a first high-frequency component of at least two components, and the low-pass filter outputs a first low-frequency component of at least two components.
[0195] The first high-frequency component is the high-frequency component among at least two components. There can be one or at least two first high-frequency components. The first low-frequency component is the low-frequency component among at least two components. There can be one or at least two first low-frequency components.
[0196] 2. Adjust the first high-frequency component of at least two components to obtain the adjusted second high-frequency component.
[0197] In some embodiments, the wavelet coefficients of the first high-frequency component are increased to obtain the adjusted second high-frequency component. For example, c′ jk =c jk (1+αH(j,k)), where c′ jk It is the wavelet coefficient after the first high-frequency component is amplified, c jk It is the first high-frequency component c jk ψ jk Wavelet coefficients of (x, y), c′ jk ψ jk (x, y) represents the second high-frequency component, α is an adjustable parameter, and H(j, k) is related to the basis function ψ. jk The parameters corresponding to (x, y).
[0198] 3. Reconstruct the remaining components of at least two components, excluding the first high-frequency component, and the second high-frequency component into a first texture map of the first region.
[0199] In some embodiments, the remaining components other than the first high-frequency component and the second high-frequency component in at least two components are added together to reconstruct a first texture map of the first region.
[0200] In the above embodiment, the high-frequency components in the first texture map of the first region are enhanced by wavelet transform. Since the high-frequency components of the image can be used to reflect the areas in the image where the pixel values change drastically, the areas with more details such as edges and contours in the first texture map of the first region can achieve better performance after reconstruction.
[0201] In some embodiments, the rendering method for the above-described three-dimensional model further includes: determining the enhanced normal vectors of each mesh in the first type of region. The enhanced normal vectors of the mesh are used to determine the influence of light on the mesh during the rendering process.
[0202] In some embodiments, an enhanced normal vector of the mesh is obtained based on the mesh's normal vector, its high-frequency component, and its low-frequency component. In some embodiments, the high-frequency component of the mesh's normal vector is obtained by decomposing the normal vector along the direction where the curvature of the 3D model is greatest at that mesh location, and the low-frequency component is obtained by decomposing the normal vector along the direction where the curvature of the 3D model is least at that mesh location.
[0203] In some embodiments, for a certain mesh, the high-frequency component of the normal vector is subtracted from the low-frequency component to obtain the component difference vector, and the normal vector and the component difference vector of the mesh are weighted and summed to obtain the enhanced normal vector of the mesh.
[0204] In some embodiments, the enhanced normal vector of the mesh is determined by the following formula:
[0205] n′=n+k(n high -n low )
[0206] Where n is the mesh normal vector, n′ is the mesh augmentation normal vector, and n high It is a high-frequency component of n, n low is the low-frequency component of n, and k is an adjustable weighting parameter.
[0207] For example, please refer to Figure 10 The enhanced normal vector of the mesh is different from the normal vector of the mesh. After the enhanced normal vector is set on the mesh, the light will be reflected according to the enhanced normal vector. Therefore, the above method can optimize the lighting effect for the first type of region by setting the enhanced normal vector for the mesh in the first type of region without changing the mesh structure of at least one 3D model and without increasing the amount of computation, and improve the detail performance of the first type of region when displaying at least one 3D model.
[0208] In some embodiments, prior to step 430, at least one of the following steps is also included:
[0209] 1. Perform Laplacian pyramid decomposition on the first texture map of the second region among N first texture maps to obtain Gaussian pyramid and Laplacian pyramid.
[0210] Laplacian pyramid decomposition is a method of decomposing an image into an image pyramid, where different layers represent images of different scales. The image pyramid includes a Gaussian pyramid and a Laplacian pyramid. The Gaussian pyramid is obtained by downsampling the original image (the first texture map of the second region) layer by layer, while the Laplacian pyramid is based on the Gaussian pyramid.
[0211] Please refer to Figure 11 This illustration shows a schematic diagram of the decomposition and reconstruction of the Laplacian pyramid provided in one embodiment of this application. In the Gaussian pyramid, the top layer (the largest scale layer) is the first texture map of the second region, and the remaining layers are obtained by downsampling the top layer layer by layer. In the Laplacian pyramid, each layer is obtained by subtracting the upsampling result of the smaller scale layer from the larger scale layer of the two adjacent layers of the Gaussian pyramid.
[0212] 2. Adjust the image at at least one scale in the Laplace pyramid to obtain the adjusted Laplace pyramid.
[0213] In some embodiments, the pixel values of pixels in the image at at least one scale are changed to improve the contrast of the image at at least one scale, resulting in an adjusted Laplacian pyramid.
[0214] 3. Based on the adjusted Laplacian pyramid, the smallest image in the Gaussian pyramid is reconstructed as the first texture map of the second region.
[0215] In some embodiments, the Laplacian pyramid comprises images of T scales, decreasing sequentially from the 1st scale to the Tth scale, where T is an integer greater than 1. This step includes at least one of the following steps:
[0216] (1) Upsample the smallest image in the Gaussian pyramid to the Tth scale to obtain the upsampled image at the Tth scale. Add the upsampled image at the Tth scale to the adjusted image at the Tth scale in the Laplacian pyramid to obtain the reconstructed image at the Tth scale.
[0217] (2) Upsample the reconstructed image at scale (t+1) to scale (t) to obtain the upsampled image at scale (t). Add the upsampled image at scale (t) to the adjusted image at scale (t) of the Laplacian pyramid to obtain the reconstructed image at scale (t). t is a positive integer less than T. The reconstructed image at scale 1 is the first texture map of the reconstructed second region.
[0218] For example, please refer to Figure 11Upsampling is performed on the smallest image (G3) in the Gaussian pyramid, and the upsampled result is added to the image (T2) of the same scale in the adjusted Laplacian pyramid. Then, upsampling is performed on the added image (G02), and the upsampled result is added to the image (T1) of the same scale in the adjusted Laplacian pyramid. By repeating the above process, the smallest image in the Gaussian pyramid can be reconstructed as the first texture map of the second region.
[0219] In the above embodiment, applying Laplacian pyramid decomposition and reconstruction can enhance the texture details in the first texture map of the second region at different scales, thereby improving the detail and contrast of the first texture map of the second region even when the first texture map of the second region is relatively blurry and has low contrast.
[0220] In some embodiments, Gaussian filtering or bilateral filtering is performed on the boundary regions of the first texture maps of the second region among the N first texture maps.
[0221] The boundary region of the first texture map of the second region is used to provide the texture of the boundary of the second region. On the surface of at least one 3D model, the distance between points belonging to the boundary of the second region and the transitional region is less than or equal to a first threshold. The first threshold is set by a person skilled in the art as needed, and this application does not limit it.
[0222] Applying Gaussian filtering to the boundary region can be expressed by the following formula:
[0223]
[0224] Where (p, q) are the pixels in the boundary region Ω1 where Gaussian filtering needs to be performed, and I(p, q) is the pixel value of (p, q). GB1 (x, y) is the pixel value of (x, y) in the boundary region Ω1 after Gaussian filtering, and σ is the standard deviation of the Gaussian function used for Gaussian filtering.
[0225] Applying bilateral filtering to the boundary region can be expressed by the following formula:
[0226]
[0227] Among them, I BF1 (x, y) is the pixel value of (x, y) in the boundary region Ω1 after bilateral filtering, σ s σ is the standard deviation of the Gaussian function used in the spatial domain for bilateral filtering. r W1 is the standard deviation of the Gaussian function used in the pixel value domain for bilateral filtering, and W1 is the normalization parameter.
[0228] In the above embodiment, before adjusting the resolution of the first texture map of the second region, Gaussian filtering or bilateral filtering is performed on the boundary region of the first texture map of the second region, thereby improving the smoothness of the texture at the boundary of the second region and ensuring that the visual effect from the second region to the transition region can transition naturally.
[0229] Before increasing the resolution of the first texture map in the first or second region, the above steps adjust the first texture map. Since the number of pixels in the first texture map has not yet increased, this can be achieved with less computation.
[0230] In some embodiments, please refer to Figure 12 Step 430 above includes at least one of the following sub-steps 432 to 436. The execution order of sub-steps 432 to 436 can be arbitrarily adjusted, and this application does not limit it.
[0231] Sub-step 432: Input the first texture map of the first region into the first neural network from the N first texture maps, improve the resolution of the first texture map of the first region by the first neural network, and output the second texture map of the first region.
[0232] The above method improves the resolution of the first texture map of the first region based on the first neural network, and directly outputs the second texture map of the first region by the neural network. While optimizing the display effect of the first region, it ensures the real-time performance and efficiency of texture adjustment.
[0233] In some embodiments, please refer to Figure 13 The first neural network 130 includes a first extraction layer 131, a self-attention layer 132, and a first upsampling layer 133. Sub-step 432 includes at least one of the following steps:
[0234] 1. Input the first texture map of the first region into the first extraction layer, and the first extraction layer extracts the features of the first texture map of the first region through convolution operation.
[0235] In some embodiments, please refer to Figure 14 The first extraction layer 131 includes M residual blocks 140, where M is an integer greater than 1, and this step includes at least one of the following:
[0236] (1) Input the first texture map of the first region into the first residual block of M residual blocks, perform convolution on the first texture map of the first region by the first residual block to obtain the residual term of the first residual block, add the first texture map of the first region and the residual term of the first residual block to output the feature extracted by the first residual block.
[0237] It should be noted that, in the embodiments of this application, the texture map can be regarded as a matrix composed of pixel values, and the addition operation of the texture map and the residual term is a matrix addition operation.
[0238] (2) Input the features extracted from the (i-1)th residual block of the M residual blocks into the i-th residual block of the M residual block. Perform convolution on the features extracted from the (i-1)th residual block by the i-th residual block to obtain the residual term of the i-th residual block. Add the features extracted from the (i-1)th residual block and the residual term of the i-th residual block to output the features extracted from the i-th residual block. i is a positive integer less than or equal to M.
[0239] It should be noted that the operations performed by the i-th residual block to obtain the residual term may include other computational operations in addition to convolution operations.
[0240] For example, F i =F i-1 +σ(W i *F i-1 +b i ), where W i It is the convolution kernel that performs convolution on the i-th residual block, b i W is the convolution result of the i-th residual block. i *F i-1 The added bias term, σ, is the activation function for the i-th residual block to undergo non-sex processing, σ(W i *F i-1 +b i That is, the residual term of the i-th residual block, F i-1 F is the feature extracted from the (i-1)th residual block. i It is the feature extracted from the i-th residual block.
[0241] In the above embodiment, residual blocks are used in the first extraction layer to enhance information transmission and improve the performance of the first neural network. Specifically, the output of the residual block equals the input plus the features extracted by the residual block based on the input, thus avoiding the problem of gradient vanishing and insufficient learning ability in the first neural network during backpropagation due to the large number of layers.
[0242] 2. Input the features of the first texture map of the first region into the self-attention layer. The self-attention layer adjusts the features of the first texture map of the first region based on the self-attention mechanism and outputs the adjusted features of the first texture map of the first region.
[0243] For example, the adjusted features of the first texture map of the first region are obtained by the following formula:
[0244]
[0245] Where A is the adjusted feature of the first texture map of the first region, Q is the query matrix, K is the key matrix, and V is the value matrix. Q, K, and V can all be obtained by multiplying the features of the first texture map of the first region with the corresponding parameter matrix. k The dimension of the key matrix K is denoted by K, and softmax indicates normalization.
[0246] 3. Input the adjusted features of the first texture map of the first region into the first upsampling layer. The first upsampling layer upsamples the adjusted features of the first texture map of the first region and outputs the second texture map of the first region.
[0247] In some embodiments, the adjusted features of the first texture map of the first region are input into the first upsampling layer, and the first upsampling layer performs sub-pixel convolution on the adjusted features of the first texture map of the first region to output the second texture map of the first region.
[0248] Subpixel convolution is an upsampling operation that takes the feature values of the input data in at least two input channels and represents them on a feature map.
[0249] In some embodiments, the upsampling process of the first upsampling layer is represented by the following formula:
[0250] I HR1 =SubPixel(W up1 *A+b up1 )
[0251] Where SubPixel represents the subpixel convolution operation, W up1 The first upsampling layer uses a convolutional kernel, b up1 It is the bias term of the first upsampling layer, I HR1 It is the second texture map of the first region.
[0252] In the above embodiment, the first neural network improves the resolution of the first texture map based on features extracted from the first texture map of the first region. This allows the second texture map of the first region to retain more image information than the first texture map while preserving the original features of the first texture map, ensuring a clear and natural visual effect for the first region when displaying at least one 3D model. Furthermore, the first neural network can adjust the features of the first texture map of the first region based on a self-attention mechanism. The texture in the second texture map obtained from the adjusted features has higher detail, thus allowing the texture details of the first region to be displayed more fully.
[0253] In some embodiments, the training process of the first neural network is as follows:
[0254] 1. Input the first sample image into the first neural network, which improves the resolution of the first sample image and outputs the adjusted first sample image.
[0255] 2. Input the adjusted first sample image into the feature extraction network, and the feature extraction network outputs the features of the adjusted first sample image.
[0256] The feature extraction network can be any neural network with feature extraction capabilities, such as a convolutional neural network (CNN).
[0257] 3. Input the first reference image into the feature extraction network, and the feature extraction network outputs the features of the first reference image. The first reference image is used to provide a standard to which the first sample image is adjusted.
[0258] 4. Based on the features of the adjusted first sample image and the features of the first reference image, a first perceptual loss is obtained. The first perceptual loss is used to reflect the difference between the features of the adjusted first sample image and the features of the first reference image.
[0259] In some embodiments, the square of the norm of the difference between the features of the adjusted first sample image and the features of the first reference image is calculated to obtain the first perceptual loss.
[0260] In some embodiments, the first perceived loss Where R is the number of layers in the feature extraction network, φ l G(I1) represents the features extracted by the l-th layer of the feature extraction network, and G(I1) is the adjusted first sample image. ra1 This is the first reference image.
[0261] 5. Input the adjusted first sample image into the discriminator, and the discriminator outputs the first judgment result. The first judgment result is used to indicate the accuracy of the discriminator's prediction for the adjusted first image.
[0262] In some embodiments, the parameters of the discriminator are adjusted with the aim of minimizing the first judgment result.
[0263] 6. Based on the first discrimination result, the adversarial loss is obtained, and the adversarial loss is negatively correlated with the first discrimination result.
[0264] In some embodiments, the negative value of the logarithm of the first discrimination result is obtained to obtain the adversarial loss.
[0265] In some embodiments, combating loss Among them, D(G(I1)) is the first discrimination result.
[0266] 7. Adjust the parameters of the first neural network based on the first perceptual loss and the adversarial loss.
[0267] In some embodiments, the first perceptual loss and the adversarial loss are weighted and summed to obtain the total loss of the first neural network. The parameters of the first neural network are adjusted with the aim of minimizing the total loss of the first neural network. The total loss of the first neural network is used to reflect the performance of the first neural network.
[0268] That is, the total loss of the first neural network Where, λ preta Let λ be the weighting parameter for the first perceptual loss. ad Weighting parameters to counteract loss.
[0269] In the above embodiment, the first perceptual loss is obtained based on feature comparison and can directly reflect the difference in visual effect between the adjusted first sample image and the first reference image. This enables the first neural network to learn the ability to improve the resolution of the texture image and optimize its visual effect. The adversarial loss enables the first neural network to learn how to generate more natural and realistic texture maps, which is more suitable for the first type of region with relatively high importance (such as the region that game players pay more attention to).
[0270] Sub-step 434: Input the first texture map of the second region into the second neural network from the N first texture maps, improve the resolution of the first texture map of the second region by the second neural network, and output the second texture map of the second region.
[0271] The aforementioned method uses a second neural network to improve the resolution of the first texture map in the second region. The neural network directly outputs the second texture map for the second region, optimizing the display effect of the second region while ensuring the real-time performance and efficiency of texture adjustment. Furthermore, improving the resolution of the first texture map in the second region helps maintain visual consistency between the first and second regions, improving the overall image quality of at least one 3D model and avoiding overly blurry areas when displaying at least one 3D model.
[0272] In some embodiments, the second neural network includes a second extraction layer and a second upsampling layer. Substep 434 includes at least one of the following steps:
[0273] 1. Input the first texture map of the second region into the second extraction layer, and the second extraction layer extracts the features of the first texture map of the second region through convolution operation.
[0274] In some embodiments, the second extraction layer comprises S residual blocks, where S is an integer greater than 1, and the step includes at least one of the following:
[0275] (1) Input the first texture map of the second region into the first residual block of S residual blocks, perform convolution on the first texture map of the second region by the first residual block to obtain the residual term of the first residual block, add the first texture map of the second region and the residual term of the first residual block to output the feature extracted by the first residual block.
[0276] (2) Input the features extracted from the (s-1)th residual block of the S residual blocks into the s-th residual block of the S residual blocks. Perform convolution on the features extracted from the (s-1)th residual block by the s-th residual block to obtain the residual term of the s-th residual block. Add the features extracted from the (s-1)th residual block and the residual term of the s-th residual block to output the features extracted from the s-th residual block. s is a positive integer less than or equal to S.
[0277] It should be noted that the operations performed by the s-th residual block to obtain the residual term may include other operations besides convolution.
[0278] For example, F s =F s-1 +ReLU(BN(W s *ReLU(BN(W s’ *F s-1 +b s’ ))+b s ), where W s’ and W s The convolution kernel for the s-th residual block is b. s’ and b s It is the bias term added to the s-th residual block, BN represents the batch normalization operation, and ReLU is the activation function. ReLU(BN(W) s *ReLU(BN(W s’ *F s-1 +b s’ ))+b s That is, the residual term of the s-th residual block, F s-1 F is the feature extracted from the (s-1)th residual block. s It is the feature extracted from the s-th residual block.
[0279] 2. Input the features of the first texture map of the second region into the second upsampling layer, and the second upsampling layer upsamples the features of the first texture map of the second region to output the second texture map of the second region.
[0280] In some embodiments, the features of the first texture map of the second region are input into the second upsampling layer, and the second upsampling layer performs sub-pixel convolution on the features of the first texture map of the first region to output the second texture map of the second region.
[0281] In some embodiments, the upsampling process of the second upsampling layer is represented by the following formula:
[0282] I HR2 =SubPixel(W up2 *F S +b up2 )
[0283] Among them, W up2 The convolution kernel used in the second upsampling layer is b. up2 It is the bias term of the second upsampling layer, I HR2 It is the second texture map of the second region, F S It is a feature of the first texture map of the first type of region.
[0284] In some embodiments, the training process of the second neural network is as follows:
[0285] 1. Input the second sample image into the second neural network, which will improve the resolution of the second sample image and output the adjusted second sample image.
[0286] 2. Input the adjusted second sample image into the feature extraction network, and the feature extraction network outputs the features of the adjusted second sample image.
[0287] 3. Input the second reference image into the feature extraction network, and the feature extraction network outputs the features of the second reference image. The second reference image is used to provide a standard to which the second sample image is adjusted.
[0288] 4. Based on the features of the adjusted second sample image and the features of the second reference image, a second perceptual loss is obtained. The second perceptual loss is used to reflect the difference between the features of the adjusted second sample image and the features of the second reference image.
[0289] In some embodiments, the square of the norm of the difference between the features of the adjusted second sample image and the features of the second reference image is calculated to obtain the second perceptual loss.
[0290] In some embodiments, the second perceived loss Where R is the number of layers in the feature extraction network, φ l G(I2) represents the features extracted by the l-th layer of the feature extraction network, and G(I2) is the adjusted second sample image. ra2 This is the second reference image.
[0291] 5. Based on the adjusted second sample image and the second reference image, the pixel loss is obtained. The pixel loss is used to reflect the difference between the adjusted second sample image and the second reference image.
[0292] In some embodiments, the square of the norm of the difference between the adjusted second sample image and the second reference image is calculated to obtain the pixel loss.
[0293] In some embodiments, pixel loss
[0294] 6. Adjust the parameters of the second neural network based on the second perceptual loss and pixel loss.
[0295] In some embodiments, the second perceptual loss and the pixel loss are weighted and summed to obtain the total loss of the second neural network. The parameters of the second neural network are adjusted with the aim of minimizing the total loss of the second neural network. The total loss of the second neural network is used to reflect the performance of the second neural network.
[0296] That is, the total loss of the second neural network Where, λ prece Let λ be the weighting parameter for the second perceptual loss. pixel These are the weight parameters for pixel loss.
[0297] In the above embodiment, the second perceptual loss is obtained based on feature comparison and can directly reflect the difference in visual effect between the adjusted second sample image and the second reference image. This enables the second neural network to learn the ability to improve the resolution of the texture image and optimize its visual effect. The pixel loss enables the second neural network to learn how to generate a texture map that is closer to the reference standard (second reference image). It is more suitable for the second type of region with relatively low importance, such as the background region with less texture change.
[0298] Sub-step 436: For the N first texture maps, downsample the first texture map of the transition region to reduce the resolution of the first texture map of the transition region, and obtain the second texture map of the transition region.
[0299] Since the textures of the first type of region are usually more complex, while the textures of the second type of region are usually simpler, in the transition area connecting the first and second types of regions, appropriately reducing the resolution of the texture map can not only reduce the computational cost of rendering at least one 3D model, but also visually maintain the consistency and smoothness of the transition from the first type of region to the second type of region.
[0300] In some embodiments, interpolation is performed on a first texture map of the transition region to reduce the resolution of the first texture map of the transition region, resulting in a second texture map of the transition region. Interpolation refers to weighting the pixel values of the pixels in the first texture map of the transition region to the pixel values of the pixels in the second texture map of the transition region. In the embodiments of this application, the interpolation method used in the downsampling process can be bilinear interpolation, bicubic interpolation, etc., and this application is not limited to this.
[0301] In some embodiments, the transition region includes at least two transition sub-regions, and sub-step 436 includes: downsampling the first texture maps of the at least two transition sub-regions in different ways to obtain the second texture maps of the at least two transition sub-regions respectively. The second texture map of the transition region includes the second texture map of the at least two transition sub-regions respectively, and the resolution of the second texture map of the transition sub-region is negatively correlated with the distance between the transition sub-region and the first type of region.
[0302] For example, please refer to Figure 15 The transition region includes four transition sub-regions (D1, D2, D3, D4). D1 is the transition sub-region closest to the first type of region, and D4 is the transition sub-region closest to the second type of region. The resolution adjustment coefficient of D1 (the resolution of the second texture map is equal to the product of the resolution of the first texture map and the resolution adjustment coefficient) is a1, the resolution adjustment coefficient of D2 is a2, the resolution adjustment coefficient of D3 is a3, and the resolution adjustment coefficient of D4 is a4. Therefore, a1>a2>a3>a4. From D1 to D4, the resolution of the second texture map decreases sequentially.
[0303] In some embodiments, sub-step 436 includes: downsampling the first texture maps of at least two transition sub-regions a different number of times to obtain second texture maps for each of the at least two transition sub-regions. In some embodiments, the resolution reduction factor is the same for each downsampling; therefore, by controlling the number of downsampling operations, the second texture maps of the at least two transition sub-regions can be controlled to have different resolutions. For example, if the first texture map of a transition sub-region is downsampled k times, the resolution of its second texture map is [missing information - likely a percentage] of the resolution of the first texture map. The first texture map of another transition sub-region was downsampled k+1 times, and the resolution of its second texture map was [amount missing] times the resolution of the first texture map. k is a positive integer.
[0304] In the above embodiment, the transition region is divided into at least two transition sub-regions. The resolution of the first texture map is reduced in different ways in the at least two transition sub-regions. Furthermore, the resolution of the second texture map of the transition sub-region is negatively correlated with the distance between the transition sub-region and the first type of region, thereby visually achieving a gradual transition from the first type of region to the second type of region.
[0305] In some embodiments, after step 430, the method further includes: for a first pixel in the second texture map of the transition region, updating the pixel value of the first pixel based on the position of the first pixel mapped on at least one 3D model, the pixel value of the second pixel, and the pixel value of the third pixel.
[0306] The first pixel is any pixel in the second texture map of the transition region. Each pixel in the second texture map of the transition region can update its pixel value in the same way as the first pixel.
[0307] The second pixel is the pixel whose position on at least one 3D model in the second texture map of the region belonging to the first type of region (N regions) is closest to the position of the first pixel on at least one 3D model. The third pixel is the pixel whose position on at least one 3D model in the second texture map of the region belonging to the second type of region (N regions) is closest to the position of the first pixel on at least one 3D model.
[0308] In some embodiments, a fusion weight is determined based on the position of the first pixel mapped onto at least one 3D model (hereinafter referred to as the first mapping position). The pixel values of the second and third pixels are then weighted and summed using the fusion weight to update the pixel value of the first pixel. For example, the fusion weight is obtained by dividing the first position difference by the sum of the first and second position differences. The first position difference is the distance between the first mapping position and the first type of region, and the second position difference is the distance between the first mapping position and the second type of region.
[0309] In some embodiments, I blend =λ b ·I high +(1-λ b )·I low , among which, I blend It is the updated pixel value of the first pixel, I high It is the pixel value of the second pixel, I low It is the pixel value of the third pixel, λ b It is a fusion weight.
[0310] In the above embodiment, the pixel value of the texture of the transition region is obtained by fusing the pixel value of the texture of the first region and the pixel value of the texture of the second region, thereby achieving a natural transition from the first region to the second region.
[0311] In some embodiments, after step 430, the method further includes performing Gaussian filtering or bilateral filtering on the boundary region of the second texture map of the transition region.
[0312] The boundary region of the second texture map of the transition region is used to render the boundary of the second region. On the surface of at least one 3D model, the distance between the point belonging to the boundary of the transition region and the first or second type of region is less than or equal to a second threshold.
[0313] The second threshold shall be set by the technician as needed, and this application does not limit it.
[0314] Applying Gaussian filtering to the boundary region can be expressed by the following formula:
[0315]
[0316] Where (p, q) are the pixels in the boundary region Ω2 where Gaussian filtering needs to be performed, and I(p, q) is the pixel value of (p, q). GB2 (x, y) is the pixel value of (x, y) in the boundary region Ω2 after Gaussian filtering, and σ is the standard deviation of the Gaussian function used for Gaussian filtering.
[0317] Applying bilateral filtering to the boundary region can be expressed by the following formula:
[0318]
[0319] Among them, I BF2 (x, y) is the pixel value of (x, y) in the boundary region Ω2 after bilateral filtering, σ s σ is the standard deviation of the Gaussian function used in the spatial domain for bilateral filtering. r W1 is the standard deviation of the Gaussian function used in the pixel value domain for bilateral filtering, and W1 is the normalization parameter.
[0320] In the above embodiment, Gaussian filtering or bilateral filtering is performed on the boundary region of the second texture map of the transition region, thereby improving the smoothness of the texture at the boundary of the transition region and ensuring that the visual effect from the transition region to the first type region and the second type region can transition naturally.
[0321] After reducing the resolution of the first texture map in the transition region to obtain the second texture map, the above steps adjust the second texture map. Since the number of pixels in the second texture map is reduced, it can be implemented with less computation.
[0322] The technical solution provided in this application can be used for real-time replacement of textures on at least one 3D model during the operation of a target application, and can also be used to replace defective textures during the testing phase of a target application. Please refer to [link / reference]. Figure 16 It shows a schematic diagram of a texture replacement process provided in one embodiment of this application.
[0323] During the testing of a target application (such as a game application) by technicians, the original texture map of at least one 3D model can be exported, and the performance of the original texture map (such as the time to render at least one 3D model, rendering effect, etc.) can be recorded. Then, the technical solution provided in the embodiments of this application is applied to adjust the original texture map by region, and then the texture loading process is rerun (using the adjusted texture map to render at least one 3D model). The performance of the adjusted texture map (second texture map) is recorded. If the performance is optimized, the original texture map can be replaced with the adjusted texture map in the target application.
[0324] The following are embodiments of the apparatus of this application. For details not described in the apparatus embodiments of this application, please refer to the method embodiments above.
[0325] Please refer to Figure 17 This diagram illustrates a block diagram of a rendering apparatus for a three-dimensional model according to an embodiment of this application. The apparatus has the function of implementing the rendering method for the three-dimensional model described above. This function can be implemented in hardware or by hardware executing corresponding software. The apparatus 1700 can be a computer device or can be installed within a computer device. The apparatus 1700 may include: a partitioning module 1710, an acquisition module 1720, an adjustment module 1730, and a rendering module 1740.
[0326] The partitioning module 1710 is used to divide the surface of at least one three-dimensional model into N regions, where N is an integer greater than 1.
[0327] The acquisition module 1720 is used to obtain a first texture map for each of the N regions, resulting in N first texture maps, which are used to provide the textures for the N regions.
[0328] The adjustment module 1730 is used to adjust the resolution of the N first texture maps according to the corresponding adjustment strategy to obtain N second texture maps. Among the N first texture maps, at least two first texture maps correspond to different adjustment strategies, and the N second texture maps have at least two different resolutions.
[0329] The rendering module 1740 is used to apply the N second texture maps to render the at least one 3D model.
[0330] In some embodiments, the partitioning module 1710 is used to partition the surface of the at least one three-dimensional model into G-class regions based on reference information, where G is an integer less than or equal to N; and to determine the N regions based on the positions of the G-class regions on the surface of the at least one three-dimensional model; wherein the reference information includes at least one of the following: structural data of the at least one three-dimensional model, texture data of the at least one three-dimensional model, and marking information of objects in the three-dimensional space.
[0331] In some embodiments, the classification module 1710 is used to divide the surface of the at least one three-dimensional model into the G-class region based on reference information; wherein the reference information includes at least one of the following: structural data of the at least one three-dimensional model, texture data of the at least one three-dimensional model, and marking information of objects in the three-dimensional space.
[0332] In some embodiments, the classification module 1710 is used to obtain the curvature of each grid of the at least one three-dimensional model based on the structural data of the at least one three-dimensional model, the curvature of each grid being used to reflect the degree of bending of the at least one three-dimensional model at each grid; and to divide at least one type of region from the G-type regions from the surface of the at least one three-dimensional model based on the curvature of each grid.
[0333] In some embodiments, the classification module 1710 is configured to divide the surface of the at least one three-dimensional model into at least two unit regions; obtain a first texture map of each of the at least two unit regions from the texture data of the at least one three-dimensional model; determine an evaluation index for each of the at least two unit regions based on the first texture map of each of the at least two unit regions, wherein the evaluation index of the unit region includes at least one of the following: the smoothness of the texture of the unit region, the energy of the texture of the unit region, and the contrast of the texture of the unit region; and divide at least one type of region from the G-type regions from the surface of the at least one three-dimensional model based on the evaluation index of each of the at least two unit regions.
[0334] In some embodiments, the texture data includes at least one texture image; the classification module 1710 is configured to, for a first texture image in the at least one texture image, determine the category of each pixel in the first texture image based on the magnitude of the gradient at each pixel in the first texture image, wherein the category of each pixel corresponds to a region in the G-class region; and, based on the category of each pixel in the at least one texture image, divide at least one region in the G-class region from the surface of the at least one three-dimensional model.
[0335] In some embodiments, the objects marked by the marking information include at least one of the following: a region on the surface of the at least one three-dimensional model, a viewpoint center displaying the at least one three-dimensional model, and a virtual camera in the three-dimensional space; the classification module 1710 is used to determine the region on the surface of the at least one three-dimensional model marked by the marking information as a type of region in the G-class regions; to divide at least one type of region in the G-class regions from the surface of the at least one three-dimensional model based on the position of the viewpoint center in the three-dimensional space; and to divide at least one type of region in the G-class regions from the surface of the at least one three-dimensional model based on the position of the virtual camera in the three-dimensional space.
[0336] In some embodiments, the G-type region includes a first type region, a second type region, and a transitional type region. The transitional type region is used to connect the first type region and the second type region. The influence of the first type region on the display effect of the at least one 3D model is greater than the influence of the second type region on the display effect of the at least one 3D model.
[0337] In some embodiments, the device 1700 further includes a first adjustment module ( Figure 17 (Not shown in the image).
[0338] The first adjustment module is used to perform wavelet transform on the first texture map of the first region among the N first texture maps to decompose the first texture map of the first region into at least two components, wherein the first region is the region belonging to the first type of region among the N regions; and to reconstruct the remaining components of the at least two components, excluding the first high-frequency component, and the second high-frequency component into the first texture map of the first type of region.
[0339] In some embodiments, the first adjustment module is used to determine the enhancement normal vector of each mesh in the first type of region; wherein the enhancement normal vector of the mesh is used to determine the influence of light on the mesh during the rendering of the mesh.
[0340] In some embodiments, the device 1700 further includes a first super-resolution module ( Figure 17 (Not shown in the image).
[0341] The first super-resolution module inputs the first texture map of the first region from the N first texture maps into the first neural network, which improves the resolution of the first texture map of the first region and outputs the second texture map of the first region. The first region is the region belonging to the first type of region among the N regions.
[0342] In some embodiments, the first neural network includes: a first extraction layer, a self-attention layer, and a first upsampling layer;
[0343] The first super-resolution module is configured to input a first texture map of the first region into the first extraction layer, whereby the first extraction layer extracts features of the first texture map of the first region through convolution operations; input the features of the first texture map of the first region into the self-attention layer, whereby the self-attention layer adjusts the features of the first texture map of the first region based on a self-attention mechanism, and outputs the adjusted features of the first texture map of the first region; and input the adjusted features of the first texture map of the first region into the first upsampling layer, whereby the first upsampling layer upsamples the adjusted features of the first texture map of the first region, and outputs a second texture map of the first region.
[0344] In some embodiments, the first extraction layer includes M residual blocks, where M is an integer greater than 1;
[0345] The first super-resolution module is configured to input the first texture map of the first region into the first residual block of the M residual blocks, perform convolution on the first texture map of the first region by the first residual block to obtain the residual term of the first residual block, add the first texture map of the first region and the residual term of the first residual block to output the feature extracted by the first residual block; input the feature extracted by the (i-1)th residual block of the M residual blocks into the i-th residual block of the M residual blocks, perform convolution on the feature extracted by the (i-1)th residual block to obtain the residual term of the i-th residual block, add the feature extracted by the (i-1)th residual block and the residual term of the i-th residual block to output the feature extracted by the i-th residual block, where i is a positive integer less than or equal to M; when i equals M, the feature extracted by the i-th residual block is determined as the feature of the first texture map of the first region.
[0346] In some embodiments, the training process of the first neural network is as follows: A first sample image is input into the first neural network, which improves the resolution of the first sample image and outputs an adjusted first sample image; the adjusted first sample image is input into a feature extraction network, which outputs the features of the adjusted first sample image; a first reference image is input into the feature extraction network, which outputs the features of the first reference image, wherein the first reference image provides a standard to which the first sample image is adjusted; based on the features of the adjusted first sample image and the features of the first reference image, a first perceptual loss is obtained, which reflects the difference between the features of the adjusted first sample image and the features of the first reference image; the adjusted first sample image is input into a discriminator, which outputs a first judgment result, which indicates the realism of the discriminator's prediction for the adjusted first image; based on the first judgment result, an adversarial loss is obtained, which is negatively correlated with the first judgment result.
[0347] The parameters of the first neural network are adjusted based on the first perceptual loss and the adversarial loss.
[0348] In some embodiments, the device 1700 further includes a second adjustment module ( Figure 17 (Not shown in the image).
[0349] The second adjustment module is used to perform Laplacian pyramid decomposition on the first texture map of the second region among the N first texture maps to obtain a Gaussian pyramid and a Laplacian pyramid, wherein the second region is the region belonging to the second type of region among the N regions; adjust the image of at least one scale in the Laplacian pyramid to obtain the adjusted Laplacian pyramid; and reconstruct the first texture map of the second region based on the adjusted Laplacian pyramid, using the image of the smallest scale in the Gaussian pyramid.
[0350] In some embodiments, the second adjustment module is used to perform Gaussian filtering or bilateral filtering on the boundary region of the first texture map of the second region among the N first texture maps, wherein the second region is the region belonging to the second type of region among the N regions, and the boundary region of the first texture map of the second region is used to provide the texture of the boundary of the second region. On the surface of the at least one three-dimensional model, the distance between the point belonging to the boundary of the second region and the transition type region is less than or equal to a first threshold.
[0351] In some embodiments, the device 1700 further includes a second super-resolution module ( Figure 17 (Not shown in the image).
[0352] The second super-resolution module is used to input the first texture map of the second region from the N first texture maps into the second neural network, and the second neural network improves the resolution of the first texture map of the second region and outputs the second texture map of the second region. The second region is the region belonging to the second type of region among the N regions.
[0353] In some embodiments, the training process of the second neural network is as follows: A second sample image is input into the second neural network, which improves the resolution of the second sample image and outputs an adjusted second sample image; the adjusted second sample image is input into a feature extraction network, which outputs the features of the adjusted second sample image; a second reference image is input into the feature extraction network, which outputs the features of the second reference image, the second reference image serving as a standard to which the second sample image is adjusted; based on the features of the adjusted second sample image and the features of the second reference image, a second perceptual loss is obtained, the second perceptual loss reflecting the difference between the features of the adjusted second sample image and the features of the second reference image; based on the adjusted second sample image and the second reference image, a pixel loss is obtained, the pixel loss reflecting the difference between the adjusted second sample image and the second reference image; based on the second perceptual loss and the pixel loss, the parameters of the second neural network are adjusted.
[0354] In some embodiments, the device 1700 further includes a downsampling module ( Figure 17 (Not shown in the image).
[0355] The downsampling module is used to downsample the first texture map of the transition region among the N first texture maps to reduce the resolution of the first texture map of the transition region and obtain the second texture map of the transition region. The transition region is the region that belongs to the transition type region among the N regions.
[0356] In some embodiments, the transition region includes at least two transition sub-regions; a downsampling module is configured to downsample the first texture maps of the at least two transition sub-regions in different ways to obtain second texture maps of each of the at least two transition sub-regions, wherein the second texture map of the transition region includes the second texture map of each of the at least two transition sub-regions, and the resolution of the second texture map of the transition sub-region is negatively correlated with the distance between the transition sub-region and the first region.
[0357] In some embodiments, the device 1700 further includes a third adjustment module ( Figure 17 (Not shown in the image).
[0358] The third adjustment module is used to update the pixel value of a first pixel in the transition region of the N second texture maps, based on the position of the first pixel mapped on the at least one 3D model, the pixel value of the second pixel, and the pixel value of the third pixel; wherein, the transition region is a region belonging to the transition type region among the N regions, the second pixel is the pixel whose position mapped on the at least one 3D model in the second texture map of the region belonging to the first type region is closest to the position of the first pixel mapped on the at least one 3D model, and the third pixel is the pixel whose position mapped on the at least one 3D model in the second texture map of the region belonging to the second type region is closest to the position of the first pixel mapped on the at least one 3D model.
[0359] In some embodiments, the third adjustment module is used to perform Gaussian filtering or bilateral filtering on the boundary regions of the second texture maps of the transition regions in the N second texture maps; wherein, the transition region is a region belonging to the transition class region among the N regions, and the boundary region of the second texture map of the transition region is used to render the boundary of the second region, and on the surface of the at least one 3D model, the distance between the point belonging to the boundary of the transition region and the first class region or the second class region is less than or equal to a second threshold.
[0360] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0361] Please refer to Figure 18 The diagram illustrates a structural block diagram of a computer device provided in one embodiment of this application.
[0362] Typically, computer device 1800 includes a processor 1801 and a memory 1802.
[0363] Processor 1801 may include one or at least two processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1801 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1801 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1801 may integrate a GPU, which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1801 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0364] The memory 1802 may include one or at least two computer-readable storage media, which may be tangible and non-transitory. The memory 1802 may also include high-speed random access memory and non-volatile memory, such as one or at least two disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1802 stores a computer program that is loaded and executed by the processor 1801 to implement the rendering method of the three-dimensional model described above.
[0365] Those skilled in the art will understand that Figure 18 The structure shown does not constitute a limitation on the computer device 1800, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0366] In some embodiments, a computer-readable storage medium is also provided, wherein a computer program is stored therein, the computer program being loaded and executed by a processor to implement the above-described method for rendering the three-dimensional model.
[0367] Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0368] In some embodiments, a computer program product is also provided, the computer program product including a computer program stored in a computer-readable storage medium, and a processor reading from the computer-readable storage medium and executing the computer program to implement the above-described method for rendering the three-dimensional model.
[0369] It should be understood that "at least two" as mentioned herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.
[0370] The above are merely exemplary embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application shall be included within the protection scope of this application.
Claims
1. A method for rendering a three-dimensional model, characterized in that, The method includes: Divide the surface of at least one 3D model into N regions, where N is an integer greater than 1; For each of the N regions, a first texture map is obtained, resulting in N first texture maps, which are used to provide the texture for the N regions; For the N first texture maps, the resolution is adjusted according to the corresponding adjustment strategy to obtain N second texture maps. Among the N first texture maps, at least two first texture maps correspond to different adjustment strategies, and the N second texture maps have at least two different resolutions. The at least one 3D model is rendered by applying the N second texture maps.
2. The method according to claim 1, characterized in that, The step of dividing the surface of at least one three-dimensional model into N regions includes: Based on the reference information, the surface of the at least one three-dimensional model is divided into G types of regions, where G is an integer less than or equal to N; The N regions are determined based on the positions of the G-type regions on the surface of at least one three-dimensional model; The reference information includes at least one of the following: structural data of the at least one three-dimensional model, texture data of the at least one three-dimensional model, and marking information of objects in the three-dimensional space.
3. The method according to claim 2, characterized in that, The step of dividing the surface of the at least one 3D model into G-class regions based on reference information includes: Based on the structural data of the at least one three-dimensional model, the curvature of each mesh of the at least one three-dimensional model is obtained, and the curvature of each mesh is used to reflect the degree of bending of the at least one three-dimensional model at each mesh. Based on the curvature of each mesh, at least one type of region among the G-type regions is divided from the surface of the at least one 3D model.
4. The method according to claim 2 or 3, characterized in that, The step of dividing the surface of the at least one 3D model into G-class regions based on reference information includes: The surface of the at least one three-dimensional model is divided into at least two unit regions; Obtain the first texture map of each of the at least two unit regions from the texture data of the at least one 3D model; Based on the first texture map of each of the at least two unit regions, an evaluation index is determined for each of the at least two unit regions, wherein the evaluation index of the unit region includes at least one of the following: the smoothness of the texture of the unit region, the energy of the texture of the unit region, and the contrast of the texture of the unit region; Based on the evaluation indicators of the at least two unit regions, at least one type of region among the G-type regions is divided from the surface of the at least one three-dimensional model.
5. The method according to any one of claims 2 to 4, characterized in that, The texture data includes at least one texture image; The step of dividing the surface of the at least one 3D model into G-class regions based on reference information includes: For the first texture image in the at least one texture image, the category of each pixel in the first texture image is determined based on the magnitude of the gradient at each pixel in the first texture image, and the category of each pixel corresponds to a category of region in the G category region; Based on the category of each pixel in the at least one texture image, at least one type of region in the G-class regions is divided from the surface of the at least one three-dimensional model.
6. The method according to any one of claims 2 to 5, characterized in that, The objects marked by the tagging information include at least one of the following: a region of the surface of the at least one 3D model, the center of the field of view displaying the at least one 3D model, and a virtual camera in the 3D space; The division of the surface of the at least one 3D model into G-class regions based on reference information includes at least one of the following: The region on the surface of the at least one three-dimensional model marked by the marking information is identified as a type of region in the G-type region; Based on the position of the field of view center in the three-dimensional space, at least one type of region among the G-type regions is divided from the surface of the at least one three-dimensional model; Based on the position of the virtual camera in the three-dimensional space, at least one type of region among the G-type regions is divided from the surface of the at least one three-dimensional model.
7. The method according to any one of claims 2 to 6, characterized in that, The G-type region includes a first-type region, a second-type region, and a transitional region. The transitional region is used to connect the first-type region and the second-type region. The first-type region has a greater impact on the display effect of the at least one 3D model than the second-type region.
8. The method according to claim 7, characterized in that, Before adjusting the resolution of the N first texture maps according to the corresponding adjustment strategy to obtain N second texture maps, the process further includes: A wavelet transform is performed on the first texture map of the first region among the N first texture maps to decompose the first texture map of the first region into at least two components. The first region is the region that belongs to the first type of region among the N regions. Adjust the first high-frequency component of the at least two components to obtain the adjusted second high-frequency component; The remaining components of the at least two components, excluding the first high-frequency component, and the second high-frequency component are reconstructed into a first texture map of the first region.
9. The method according to claim 7 or 8, characterized in that, The method further includes: Determine the enhanced normal vectors of each grid in the first type of region; The enhanced normal vector of the mesh is used to determine the effect of light on the mesh during the rendering process.
10. The method according to any one of claims 7 to 9, characterized in that, The step of adjusting the resolution of the N first texture maps according to the corresponding adjustment strategy to obtain N second texture maps includes: The first texture map of the first region among the N first texture maps is input into the first neural network. The resolution of the first texture map of the first region is improved by the first neural network, and the second texture map of the first region is output. The first region is the region that belongs to the first type of region among the N regions.
11. The method according to claim 10, characterized in that, The first neural network includes: a first extraction layer, a self-attention layer, and a first upsampling layer; The step of inputting the first texture map of a first region from the N first texture maps into a first neural network, improving the resolution of the first texture map of the first region by the first neural network, and outputting the second texture map of the first region includes: The first texture map of the first region is input into the first extraction layer, and the first extraction layer extracts the features of the first texture map of the first region through a convolution operation. The features of the first texture map of the first region are input into the self-attention layer, and the self-attention layer adjusts the features of the first texture map of the first region based on the self-attention mechanism, and outputs the adjusted features of the first texture map of the first region. The adjusted features of the first texture map of the first region are input into the first upsampling layer, and the first upsampling layer upsamples the adjusted features of the first texture map of the first region to output the second texture map of the first region.
12. The method according to claim 11, characterized in that, The first extraction layer includes M residual blocks, where M is an integer greater than 1; The step of inputting the first texture map of the first region into the first extraction layer, and having the first extraction layer extract the features of the first texture map of the first region through a convolution operation, includes: The first texture map of the first region is input into the first residual block of the M residual blocks. The first residual block performs convolution on the first texture map of the first region to obtain the residual term of the first residual block. The first texture map of the first region and the residual term of the first residual block are added together to output the feature extracted by the first residual block. The features extracted from the (i-1)th residual block of the M residual blocks are input into the i-th residual block of the M residual block. The i-th residual block performs a convolution on the features extracted from the (i-1)th residual block to obtain the residual term of the i-th residual block. The features extracted from the (i-1)th residual block and the residual term of the i-th residual block are added together to output the features extracted from the i-th residual block. i is a positive integer less than or equal to M. When i equals M, the features extracted from the i-th residual block are determined as the features of the first texture map of the first region.
13. The method according to any one of claims 10 to 12, characterized in that, The training process of the first neural network is as follows: The first sample image is input into the first neural network, which improves the resolution of the first sample image and outputs the adjusted first sample image. The adjusted first sample image is input into a feature extraction network, and the feature extraction network outputs the features of the adjusted first sample image. The first reference image is input into the feature extraction network, and the feature extraction network outputs the features of the first reference image. The first reference image is used to provide a standard to which the first sample image is adjusted. Based on the features of the adjusted first sample image and the features of the first reference image, a first perceptual loss is obtained, which is used to reflect the difference between the features of the adjusted first sample image and the features of the first reference image. The adjusted first sample image is input into the discriminator, and the discriminator outputs a first judgment result. The first judgment result is used to indicate the realism of the discriminator's prediction for the adjusted first image. Based on the first discrimination result, the adversarial loss is obtained, and the adversarial loss is negatively correlated with the first discrimination result; The parameters of the first neural network are adjusted based on the first perceptual loss and the adversarial loss.
14. The method according to any one of claims 7 to 13, characterized in that, Before adjusting the resolution of the N first texture maps according to the corresponding adjustment strategy to obtain N second texture maps, at least one of the following is also included: For the N first texture maps, perform Laplacian pyramid decomposition on the first texture map of the second region to obtain a Gaussian pyramid and a Laplacian pyramid. The second region is the region belonging to the second type of region among the N regions. Adjust the image at least one scale in the Laplacian pyramid to obtain an adjusted Laplacian pyramid. Based on the adjusted Laplacian pyramid, reconstruct the first texture map of the second region from the image with the smallest scale in the Gaussian pyramid. Gaussian filtering or bilateral filtering is performed on the boundary region of the first texture map of the second region among the N first texture maps, wherein the second region is the region belonging to the second type of region among the N regions, and the boundary region of the first texture map of the second region is used to provide the texture of the boundary of the second region. On the surface of the at least one 3D model, the distance between the point belonging to the boundary of the second region and the transition type region is less than or equal to a first threshold. The step of adjusting the resolution of the N first texture maps according to the corresponding adjustment strategy to obtain N second texture maps includes: The first texture map of the second region among the N first texture maps is input into the second neural network. The resolution of the first texture map of the second region is improved by the second neural network, and the second texture map of the second region is output. The second region is the region that belongs to the second type of region among the N regions.
15. The method according to claim 14, characterized in that, The training process of the second neural network is as follows: The second sample image is input into the second neural network, which improves the resolution of the second sample image and outputs the adjusted second sample image. The adjusted second sample image is input into a feature extraction network, and the feature extraction network outputs the features of the adjusted second sample image. The second reference image is input into the feature extraction network, and the feature extraction network outputs the features of the second reference image. The second reference image is used to provide a standard to which the second sample image is adjusted. Based on the features of the adjusted second sample image and the features of the second reference image, a second perceptual loss is obtained, which is used to reflect the difference between the features of the adjusted second sample image and the features of the second reference image. Based on the adjusted second sample image and the second reference image, a pixel loss is obtained, which is used to reflect the difference between the adjusted second sample image and the second reference image; The parameters of the second neural network are adjusted based on the second perceptual loss and the pixel loss.
16. The method according to any one of claims 7 to 15, characterized in that, The step of adjusting the resolution of the N first texture maps according to the corresponding adjustment strategy to obtain N second texture maps includes: The first texture map of the transition region in the N first texture maps is downsampled to reduce the resolution of the first texture map of the transition region, so as to obtain the second texture map of the transition region. The transition region is the region that belongs to the transition type region among the N regions.
17. The method according to claim 16, characterized in that, The transition region includes at least two transition sub-regions; The step of downsampling the first texture map of the transition region among the N first texture maps to reduce the resolution of the first texture map of the transition region, and obtaining the second texture map of the transition region, includes: The first texture maps of the at least two transition sub-regions are downsampled in different ways to obtain the second texture maps of the at least two transition sub-regions respectively. The second texture map of the transition region includes the second texture map of each of the at least two transition sub-regions. The resolution of the second texture map of the transition sub-region is negatively correlated with the distance between the transition sub-region and the first type of region.
18. The method according to any one of claims 7 to 17, characterized in that, After adjusting the resolution of the N first texture maps according to the corresponding adjustment strategy to obtain N second texture maps, the process further includes at least one of the following: For the first pixel in the transition region of the N second texture maps, the pixel value of the first pixel is updated based on its position on the at least one 3D model, the pixel value of the second pixel, and the pixel value of the third pixel. The transition region is one of the N regions belonging to the transition type region. The second pixel is the pixel in the second texture map of the region belonging to the first type region whose position on the at least one 3D model is closest to the position of the first pixel on the at least one 3D model. The third pixel is the pixel in the second texture map of the region belonging to the second type region whose position on the at least one 3D model is closest to the position of the first pixel on the at least one 3D model. Gaussian filtering or bilateral filtering is performed on the boundary regions of the transition regions in the N second texture maps; wherein, the transition region is the region belonging to the transition type region among the N regions, and the boundary region of the second texture map of the transition region is used to render the boundary of the second region. On the surface of the at least one 3D model, the distance between the point belonging to the boundary of the transition region and the first type region or the second type region is less than or equal to a second threshold.
19. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program that is loaded and executed by the processor to implement the method as claimed in any one of claims 1 to 18.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the method as described in any one of claims 1 to 18.