Texture processing method, device, electronic device and storage medium

By obtaining the curvature graph of the target model, establishing the correspondence relationship with the normal map, calculating the included angle normal vector and replacing the normal vector in the normal map, the joint problem of the normal map at the included angle is solved, and modeling efficiency is improved.

CN114419221BActive Publication Date: 2025-08-01NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111613436.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-08-01
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

In the prior art, normal maps are prone to seams at the corners of the model, which require manual adjustment and low recognition accuracy, resulting in low modeling efficiency.

Method used

By obtaining the curvature graph of the target model, determining the angle position, and establishing the correspondence between the curvature graph and the normal map, calculating the angle normal vector, replacing the normal vector in the normal map, and automatically completing the modification at the seam.

Benefits of technology

Accurately determine the angle position, reduce the workload of manual modification, and improve modeling efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114419221B_ABST
    Figure CN114419221B_ABST
Patent Text Reader

Abstract

A texture mapping processing method, device, electronic device, and storage medium provided by the present application include: obtaining a curvature map of a target model, determining an included angle position of the target model according to the curvature map; establishing a correspondence between the curvature map and a normal map of the target model, and calculating an included angle normal vector at the included angle position according to the curvature map; based on the included angle normal vector, replacing the corresponding normal vector in the normal map according to the correspondence; and outputting the replaced normal map. By obtaining the curvature map of the corresponding model, determining the included angle position to be found through the curvature map, then establishing the correspondence between the curvature map and the normal map, and calculating a new normal vector at the included angle position based on the curvature map, and finally replacing the corresponding normal vector in the normal map, the present application can accurately determine the problem included angle position, automatically perform normal calculation and replacement to automatically complete the modification at the seam, reduce the manual modification workload, and improve the modeling efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image production technology, and particularly to a texture mapping processing method, device, electronic device, and storage medium. Background Art

[0002] In modern technology for model production, generally a low-polygon model is first made, then a high-polygon model is sculpted with textures, and the bump information on the high-poly model is mapped onto the low-poly model. This mapping process is called normal baking. After obtaining the normal map, textures are drawn. Finally, a low-polygon model and the corresponding normal texture map are obtained.

[0003] However, in existing solutions, when the angle between two faces in a model is within a specific angle range interval, obvious seam phenomena will occur between the baked normal maps, and production personnel need to manually perform texture mapping replacement processing, with low replacement efficiency. At the same time, for the determination of the angle position, the recognition accuracy of existing solutions is not high and the efficiency is low. Summary of the Invention

[0004] In view of this, this application proposes a texture mapping processing method, device, electronic device, and storage medium to solve the possible seam cracks and other phenomena in the normal map at the angle.

[0005] Based on the above purpose, this application provides a texture mapping processing method, including:

[0006] Obtain the curvature map of the target model, and determine the angle position of the target model according to the curvature map;

[0007] Establish a correspondence between the curvature map and the normal map of the target model, and calculate the angle normal vector at the angle position according to the curvature map;

[0008] Based on the angle normal vector, replace the corresponding normal vectors in the normal map according to the correspondence;

[0009] Output the replaced normal map.

[0010] In some embodiments, establishing the correspondence between the curvature map and the normal map of the target model includes:

[0011] Convert the curvature values of each pixel on the curvature map into three primary color channels to determine the three primary color values of each pixel;

[0012] Compress the range of the normal vectors on the normal map, and determine the corresponding three primary color values according to the compressed normal vectors, thereby establishing the correspondence between the curvature map and the normal map.

[0013] In some embodiments, the method for calculating the included angle normal vector of the included angle position according to the curvature map includes:

[0014] The included angle normal vector is specifically

[0015]

[0016] where N(i,j) is the normal vector of point (i,j), and point (i,j) is any point on the curvature map; X(i,j) is the vector of point (i,j) in the X-axis direction; Y(i,j) is the vector of point (i,j) in the Y-axis direction.

[0017] In some embodiments, the method for replacing the corresponding normal vector in the normal map according to the corresponding relationship based on the included angle normal vector includes:

[0018] According to the corresponding relationship, determine the range of the normal map at the included angle position, and replace the normal vector on the normal map within the range with the corresponding included angle normal vector.

[0019] In some embodiments, the method for obtaining the curvature map of the target model includes:

[0020] Map the vertex information of the precision model corresponding to the target model to each pixel point of the target model, convert the vertex information to the tristimulus values of each pixel point of the target model, and convert the tristimulus values to the curvature values of each pixel point of the target model to obtain the curvature map.

[0021] In some embodiments, the method for determining the included angle position of the target model according to the curvature map includes:

[0022] In the curvature map, find the positions where the curvature values are in the range of 0 to 0.3 and 0.7 to 1 as the included angle positions.

[0023] [[ID=3X]]In some embodiments, after outputting the replaced normal map, it further includes:

[0024] Perform normal baking on the target model according to the replaced normal map.

[0025] Based on the same concept, the present application further provides a texture processing device, including:

[0026] A determination module, configured to obtain the curvature map of the target model and determine the included angle position of the target model according to the curvature map;

[0027] A calculation module, configured to establish the corresponding relationship between the curvature map and the normal map of the target model, and calculate the included angle normal vector of the included angle position according to the curvature map;

[0028] A replacement module, configured to replace corresponding normal vectors in the normal map based on the included angle normal vectors according to the corresponding relationship.

[0029] An output module, configured to output the replaced normal map.

[0030] Based on the same concept, the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method described in any one of the above is implemented.

[0031] Based on the same concept, the present application further provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to implement the method described in any one of the above.

[0032] As can be seen from the above, a texture mapping processing method, device, electronic device, and storage medium provided by the present application include: obtaining a curvature map of a target model, determining an included angle position of the target model according to the curvature map; establishing a corresponding relationship between the curvature map and the normal map of the target model, calculating an included angle normal vector at the included angle position according to the curvature map; replacing corresponding normal vectors in the normal map based on the included angle normal vectors according to the corresponding relationship; and outputting the replaced normal map. By obtaining the curvature map of the corresponding model, determining the included angle position to be found through the curvature map, then establishing the corresponding relationship between the curvature map and the normal map, and calculating a new normal vector at the included angle position based on the curvature map, and finally replacing the corresponding normal vector in the normal map, the present application can accurately determine the problem included angle position, automatically perform normal calculation and replacement to automatically complete the modification at the seam, reduce the manual modification workload, and improve the modeling efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0034] Figure 1 It is a schematic flowchart of a texture mapping processing method proposed by an embodiment of the present application;

[0035] Figure 2 It is a schematic structural diagram of a texture mapping processing device proposed by an embodiment of the present application;

[0036] Figure 3 It is a schematic structural diagram of an electronic device proposed by an embodiment of the present application. Detailed implementation manners

[0037] To make the objectives, technical solutions and advantages of this specification clearer and more understandable, the following further elaborates on this specification in detail with reference to specific embodiments and the accompanying drawings.

[0038] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of this application should have the ordinary meanings understood by those of ordinary skill in the field to which this application pertains. The "first", "second" and similar terms used in the embodiments of this application do not denote any order, quantity or importance, but are only used to distinguish different components. The terms such as "including" or "comprising" mean that the elements, objects or method steps appearing before this term cover the elements, objects or method steps listed after this term and their equivalents, without excluding other elements, objects or method steps. The terms such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms such as "upper", "lower", "left" and "right" are only used to indicate relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.

[0039] As described in the background art section, a normal map is to create a normal at each point on the concave-convex surface of the original object, and mark the direction of the normal through the RGB color channels. You can understand it as another different surface parallel to the original concave-convex surface, but in fact it is just a smooth plane. For visual effects, it is more efficient than the original concave-convex surface. If a light source is applied at a specific position, it can make a surface with a lower level of detail generate an accurate lighting direction and reflection effect with a high level of detail. In the current technology, normal maps are mostly used in the rendering of CG animations and the production of game scenes. A high-detail model is mapped and baked to obtain a normal map, and then the normal map is pasted on the normal map channel of a low-end model to make its surface have a rendering effect of light and shadow distribution, which can greatly reduce the number of faces and calculation content required for rendering an object, thereby optimizing the rendering effect of animations and games, that is, performing normal baking. However, in the current technology, after normal baking of high and low models, production personnel need to check the edge seam positions of the models one by one, readjust the included angles of the patches at the seam positions and re-bake to obtain a relatively correct effect, and then replace the original seam positions to finally obtain the correct normal map. This method is affected by the number of faces of the model itself and the number of texture maps, and it is necessary to repeatedly adjust the included angles of the patches at the seam positions and re-bake and replace the normal map at the seam. This increases a large amount of modification costs, increases the manual workload, and reduces the modeling efficiency.

[0040] Combined with the above actual situation, an embodiment of the present application proposes a texture mapping processing solution. By obtaining the curvature map of the corresponding model, determining the included angle position to be found through the curvature map, then establishing the corresponding relationship between the curvature map and the normal map, calculating the new normal vector of the included angle position based on the curvature map, and finally replacing the corresponding normal vector in the normal map, it is possible to accurately determine the problem included angle position, automatically perform normal calculation and replacement to automatically complete the modification at the seam, reduce the manual modification workload, and improve the modeling efficiency.

[0041] As Figure 1 shown, it is a schematic flowchart of a texture mapping processing method proposed by the present application. The method specifically includes:

[0042] Step 101, obtain the curvature map of the target model, and determine the included angle position of the target model according to the curvature map.

[0043] In this step, the target model is generally a low-polygon model to be subjected to normal baking. The low-polygon model corresponds to the high-polygon model. When the model is generated, generally, work such as detailed carving is carried out on the model with the corresponding high level of detail. Then, according to the corresponding relationship of the normals, the texture map made on the high-polygon model is pasted on the corresponding low-polygon model so that the low-polygon model can also achieve the corresponding optimization and rendering effects. After that, the curvature map, that is, the curvature texture map, records the surface curvature information of the model. For example, in the place of the groove, the smaller the included angle between the two patches, the lower the curvature value and the closer it is to 0. When the included angle between the two patches is 0 degrees, the curvature value is 0; in the flat part (that is, the included angle between the two patches is close to 180 degrees), the curvature value is close to about 0.5; in the curved and convex part, the larger the included angle of the patches, the higher the curvature value and the closer it is to 1. When the included angle between the two patches is 360 degrees, the curvature value is 1. Therefore, since there is a direct corresponding relationship between the curvature value in the curvature map and the angle at the included angle of the model, the desired included angle position can be directly found through this curvature map.

[0044] In some embodiments, the way to obtain the curvature map can be directly input manually, that is, when the target model is obtained, the curvature map of the target model is also obtained; it can also be obtained by performing low-poly baking on the target model or performing reverse conversion of the normal map.

[0045] In a specific application scenario, the angles of the included angles that often have problems are generally relatively small angles or relatively large angles. After summarizing the specific included angle range through experiments and other means, the corresponding curvature value of such an included angle range can be determined, and according to the corresponding position relationship of this curvature value in the curvature map, the included angle position of the target model can be finally determined.

[0046] Step 102, establish the corresponding relationship between the curvature map and the normal map of the target model, and calculate the included angle normal vector of the included angle position according to the curvature map.

[0047] In this step, it is necessary to first establish the relationship between the curvature map and the normal map. Since the curvature map is single-channel and the range of its curvature values is also between 0 and 1. When making the correspondence, generally, it is necessary to first convert it into three-channel values. Here, it can be achieved by converting the curvature map into the RGB channels, and then evenly distributing the weights of the three channels so that the RGB values of each pixel after conversion are equal. Among them, the RGB channels, that is, the color channels, are generally composed of three primary colors: the red, blue, and green channels. After that, each normal line in the normal map is represented in the form of a spatial vector, and it necessarily corresponds to three coordinate values of X, Y, and Z. In a specific application scenario, the normal map can compress the value ranges of the RGB three channels and perform an operation of N + 1 / 2 on the projected lengths of the normal lines on each axis of X, Y, and Z, where N is the projected length, so that all the normal lines can be compressed into the range of 0 to 1, thereby enabling the normal vector at a specific point to correspond to the RGB value converted from the curvature value on the curvature map at that point, and then establishing the direct correspondence relationship between the curvature map and the normal map.

[0048] After that, use the curvature map to calculate the included angle normal vector at the calculated included angle position, that is, calculate a new normal vector at an included angle position through the curvature map. In a specific application scenario, for the point at (i, j) on the curvature map, the vectors along the X and Y axes are:

[0049] X(i,j) = <1, 0, aH(i + 1, j) - aH(i - 1, j)>

[0050] Y(i,j) = <1, 0, aH(i, j + 1) - aH(i, j - 1)>

[0051] The cross product gives the normal vector at this point:

[0052]

[0053] Among them, N(i,j) is the normal vector at point (i, j), and point (i, j) is any point on the curvature map; X(i,j) is the vector at point (i, j) along the X-axis; Y(i,j) is the vector at point (i, j) along the Y-axis; aH(x, y) is the height value at point (x, y), such as aH(i + 1, j) is the height value at point (i + 1, j); X z and Y z respectively represent the height values of the X-axis and the Y-axis.

[0054] Step 103, based on the included angle normal vector, replace the corresponding normal vector in the normal map according to the corresponding relationship.

[0055] In this step, according to the new included angle normal vector at the included angle position calculated in step 102, it is necessary to replace the original normal vector at the corresponding position in the normal map with this included angle normal vector. According to the corresponding relationship between the curvature map and the normal map, the original normal vector at the included angle position can be simply determined, and then the replacement of the normal vector can be carried out.

[0056] In some embodiments, a mask for the seam and included angle positions can be obtained based on the curvature value through the corresponding relationship, that is, the specific range or specific area corresponding to the included angle position can be determined, and then these places can be marked by means of a black and white mask. Then, when replacing, the normal vector at the marked position can be directly replaced. This process can be carried out before calculating the included angle normal vector or after the calculation is completed.

[0057] Step 104, output the replaced normal map.

[0058] In this step, for the normal map after replacing the normal, further output can be performed. It can directly display this normal map for engineers to perform further adjustment and other drawing work on this normal map. It can also directly perform operations such as normal baking on the target model according to this normal map to continue with the production steps of downstream models and animations. That is, in this step, the normal map can be stored, displayed, used, or reprocessed. According to different application scenarios and implementation requirements, the specific output method for this normal map can be flexibly selected.

[0059] For example, for the application scenario where the method of this embodiment is executed on a single device, the normal map can be directly output in a display manner on the display component (monitor, projector, etc.) of the current device, so that the operator of the current device can directly see the content of the normal map from the display component.

[0060] For another example, for the application scenario where the method of this embodiment is executed on a system composed of multiple devices, the normal map can be sent to other preset devices in the system as the receiving party, that is, the synchronization terminal, through any data communication method (wired connection, NFC, Bluetooth, wifi, cellular mobile network, etc.), so that the synchronization terminal can perform subsequent processing on it. Optionally, the synchronization terminal can be a preset server, which is generally set in the cloud and serves as the data processing and storage center, and it can store and distribute the normal map; among them, the receiving party for distribution is the terminal device, and the holders or operators of these terminal devices can be drawing engineers, downstream animation production engineers, and the public database of animation production companies to record the work results of each engineer, etc.

[0061] For another example, in the application scenario where the method of this embodiment is executed on a system composed of multiple devices, the normal map can be directly sent to a preset terminal device through any data communication method, and the terminal device can be one or more of those listed in the previous paragraph.

[0062] As can be seen from the above, a texture mapping processing method according to an embodiment of the present application includes: obtaining a curvature map of a target model, and determining an included angle position of the target model according to the curvature map; establishing a correspondence between the curvature map and the normal map of the target model, and calculating an included angle normal vector of the included angle position according to the curvature map; based on the included angle normal vector, replacing the corresponding normal vector in the normal map according to the correspondence; outputting the replaced normal map. By obtaining the curvature map of the corresponding model, determining the included angle position to be found through the curvature map, then establishing the correspondence between the curvature map and the normal map, and calculating the new normal vector of the included angle position based on the curvature map, and finally replacing the corresponding normal vector in the normal map, the problem included angle position can be accurately determined, and the normal calculation and replacement can be automatically performed to automatically complete the modification at the seam, reducing the manual modification workload and improving the modeling efficiency.

[0063] It should be noted that the method of the embodiment of the present application can be executed by a single device, such as a computer or a server. The method of the embodiment of the present application can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In this case of a distributed scenario, one of the multiple devices can only execute one or more steps of the method of the embodiment of the present application, and these multiple devices will interact with each other to complete the described method.

[0064] It should be noted that the above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in a different order than in the above embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0065] In an optional exemplary embodiment, establishing the correspondence between the curvature map and the normal map of the target model includes: converting the curvature values of each pixel on the curvature map into three primary color channels to determine the three primary color values of each pixel; compressing the range of the normal vectors on the normal map, and determining the corresponding three primary color values according to the compressed normal vectors, so as to establish the correspondence between the curvature map and the normal map. In this way, the relationship between the pixel curvature value and the corresponding normal vector can be quickly established.

[0066] In this embodiment, the actual driving of the curvature map is similar to the normal map. The curvature value at a certain point in space can also be converted in the RGB channels. When used for texture mapping, the curvature map is based on UV, and the numerical range floats between 0 and 1, and it looks similar to a grayscale map in appearance, so as to record the surface curvature information of the model. For example, the flat part has a low curvature and appears black; the curved part (such as a chamfer) has a high curvature and appears white. Among them, UV is the abbreviation of U and V texture mapping coordinates, which is similar to the X, Y, and Z axes of the spatial model. It defines the information of the position of each point on the image. UV precisely corresponds each point on the image to the surface of the model object. The software performs image smoothing interpolation processing at the gap positions between points. This is the so-called UV mapping. Furthermore, in some embodiments, the curvature value of a certain point can be converted into RGB information, and the weights of the three channels are evenly distributed, so that the curvature value of this point is converted into RGB information with equal RGB values at this point, that is, the single-channel curvature value is converted into a three-channel RGB value.

[0067] After that, for each normal vector in the normal map, since it is itself a three-dimensional vector, it naturally corresponds to a value on the X, Y, and Z axes. After that, as long as the normal vector is compressed in range according to the limit of the curvature value (the curvature value is only a value within the range of 0 to 1), that is, the operation of N + 1 / 2 is performed on the normal projection lengths on the three axes, where N is the projection length, so that all normals can be compressed into the range of 0 to 1, so that the normal vector of a specific point can correspond to the RGB value converted from the curvature value on the curvature map of this point, and then a corresponding relationship between the curvature map and the normal map is established.

[0068] In an optional exemplary embodiment, the calculating the included angle normal vector of the included angle position according to the curvature map includes:

[0069] The included angle normal vector is specifically

[0070]

[0071] where N(i,j) is the normal vector of the point (i,j), and the point (i,j) is any point on the curvature map; X(i,j) is the vector of the point (i,j) along the X-axis direction; Y(i,j) is the vector of the point (i,j) along the Y-axis direction.

[0072] In an optional exemplary embodiment, the replacing of the corresponding normal vectors in the normal map according to the corresponding relationship based on the included angle normal vectors includes: determining a range of the normal map at the included angle position according to the corresponding relationship, and replacing the normal vectors on the normal map within the range with the corresponding included angle normal vectors. In this way, by selecting the ranges of seams and included angle positions, the range where the normal vectors to be replaced are located can be quickly found during normal vector replacement, facilitating the replacement.

[0073] In this embodiment, the area range of the normal map can be determined according to the corresponding relationship through the curvature value, that is, a mask for seams and included angle positions is obtained based on the curvature value. The concept of a mask in digital image processing is borrowed from the process of PCB plate making, etc. In semiconductor manufacturing, many chip process steps use lithography technology, and the graphic "negative film" used for these steps is called a mask (also known as a "reticle"), and its function is: covering an opaque graphic template in a selected area on the silicon wafer, and then the following etching or diffusion will only affect the area outside the selected area. An image mask is similar to this, using a selected image, graphic or object to block the processed image (all or part) to control the area or process of image processing. In optical image processing, a mask can be a film, a filter, etc. In digital image processing, a mask is a two-dimensional matrix array, and sometimes a multi-valued image is also used. In digital image processing, image masks are mainly used for: extracting the region of interest, multiplying the pre-made region of interest mask with the image to be processed to obtain the region of interest image, where the image values within the region of interest remain unchanged, while the image values outside the region are all 0; shielding effect, using the mask to shield certain regions on the image so that they do not participate in the processing or the calculation of processing parameters, or only processing or statistics are performed on the shielded region; structural feature extraction, using similarity variables or image matching methods to detect and extract the structural features in the image that are similar to the mask; making special-shaped images.

[0074] Afterwards, after determining the range, during replacement, the corresponding normal vectors can be found more quickly and rapidly for replacement.

[0075] In an optional exemplary embodiment, the obtaining of the curvature map of the target model includes: mapping the vertex information of the precision model corresponding to the target model to each pixel point of the target model, generating the three primary color values of each pixel point of the target model according to the vertex information, converting the three primary color values into the curvature values of each pixel point of the target model, and obtaining the curvature map.

[0076] In a specific application scenario, the curvature map of the target model can be obtained in various ways. The curvature map can be directly baked through a low-polygon model or obtained by reverse conversion of the original normal vectors through baking. Among them, directly baking through a low-polygon model means mapping the vertex information of the high-polygon model to the UV pixels of the low-polygon model. Each vertex of the high-polygon model contains (X, Y, Z) in three-dimensional space, and the corresponding normal information is used to obtain the curvature map where the coordinates X = R, Y = G, Z = B. The value ranges of X and Y of the normal vector are between -1 and 1, corresponding to the range of 0 to 255 of R and G, and the value range of Z of the normal vector is between 0 and 1, corresponding to the range of 128 to 255 of B. After that, reverse conversion of the original normal vector means reverse conversion of the normal vectors in the current normal map, and the conversion process is the reverse process of converting the curvature value to the normal vector in the foregoing embodiment.

[0077] In an optional exemplary embodiment, determining the included angle position of the target model according to the curvature map includes: finding the positions with curvature values in the range of 0 to 0.3 and 0.7 to 1 in the curvature map as the included angle positions.

[0078] In this embodiment, the smaller the included angle between the two patches at the groove, the lower the curvature value and the closer it is to 0. When the curvature value is between 0 and 0.3, the corresponding included angle is already a very sharp angle, and problems such as tearing of the corresponding seams in this part are already relatively serious and often occur. Therefore, this area is positioned as the area where normal vector replacement is required; for the curved convex part, the larger the included angle between the patches, the higher the curvature value and the closer it is to 1. When the curvature value is between 0.7 and 1, the corresponding included angle is also very sharp. Therefore, this area is positioned as the area where normal vector replacement is required. In a specific embodiment, it is found that when adjusting the included angle of a specific model, for the included angles with curvature in the ranges of 0 to 0.3 and 0.7 to 1, phenomena such as gaps are more likely to occur. Therefore, it is set to process the included angles with curvature values in the ranges of 0 to 0.3 and 0.7 to 1. At the same time, in a specific application scenario, the curvature value range can be set and adjusted by the user. Initially, a basic range interval of 0 to 0.3 and 0.7 to 1 is provided, and then the user can adjust the range interval through setting to adapt to the specific application scenario.

[0079] In an optional exemplary embodiment, after outputting the replaced normal map, it further includes: performing normal baking on the target model according to the replaced normal map.

[0080] Based on the same concept, corresponding to the method of any of the above embodiments, the present application further provides a texture processing device.

[0081] Referring to Figure 2 , the texture processing device includes:

[0082] A determination module 210, configured to obtain a curvature map of a target model and determine an included angle position of the target model according to the curvature map.

[0083] A calculation module 220, configured to establish a correspondence between the curvature map and a normal map of the target model, and calculate an included angle normal vector of the included angle position according to the curvature map.

[0084] A replacement module 230, configured to replace corresponding normal vectors in the normal map based on the included angle normal vector according to the correspondence.

[0085] An output module 240, configured to output the replaced normal map.

[0086] For the convenience of description, when describing the above device, various modules are described separately according to their functions. Of course, when implementing the embodiments of the present application, the functions of each module can be implemented in one or more software and / or hardware.

[0087] The device in the above embodiment is used to implement the corresponding texture mapping processing method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0088] In an optional exemplary embodiment, the calculation module 220 further includes:

[0089] Convert the curvature values of each pixel on the curvature map into three primary color channels to determine the three primary color values of each pixel;

[0090] Compress the range of the normal vectors on the normal map, and determine the corresponding three primary color values according to the compressed normal vectors, so as to establish the correspondence between the curvature map and the normal map.

[0091] In an optional exemplary embodiment, the calculation module 220 further includes:

[0092] The included angle normal vector is specifically

[0093]

[0094] where N(i,j) is the normal vector of point (i,j), and point (i,j) is any point on the curvature map; X(i,j) is the vector of point (i,j) along the X-axis direction; Y(i,j) is the vector of point (i,j) along the Y-axis direction.

[0095] In an optional exemplary embodiment, the replacement module 230 is further configured to:

[0096] According to the corresponding relationship, determine the range of the normal map at the included angle position, and replace the normal vectors on the normal map within the range with the corresponding included angle normal vectors.

[0097] In an optional exemplary embodiment, the determining module 210 is further configured to:

[0098] Map the vertex information of the accuracy model corresponding to the target model to each pixel point of the target model, generate the primary color values of each pixel point of the target model according to the vertex information conversion, and convert the primary color values into the curvature values of each pixel point of the target model to obtain the curvature map.

[0099] In an optional exemplary embodiment, the determining module 210 is further configured to:

[0100] Find the positions where the curvature values are in the range of 0 to 0.3 and 0.7 to 1 in the curvature map as the included angle positions.

[0101] In an optional exemplary embodiment, the output module 240 is further configured to:

[0102] Perform normal baking on the target model according to the replaced normal map.

[0103] Based on the same concept, corresponding to the method of any of the above embodiments, the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the texture mapping processing method described in any of the above embodiments.

[0104] Figure 3 FIG. shows a more specific schematic diagram of the hardware structure of the electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. Among them, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other inside the device through the bus 1050.

[0105] The processor 1010 may be implemented in a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present specification.

[0106] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 1020 can store the operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0107] The input / output interface 1030 is used to connect to the input / output module to achieve information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Among them, the input devices can include keyboards, mice, touchscreens, microphones, various sensors, etc., and the output devices can include displays, speakers, vibrators, indicator lights, etc.

[0108] The communication interface 1040 is used to connect to the communication module (not shown in the figure) to achieve communication interaction between this device and other devices. Among them, the communication module can achieve communication through wired means (such as USB, network cable, etc.) or can also achieve communication through wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0109] The bus 1050 includes a path for transmitting information between various components of the device (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0110] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, this device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary for implementing the solutions of the embodiments of this specification and does not necessarily include all the components shown in the figure.

[0111] The electronic device in the above embodiment is used to implement the corresponding texture mapping processing method in any of the foregoing embodiments and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.

[0112] Based on the same concept, corresponding to the method in any of the above embodiments, the present application also provides a non-transitory computer-readable storage medium. The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause the computer to execute the texture mapping processing method described in any of the above embodiments.

[0113] The computer-readable media of this embodiment include both permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible by a computing device.

[0114] The computer instructions stored in the storage media of the above embodiments are used to cause the computer to execute the texture mapping processing method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated here.

[0115] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present application (including the claims) is limited to these examples; within the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the embodiments of the present application as described above, and they are not provided in detail for the sake of brevity.

[0116] In addition, for simplicity of explanation and discussion, and in order not to make the embodiments of the present application difficult to understand, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the devices may be shown in block diagram form to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present application are to be implemented (i.e., these details should be fully within the understanding of those skilled in the art). In the case where specific details (such as circuits) are set forth to describe the exemplary embodiments of the present application, it will be apparent to those skilled in the art that the embodiments of the present application can be implemented without these specific details or with variations of these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0117] Although the present application has been described in connection with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0118] Embodiments of the present application are intended to cover all such alternatives, modifications, and variations that fall within the broad scope of the appended claims. Accordingly, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the embodiments of the present application shall be included within the protection scope of the present application.

Claims

1. A method for processing a texture map, characterized in that, Including: Obtain the curvature map of the target model, and determine the included angle positions of the target model according to the curvature map; Establish the correspondence between the curvature map and the normal map of the target model, and calculate the included angle normal vectors of the included angle positions according to the curvature map; Based on the included angle normal vectors, replace the corresponding normal vectors in the normal map according to the correspondence; Output the replaced normal map; The establishing the correspondence between the curvature map and the normal map of the target model includes: Convert the curvature values of each pixel on the curvature map into the three primary color channels to determine the three primary color values of each pixel; Compress the range of the normal vectors on the normal map, and determine the corresponding three primary color values according to the compressed normal vectors, so as to establish the correspondence between the curvature map and the normal map.

2. The method according to claim 1, characterized in that, The calculating the included angle normal vectors of the included angle positions according to the curvature map includes: The included angle normal vector is specifically where N(i,j) is the normal vector of point (i,j), and point (i,j) is any point on the curvature map; X(i,j) is the vector of point (i,j) along the X-axis direction; Y(i,j) is the vector of point (i,j) along the Y-axis direction.

3. The method according to claim 1, characterized in that The replacing the corresponding normal vectors in the normal map based on the included angle normal vectors according to the correspondence includes: According to the correspondence, determine the range of the normal map at the included angle position, and replace the normal vectors on the normal map within the range with the corresponding included angle normal vectors.

4. The method according to claim 1, characterized in that, The obtaining the curvature map of the target model includes: Map the vertex information of the precision model corresponding to the target model to each pixel point of the target model, convert the three primary color values of each pixel point of the target model according to the vertex information, and convert the three primary color values into the curvature values of each pixel point of the target model to obtain the curvature map.

5. The method according to claim 1, wherein The determining the included angle positions of the target model according to the curvature map includes: Find the positions with curvature values in the range of 0 to 0.3 and 0.7 to 1 in the curvature map as the included angle positions.

6. The method according to claim 1, characterized in that, After the outputting the replaced normal map, it further includes: Perform normal baking on the target model according to the replaced normal map.

7. A sticker processing device, characterized in that, Including: A determination module, configured to obtain the curvature map of the target model, and determine the included angle positions of the target model according to the curvature map; A calculation module, configured to establish the correspondence between the curvature map and the normal map of the target model, and calculate the included angle normal vectors of the included angle positions according to the curvature map; A replacement module, configured to replace the corresponding normal vectors in the normal map based on the included angle normal vectors according to the correspondence; An output module, configured to output the replaced normal map; The calculation module further includes: Convert the curvature values of each pixel on the curvature map into the three primary color channels to determine the three primary color values of each pixel; Compress the range of the normal vectors on the normal map, and determine the corresponding three primary color values according to the compressed normal vectors, so as to establish the correspondence between the curvature map and the normal map.

8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to implement the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Virtual model rendering method and device, storage medium and electronic equipment

    CN109685869A

  • Model rendering method and device, storage medium and computer equipment

    CN112053423A