CN112837403A - Mapping drawing method and device, computer equipment and storage medium - Google Patents

Mapping drawing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112837403A
CN112837403A CN202110260983.2A CN202110260983A CN112837403A CN 112837403 A CN112837403 A CN 112837403A CN 202110260983 A CN202110260983 A CN 202110260983A CN 112837403 A CN112837403 A CN 112837403A
Authority
CN
China
Prior art keywords
local
map
maps
mapping
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110260983.2A
Other languages
Chinese (zh)
Other versions
CN112837403B (en
Inventor
牛兴帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202110260983.2A priority Critical patent/CN112837403B/en
Publication of CN112837403A publication Critical patent/CN112837403A/en
Application granted granted Critical
Publication of CN112837403B publication Critical patent/CN112837403B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts

Abstract

The application discloses a mapping drawing method and device, computer equipment and a storage medium. The method comprises the following steps: drawing a category mapping according to an original mapping and a built-in principle, wherein the category mapping comprises a plurality of color areas; extracting local maps from the original maps according to a plurality of color areas, wherein the number of the plurality of color areas is matched with the number of the local maps; determining a corresponding local diffuse reflection map, a local normal map, a local roughness map and a local metallization map according to the local map; and respectively merging the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metal degree maps to respectively obtain a target diffuse reflection map, a target normal map, a target roughness map and a target metal degree map. According to the method, high-quality texture carving and manual drawing are not needed, so that the product quality is guaranteed, the labor and time cost is greatly saved, and the drawing efficiency of the map is improved.

Description

Mapping drawing method and device, computer equipment and storage medium
Technical Field
The application relates to the technical field of computer graphics, in particular to a chartlet drawing method and device, computer equipment and a storage medium.
Background
With the market development and the improvement of the aesthetic sense of users, the aesthetic preference of users cannot be met by the existing generation, scenes and roles of hand-drawn texture making and other art assets, the effect of the next generation becomes the mainstream of the market, and the conversion of project products becomes the trend.
The method for making the next generation map in the prior art comprises the following steps: the method comprises the steps of carving high-quality textures through three-dimensional carving software, baking the carved textures on a product model to obtain a high-quality normal line mapping, making a category (ID) mapping, and manually drawing by combining an original mapping, the ID mapping and the high-quality normal line mapping to obtain a final normal line mapping, a metal degree mapping, a diffuse reflection mapping and a roughness mapping. However, in the method of obtaining the high-quality normal line map after carving the high-quality texture, the learning cost of the software is high, the quality is difficult to unify, the manual drawing is affected by the aesthetic preference of the manufacturer, the artistic success and the manufacturing experience, and the product quality cannot be guaranteed.
Disclosure of Invention
The embodiment of the application provides a chartlet drawing method and device, computer equipment and a storage medium, which can automatically generate a chartlet required by a product, do not need high-quality texture carving and manual drawing, greatly save manpower and time cost while ensuring the product quality, and greatly improve the product development efficiency.
The embodiment of the application provides a map drawing method, which comprises the following steps:
drawing a category mapping according to an original mapping and a built-in principle, wherein the category mapping comprises a plurality of color areas;
extracting local maps from the original maps according to the color regions, wherein the number of the color regions is matched with that of the local maps;
determining a corresponding local diffuse reflection map, a local normal map, a local roughness map and a local metallization map according to the local map;
and respectively merging the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metal degree maps to respectively obtain a target diffuse reflection map, a target normal map, a target roughness map and a target metal degree map.
Optionally, the determining, according to the local map, a corresponding local diffuse reflection map, a corresponding local normal map, a corresponding local roughness map, and a corresponding local metallization map includes:
acquiring a first target maximum value and a first target minimum value of the color level of the local map, and determining the local diffuse reflection map according to the first target maximum value and the first target minimum value;
determining a local normal map according to the local diffuse reflection map;
determining a local roughness map according to the local normal map;
and determining a local metallization map according to the local map and the diffuse reflection map.
Optionally, the determining a local normal map according to the local diffuse reflection map includes:
carrying out gray level processing on the local diffuse reflection map;
and carrying out Sobel sampling on the local diffuse reflection map after the gray processing to obtain a local normal map.
Optionally, the determining a local roughness map according to the local normal map includes:
performing single curvature conversion on the local normal map to obtain a first map;
acquiring a second target maximum value and a second target minimum value of the color level of the first map, and adjusting the color level of the first map according to the second target maximum value and the second target minimum value;
acquiring a white area of the adjusted first map;
subtracting the local diffuse reflection mapping subjected to gray level processing from the white area to obtain a third mapping;
and acquiring a third target maximum value and a third target minimum value of the color level of the third map, and determining the local roughness map according to the third target maximum value and the third target minimum value.
Optionally, the determining a local metallization map according to the local map and the diffuse reflection map includes:
if the local map is a first local map, determining a local metallization map according to the local map and the local diffuse reflection map, wherein the first local map is a local map corresponding to a preset color area in the plurality of color areas;
and if the local map is not the first local map, determining a preset pure color map as a local metal degree map of the local map.
Optionally, the determining a local metallization map according to the local map and the diffuse reflection map includes:
setting the local mapping to be white to obtain a white mapping;
carrying out gray level processing on the local map to obtain a gray level map of the local map;
acquiring a fourth target maximum value and a fourth target minimum value of the color level of the gray level map, and adjusting the gray level map according to the fourth target maximum value and the fourth target minimum value;
acquiring the darkest area of the adjusted gray level map;
and subtracting the darkest area from the white mapping to obtain a local metal degree mapping.
Optionally, the method further includes: and converting the original map into a plurality of black-and-white masks according to a plurality of color areas of the category map, wherein the number of the black-and-white masks is matched with the number of the color areas.
Optionally, the merging the multiple local diffuse reflection maps, the multiple local normal maps, the multiple local roughness maps, and the multiple local metallization maps respectively includes:
extracting corresponding areas from the local diffuse reflection mapping, the local normal mapping, the local roughness mapping and the local metallization mapping according to the black and white mask;
merging corresponding regions of the local diffuse reflection maps, corresponding regions of the local normal maps, corresponding regions of the local roughness maps and corresponding regions of the local metallization maps respectively.
An embodiment of the present application further provides a map drawing apparatus, including:
the drawing module is used for drawing a category mapping according to an original mapping and a built-in principle, wherein the category mapping comprises a plurality of color areas;
the extracting module is used for extracting local maps from the original maps according to the plurality of color areas, and the number of the plurality of color areas is matched with that of the local maps;
the determining module is used for determining a corresponding local diffuse reflection map, a local normal map, a local roughness map and a local metal degree map according to the local map;
and the merging module is used for respectively merging the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metal degree maps to respectively obtain a target diffuse reflection map, a target normal map, a target roughness map and a target metal degree map.
Embodiments of the present application further provide a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method when executing the computer program.
Embodiments of the present application also provide a storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of the method as described above.
The embodiment of the application provides a mapping drawing method and device, computer equipment and a storage medium, wherein a diffuse reflection mapping, a normal mapping, a roughness mapping and a metal mapping can be automatically generated directly through class mapping without high-quality texture carving and manual drawing, so that the labor and time cost are greatly saved while the product quality is ensured, and the mapping drawing efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a system diagram of a mapping device according to an embodiment of the present application.
FIG. 2 is a schematic flow chart diagram of a mapping method according to an embodiment of the present application;
FIG. 3 is another schematic flow chart diagram of a mapping method according to an embodiment of the present application;
FIG. 4 is an exemplary process diagram of a chartlet rendering method provided by an embodiment of the present application;
fig. 5 is a schematic structural diagram of a mapping device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a mapping drawing method and device, computer equipment and a storage medium. Specifically, the present embodiment provides a mapping method suitable for a mapping apparatus, which may be integrated in a computer device.
The computer device may be a terminal or other device, such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, or other device.
The computer device may also be a device such as a server, and the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform, but is not limited thereto.
Referring to fig. 1, fig. 1 is a schematic system diagram of a mapping apparatus according to an embodiment of the present application, where the system may include a computer device, and the mapping method may be implemented by modeling software in the computer device. Firstly, a user needs to input a product model, an original map and an ID map into modeling software, wherein the ID map is a category map, the ID map comprises a plurality of color areas, and the areas with different colors identify different materials. The modeling software may include a plug-in that may be used primarily to: extracting a plurality of local maps from the original map according to the ID map, then determining a local diffuse reflection map, a local normal map, a local roughness map and a local metal degree map corresponding to each local map according to a plurality of color maps, and then respectively merging the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metal degree maps to respectively obtain a target diffuse reflection map, a target normal map, a target roughness map and a target metal degree map. And then according to the product model input by the user and the target diffuse reflection mapping, the target normal mapping, the target roughness mapping and the target metal degree mapping obtained by the plug-in, outputting a next generation model required by the user by the modeling software.
Referring to fig. 2, fig. 2 is a schematic flow chart of a mapping method provided in an embodiment of the present application, where the method mainly includes steps 101 to 104, execution bodies of the steps included in the method may be the same or different, the execution body includes a terminal, a server, and the like, and the following description is provided for each step:
step 101: and drawing a category mapping according to the original mapping and a built-in principle, wherein the category mapping comprises a plurality of color areas.
The main function of the category (ID) map is to specify the material, different color areas represent different materials, and usually, different areas can be selected for drawing respectively through the ID map. The built-in principle can be as follows: the color value of the metal material is set to ff0000 (pure red), the color value of the cloth or wood material is set to 00ff00 (pure green), and the color value of the hair material is set to 0000ff (pure blue). It is easily understood that the color values in the ID map are only used for identifying different colors, and therefore, the setting principle of the color values in the foregoing built-in principle is not used to limit the scope of the present application, for example, in some other embodiments, the color values of skin material may be set to be pure blue, the color values of wood material may be set to be pure red, and so on.
Step 102: and extracting local maps from the original maps according to a plurality of color areas, wherein the number of the plurality of color areas is matched with that of the local maps.
Specifically, the ID map is drawn according to the original map and the built-in principle, that is, there is a mapping relationship between the original map and the ID map, and therefore, step 102 may include: specifying a color region in the ID map; and extracting the local map from the original map according to the mapping relation between the ID map and the original map. For example, it is desired to extract the shape of the red area in the ID map separately, and extract the local map corresponding to the area having the color value of ff0000 in the ID map from the original map.
Step 103: and determining a corresponding local diffuse reflection map, a local normal map, a local roughness map and a local metallization map according to the local maps.
Specifically, step 103 may mainly include: acquiring a first target maximum value and a first target minimum value of a color level of the local map, and determining the local diffuse reflection map according to the first target maximum value and the first target minimum value; determining a local normal map according to the local diffuse reflection map; determining a local roughness map according to the local normal map; and determining a local metallization map according to the local map and the diffuse reflection map.
The highlight rendered by the next generation model is embodied based on material roughness, the dark part is generated by object shielding blocking and projection, and the diffuse reflection texture is not required to be embodied, so that the highlight is required to be removed from the original mapping and the dark part is corrected, and the method can be specifically carried out by adjusting the color level of the mapping, namely, in the steps, acquiring a first target maximum value and a first target minimum value of the color level of the local mapping, and determining the local diffuse reflection mapping according to the first target maximum value and the first target minimum value. It should be noted that the setting function of the first target maximum value and the first target minimum value may be opened to the user, and the user sets the maximum value and the minimum value of the color gradation by himself or herself to obtain the effect desired by the user.
Further, the step of "determining the local normal map according to the local diffuse reflection map" may mainly include: carrying out gray level processing on the local diffuse reflection map; and carrying out Sobel sampling on the local diffuse reflection map subjected to the gray processing to obtain a local normal map.
Specifically, the value of the R, G, B channel in the local diffuse reflection map is weighted and averaged, so that the R, G, B channels of each pixel point are equal, and the gray scale map of the local diffuse reflection map can be obtained.
It will be appreciated that normal mapping is an important way to show more details of a three-dimensional model, which calculates the details of the model's surface due to lighting. This is a 2-dimensional effect so it does not change the shape of the model, but it calculates a great deal of extra detail inside the contour.
Specifically, sobel sampling is mainly used for extracting the edge of the picture, and therefore sobel sampling is performed on the local diffuse reflection map after the gray processing, so that the local normal map of the local map can be obtained.
Further, the step of "determining a local roughness map according to the local normal map" may mainly include: carrying out single curvature conversion on the local normal map to obtain a first map; acquiring a second target maximum value and a second target minimum value of the color level of the first map, and adjusting the color level of the first map according to the second target maximum value and the second target minimum value; acquiring a white area of the adjusted first map; subtracting the local diffuse reflection mapping subjected to the gray level processing from the white area to obtain a third mapping; and acquiring a third target maximum value and a third target minimum value of the color level of the third map, and determining the local roughness map according to the third target maximum value and the third target minimum value.
Specifically, the curvature value may determine whether a certain portion of the surface is convex or concave, and a single curvature conversion is performed on the normal map to obtain a first map, where the first map is white in the convex region and black in the concave region. The white area can be strengthened and the black area can be weakened by adjusting the color level of the first map, and a user can set the second target maximum value and the second target minimum value of the first map by himself to obtain the effect desired by himself. For example, the user may increase the maximum value of the color level of the first map to expand the white range, and decrease how small the black range is by decreasing the minimum value of the color level of the first map.
Further, the step of "determining a local metallization map according to the local map and the diffuse reflection map" may mainly include: if the local map is a first local map, determining a local metallization map according to the local map and the local diffuse reflection map, wherein the first local map is a local map corresponding to a preset color area in the plurality of color areas; and if the local map is not the first local map, determining the preset pure color map as the local metal degree map of the local map.
Specifically, the metal level map is used to distinguish between an insulator and a metal in the map, and the value of the metal portion is 1 (white) and the value of the insulator portion is 0 (black). It is easy to understand that, in the original map, all the parts except the metal material part are black in the metallization map, so if there is a local area in the original map that is metal, the local area (the first local area) is extracted, the local metallization map of the local area is calculated, and the rest local areas are determined as the local metallization map by directly determining the black map.
In this embodiment, the step "determining a local metallization map according to a local map and a diffuse reflection map" may specifically include: setting the local mapping to be white to obtain a white mapping; carrying out gray level processing on the local mapping to obtain a gray level mapping of the local mapping; acquiring a fourth target maximum value and a fourth target minimum value of the color level of the gray-scale map, and adjusting the gray-scale map according to the fourth target maximum value and the fourth target minimum value; acquiring the darkest area of the adjusted gray level map; and subtracting the darkest area from the white mapping to obtain a local metal degree mapping.
Specifically, the fourth target maximum value and the fourth target minimum value may also be set by the user, so that the final secondary effect meets the expectation of the user.
Step 104: and respectively merging the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metal degree maps to respectively obtain a target diffuse reflection map, a target normal map, a target roughness map and a target metal degree map.
Specifically, a plurality of local diffuse reflection maps need to be merged to obtain a complete target diffuse reflection map. Normal mapping, roughness mapping and local metallization mapping are the same.
In some embodiments, the method further comprises: and converting the original map into a plurality of black-and-white masks according to the plurality of color areas of the category map, wherein the number of the black-and-white masks is matched with the number of the plurality of color areas.
For example, the color value representing the metal material in the class map is ff0000 (red), and the hexadecimal color value of ff0000 is converted into binary to generate the black and white mask. Wherein the black mask can be used to extract the corresponding region.
In this embodiment, the step of "respectively merging the plurality of local diffuse reflection maps, the plurality of local normal maps, the plurality of local roughness maps, and the plurality of local metallization maps" may include: extracting corresponding areas from the local diffuse reflection mapping, the local normal mapping, the local roughness mapping and the local metallization mapping according to the black and white mask; merging the corresponding areas of the local diffuse reflection maps, the corresponding areas of the local normal maps, the corresponding areas of the local roughness maps and the corresponding areas of the local metal degree maps respectively.
Specifically, when the local diffuse reflection map, the local normal map, the local roughness map, and the local metallization map are generated according to the local map, the texture regions other than the local map may be filled with pure colors, and if the pure color filling is not performed, channel information needs to be calculated, which may cause delay. Different types of maps will be filled with different solid colors, for example, the normal map corresponds to a fill color value of 8080ff and the roughness map corresponds to a fill color value of 808080. Therefore, when merging, the area corresponding to the local map needs to be extracted from the local diffuse reflection map, the local normal map, the local roughness map and the local metal degree map, then each local diffuse reflection map is merged to generate a complete target diffuse reflection map, each local normal map is merged to generate a complete target normal map, each local roughness map is merged to generate a complete target roughness map, and each local metal degree map is merged to generate a complete target metal degree map.
The method for drawing the map provided by the embodiment of the application draws the category map according to the original map and the built-in principle, wherein the category map comprises a plurality of color areas, extracts the local map from the original map according to the color areas, the number of the color areas is matched with the number of the local map, determines the corresponding local diffuse reflection map, local normal map, local roughness map and local metal degree map according to the local map, and then combines the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metal degree maps to respectively obtain the target diffuse reflection map, the target normal map, the target roughness map and the target metal degree map without high-quality texture carving and manual drawing, thereby greatly saving manpower and time cost while ensuring the product quality, the drawing efficiency of the map is improved.
Referring to fig. 3, fig. 3 is another schematic flow chart of a mapping method according to an embodiment of the present application, where the method mainly includes steps 201 to 206, which are described as follows:
step 201: and drawing a category mapping according to the original mapping and a built-in principle, wherein the category mapping comprises a plurality of color areas.
The specific embodiment of step 201 may refer to the embodiment of step 101, and is not described again.
Step 202: and extracting local maps from the original maps according to a plurality of color areas, wherein the number of the plurality of color areas is matched with that of the local maps.
Referring to fig. 4, fig. 4 is a process diagram of an example of a mapping method according to an embodiment of the present application, where a is an original map, B is a category map, and B1 and B2 in the category map represent two different colors for identifying different materials, where B1 and a1, and B2 and a2 have mapping relationships. A partial map A1 may be extracted from graph A by specifying B1 in graph B, and a partial map B2 may be extracted from graph A by specifying B2 in graph B.
Step 203: and converting the original map into a plurality of black-and-white masks according to the plurality of color areas of the category map, wherein the number of the black-and-white masks is matched with the number of the plurality of color areas.
The specific implementation of step 203 can refer to the embodiment of step 104, and is not described herein again. It should be noted that, step 202 and step 203 may be executed in parallel or in sequence, which is not limited in this application.
Step 204: and determining a corresponding local diffuse reflection map, a local normal map, a local roughness map and a local metallization map according to the local maps.
For example, continuing with FIG. 4, the local diffuse reflection map A1-1, the local normal map A1-2, the local roughness map A1-3, and the local metallization map A1-4 are obtained from the local map A1
The specific implementation of step 204 can refer to the embodiment of step 103, which is not described herein again.
Step 205: and extracting corresponding areas from the local diffuse reflection mapping, the local normal mapping, the local roughness mapping and the local metal degree mapping according to the black and white mask.
For example, corresponding regions A1-1', A1-2', A1-3', A1-4' are extracted from the local diffuse reflection map A1-1, the local normal map A1-2, the local roughness map A1-3 and the local metallization map A1-4 according to the black and white mask A1', and corresponding regions A2-1', A2-2', A2-3' and A2-4 'are extracted from the local diffuse reflection map A2-1, the local normal map A2-2, the local roughness map A2-3 and the local metallization map A2-4 according to the black and white mask A2'.
The specific implementation of step 205 can refer to the embodiment of step 104, and is not described herein again.
Step 206: and respectively merging the corresponding areas of the local diffuse reflection maps, the corresponding areas of the local normal maps, the corresponding areas of the local roughness maps and the corresponding areas of the local metal degree maps to respectively obtain a target diffuse reflection map, a target normal map, a target roughness map and a target metal degree map.
As shown in FIG. 4, A1-1 'is merged with A2-1' to generate a target diffuse reflection map (FIG. C), A1-2 'is merged with A2-2' to generate a target normal map (FIG. D), A1-3 'is merged with A2-3' to generate a target roughness map (FIG. E), and A1-4 'is merged with A2-4' to generate a target metallization map (FIG. F).
The specific implementation of step 206 can refer to the embodiment of step 104, and is not described herein again.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
The method for drawing the map includes drawing a category map according to an original map and a built-in principle, wherein the category map includes a plurality of color areas, extracting local maps from the original map according to the color areas, the number of the color areas being matched with the number of the local maps, converting the original map into black and white masks according to the color areas of the category map, the number of the black and white masks being matched with the number of the color areas, determining corresponding local diffuse reflection maps, local normal maps, local roughness maps and local metallization maps according to the local maps, extracting corresponding areas from the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metallization maps according to the black and white masks, and finally, respectively drawing corresponding areas of the local diffuse reflection maps, The corresponding areas of the local normal maps, the corresponding areas of the local roughness maps and the corresponding areas of the local metal degree maps are combined to respectively obtain the target diffuse reflection map, the target normal map, the target roughness map and the target metal degree map without high-quality texture carving and manual drawing, so that the product quality is guaranteed, the labor and time cost is greatly saved, and the drawing efficiency of the maps is improved.
In order to better implement the map drawing method according to the embodiment of the present application, an embodiment of the present application further provides a map drawing apparatus. Referring to fig. 5, fig. 5 is a schematic structural diagram of a map drawing apparatus according to an embodiment of the present application. The map drawing apparatus 10 may include a drawing module 11, an extracting module 12, a determining module 13, and a merging module 14.
The drawing module 11 is configured to draw a category mapping according to an original mapping and a built-in principle, where the category mapping includes a plurality of color regions.
And the extracting module 12 is configured to extract the local maps from the original maps according to a plurality of color regions, where the number of the plurality of color regions matches the number of the local maps.
And the determining module 13 is configured to determine a corresponding local diffuse reflection map, a corresponding local normal map, a corresponding local roughness map, and a corresponding local metallization map according to the local map.
And the merging module 14 is configured to merge the multiple local diffuse reflection maps, the multiple local normal maps, the multiple local roughness maps, and the multiple local metal degree maps to obtain a target diffuse reflection map, a target normal map, a target roughness map, and a target metal degree map, respectively.
Specifically, the determining module 13 may be mainly configured to: acquiring a first target maximum value and a first target minimum value of a color level of the local map, and determining the local diffuse reflection map according to the first target maximum value and the first target minimum value; determining a local normal map according to the local diffuse reflection map; determining a local roughness map according to the local normal map; and determining a local metallization map according to the local map and the diffuse reflection map.
Further, the determining module 13 may specifically be configured to: carrying out gray level processing on the local diffuse reflection map; and carrying out Sobel sampling on the local diffuse reflection map subjected to the gray processing to obtain a local normal map.
Further, the determining module 13 may specifically be configured to: carrying out single curvature conversion on the local normal map to obtain a first map; acquiring a second target maximum value and a second target minimum value of the color level of the first map, and adjusting the color level of the first map according to the second target maximum value and the second target minimum value; acquiring a white area of the adjusted first map; subtracting the local diffuse reflection mapping subjected to the gray level processing from the white area to obtain a third mapping; and acquiring a third target maximum value and a third target minimum value of the color level of the third map, and determining the local roughness map according to the third target maximum value and the third target minimum value.
Further, the determining module 13 may specifically be configured to: if the local map is a first local map, determining a local metallization map according to the local map and the local diffuse reflection map, wherein the first local map is a local map corresponding to a preset color area in the plurality of color areas; and if the local map is not the first local map, determining the preset pure color map as the local metal degree map of the local map.
Further, the determining module 13 may specifically be configured to: setting the local mapping to be white to obtain a white mapping; carrying out gray level processing on the local mapping to obtain a gray level mapping of the local mapping; acquiring a fourth target maximum value and a fourth target minimum value of the color level of the gray-scale map, and adjusting the gray-scale map according to the fourth target maximum value and the fourth target minimum value; acquiring the darkest area of the adjusted gray level map; and subtracting the darkest area from the white mapping to obtain a local metal degree mapping.
In some embodiments, the mapping apparatus 10 may further include a conversion module for converting the original map into a plurality of black and white masks according to the plurality of color regions of the category map, the number of black and white masks matching the number of the plurality of color regions.
Specifically, the merge module 14 may be primarily used to: extracting corresponding areas from the local diffuse reflection mapping, the local normal mapping, the local roughness mapping and the local metallization mapping according to the black and white mask; merging the corresponding areas of the local diffuse reflection maps, the corresponding areas of the local normal maps, the corresponding areas of the local roughness maps and the corresponding areas of the local metal degree maps respectively.
The map drawing device 10 provided in the embodiment of the present application draws a category map according to an original map and a built-in principle through a drawing module 11, where the category map includes a plurality of color regions, an extraction module 12 extracts a local map from the original map according to the plurality of color regions, where the number of the plurality of color regions matches the number of the local map, a determination module 13 determines a corresponding local diffuse reflection map, a local normal map, a local roughness map, and a local metal degree map according to the local map, and a merging module 14 merges the plurality of local diffuse reflection maps, the plurality of local normal maps, the plurality of local roughness maps, and the plurality of local metal degree maps to obtain a target diffuse reflection map, a target normal map, a target roughness map, and a target metal degree map, respectively. The device 10 for drawing the chartlet is utilized to automatically generate the diffuse reflection chartlet, the normal chartlet, the roughness chartlet and the metal chartlet directly through the category chartlet without high-quality texture carving and manual drawing, ensures the product quality, greatly saves the labor and time cost, and improves the chartlet drawing efficiency.
In addition, the embodiment of the present application further provides a computer device, where the computer device may be a terminal, and the terminal may be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like. As shown in fig. 6, fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer device 1000 includes a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, and a computer program stored on the memory 602 and executable on the processor. The processor 601 is electrically connected to the memory 602. Those skilled in the art will appreciate that the computer device configurations illustrated in the figures are not meant to be limiting of computer devices and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The processor 601 is a control center of the computer apparatus 1000, connects various parts of the entire computer apparatus 1000 using various interfaces and lines, performs various functions of the computer apparatus 1000 and processes data by running or loading software programs and/or modules stored in the memory 602, and calling data stored in the memory 602, thereby performing overall monitoring of the computer apparatus 1000.
In the embodiment of the present application, the processor 601 in the computer device 1000 loads instructions corresponding to processes of one or more applications into the memory 602, and the processor 601 executes the applications stored in the memory 602 according to the following steps, so as to implement various functions:
drawing a category mapping according to an original mapping and a built-in principle, wherein the category mapping comprises a plurality of color areas;
extracting local maps from the original maps according to a plurality of color areas, wherein the number of the plurality of color areas is matched with the number of the local maps;
determining a corresponding local diffuse reflection map, a local normal map, a local roughness map and a local metallization map according to the local map;
and respectively merging the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metal degree maps to respectively obtain a target diffuse reflection map, a target normal map, a target roughness map and a target metal degree map.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 6, the computer device 1000 further includes: a touch display screen 603, a radio frequency circuit 604, an audio circuit 605, an input unit 606, and a power supply 607. The processor 601 is electrically connected to the touch display screen 603, the radio frequency circuit 604, the audio circuit 605, the input unit 606, and the power supply 607. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 6 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The touch display screen 603 can be used for displaying a graphical user interface and receiving operation instructions generated by a user acting on the graphical user interface. The touch display screen 603 may include a display panel and a touch panel. The display panel may be used, among other things, to display information entered by or provided to a user and various graphical user interfaces of the computer device, which may be made up of graphics, text, icons, video, and any combination thereof. Alternatively, the display panel may be configured in the form of a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), or the like. The touch panel may be used to collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus pen, and the like), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 601, and can receive and execute commands sent by the processor 601. The touch panel may overlay the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 601 to determine the type of the touch event, and then the processor 601 provides a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 603 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two separate components to perform the input and output functions. That is, the touch display screen 603 can also be used as a part of the input unit 606 to implement an input function.
In the embodiment of the present application, a game application is executed by the processor 601 to generate a graphical user interface on the touch display screen 603, where a virtual scene on the graphical user interface includes a 3D model.
The rf circuit 604 may be used for transceiving rf signals to establish wireless communication with a network device or other computer device via wireless communication, and for transceiving signals with the network device or other computer device.
The audio circuit 605 may be used to provide an audio interface between the user and the computer device through speakers, microphones. The audio circuit 605 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 605 and converted into audio data, which is then processed by the audio data output processor 601, and then transmitted to, for example, another computer device via the radio frequency circuit 604, or output to the memory 602 for further processing. The audio circuit 605 may also include an earbud jack to provide communication of peripheral headphones with the computer device.
The input unit 606 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 607 is used to power the various components of the computer device 1000. Optionally, the power supply 607 may be logically connected to the processor 601 through a power management system, so as to implement functions of managing charging, discharging, and power consumption management through the power management system. The power supply 607 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 6, the computer device 1000 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described in detail herein.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
As can be seen from the above, the computer device provided in this embodiment draws a category mapping according to an original mapping and a built-in principle, where the category mapping includes a plurality of color regions; extracting local maps from the original maps according to a plurality of color areas, wherein the number of the plurality of color areas is matched with the number of the local maps; determining a corresponding local diffuse reflection map, a local normal map, a local roughness map and a local metallization map according to the local map; and respectively merging the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metal degree maps to respectively obtain a target diffuse reflection map, a target normal map, a target roughness map and a target metal degree map. High-quality texture carving and manual drawing are not needed, so that the product quality is guaranteed, meanwhile, the labor and time cost are greatly saved, and the drawing efficiency of the map is improved.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer programs can be loaded by a processor to execute the steps in any of the map drawing methods provided in the embodiments of the present application. For example, the computer program may perform the steps of: drawing a category mapping according to an original mapping and a built-in principle, wherein the category mapping comprises a plurality of color areas; extracting local maps from the original maps according to a plurality of color areas, wherein the number of the plurality of color areas is matched with the number of the local maps; determining a corresponding local diffuse reflection map, a local normal map, a local roughness map and a local metallization map according to the local map; and respectively merging the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metal degree maps to respectively obtain a target diffuse reflection map, a target normal map, a target roughness map and a target metal degree map.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic or optical disk, or the like.
Since the computer program stored in the storage medium can execute the steps in any of the map drawing methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any of the map drawing methods provided in the embodiments of the present application can be achieved, which are detailed in the foregoing embodiments and will not be described again here.
The method, the apparatus, the storage medium, and the computer device for mapping provided by the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (11)

1. A map drawing method is characterized by comprising the following steps:
drawing a category mapping according to an original mapping and a built-in principle, wherein the category mapping comprises a plurality of color areas;
extracting local maps from the original maps according to the color regions, wherein the number of the color regions is matched with that of the local maps;
determining a corresponding local diffuse reflection map, a local normal map, a local roughness map and a local metallization map according to the local map;
and respectively merging the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metal degree maps to respectively obtain a target diffuse reflection map, a target normal map, a target roughness map and a target metal degree map.
2. The mapping method according to claim 1, wherein determining the corresponding local diffuse reflection mapping, local normal mapping, local roughness mapping and local metallization mapping according to the local mapping comprises:
acquiring a first target maximum value and a first target minimum value of the color level of the local map, and determining the local diffuse reflection map according to the first target maximum value and the first target minimum value;
determining a local normal map according to the local diffuse reflection map;
determining a local roughness map according to the local normal map;
and determining a local metallization map according to the local map and the diffuse reflection map.
3. The mapping method of claim 2, wherein said determining a local normal map from the local diffuse reflection map comprises:
carrying out gray level processing on the local diffuse reflection map;
and carrying out Sobel sampling on the local diffuse reflection map after the gray processing to obtain a local normal map.
4. The mapping method of claim 2, wherein said determining a local roughness map from said local normal map comprises:
performing single curvature conversion on the local normal map to obtain a first map;
acquiring a second target maximum value and a second target minimum value of the color level of the first map, and adjusting the color level of the first map according to the second target maximum value and the second target minimum value;
acquiring a white area of the adjusted first map;
subtracting the local diffuse reflection mapping subjected to gray level processing from the white area to obtain a third mapping;
and acquiring a third target maximum value and a third target minimum value of the color level of the third map, and determining the local roughness map according to the third target maximum value and the third target minimum value.
5. The mapping method of claim 2, wherein determining a local metallization map from the local map and the diffuse reflection map comprises:
if the local map is a first local map, determining a local metallization map according to the local map and the local diffuse reflection map, wherein the first local map is a local map corresponding to a preset color area in the plurality of color areas;
and if the local map is not the first local map, determining a preset pure color map as a local metal degree map of the local map.
6. The mapping method of claim 5, wherein determining a local metallization map from the local map and the diffuse reflection map comprises:
setting the local mapping to be white to obtain a white mapping;
carrying out gray level processing on the local map to obtain a gray level map of the local map;
acquiring a fourth target maximum value and a fourth target minimum value of the color level of the gray level map, and adjusting the gray level map according to the fourth target maximum value and the fourth target minimum value;
acquiring the darkest area of the adjusted gray level map;
and subtracting the darkest area from the white mapping to obtain a local metal degree mapping.
7. The mapping method of claim 1, further comprising: and converting the original map into a plurality of black-and-white masks according to a plurality of color areas of the category map, wherein the number of the black-and-white masks is matched with the number of the color areas.
8. The mapping method according to claim 7, wherein said merging the plurality of local diffuse reflection maps, the plurality of local normal maps, the plurality of local roughness maps, and the plurality of local metallization maps, respectively, comprises:
extracting corresponding areas from the local diffuse reflection mapping, the local normal mapping, the local roughness mapping and the local metallization mapping according to the black and white mask;
merging corresponding regions of the local diffuse reflection maps, corresponding regions of the local normal maps, corresponding regions of the local roughness maps and corresponding regions of the local metallization maps respectively.
9. A map drawing apparatus, comprising:
the drawing module is used for drawing a category mapping according to an original mapping and a built-in principle, wherein the category mapping comprises a plurality of color areas;
the extracting module is used for extracting local maps from the original maps according to the plurality of color areas, and the number of the plurality of color areas is matched with that of the local maps;
the determining module is used for determining a corresponding local diffuse reflection map, a local normal map, a local roughness map and a local metal degree map according to the local map;
and the merging module is used for respectively merging the local diffuse reflection maps, the local normal maps, the local roughness maps and the local metal degree maps to respectively obtain a target diffuse reflection map, a target normal map, a target roughness map and a target metal degree map.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method according to any of claims 1 to 8 are implemented when the computer program is executed by the processor.
11. A storage medium having a computer program stored thereon, wherein the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 8.
CN202110260983.2A 2021-03-10 2021-03-10 Mapping method, mapping device, computer equipment and storage medium Active CN112837403B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110260983.2A CN112837403B (en) 2021-03-10 2021-03-10 Mapping method, mapping device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110260983.2A CN112837403B (en) 2021-03-10 2021-03-10 Mapping method, mapping device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112837403A true CN112837403A (en) 2021-05-25
CN112837403B CN112837403B (en) 2023-08-08

Family

ID=75929886

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110260983.2A Active CN112837403B (en) 2021-03-10 2021-03-10 Mapping method, mapping device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112837403B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102254340A (en) * 2011-07-29 2011-11-23 北京麒麟网信息科技有限公司 Method and system for drawing ambient occlusion images based on GPU (graphic processing unit) acceleration
US20130321441A1 (en) * 2012-06-05 2013-12-05 Aroon Pahwa Method, system and apparatus for rendering a map according to texture masks
CN109949386A (en) * 2019-03-07 2019-06-28 北京旷视科技有限公司 A kind of Method for Texture Image Synthesis and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102254340A (en) * 2011-07-29 2011-11-23 北京麒麟网信息科技有限公司 Method and system for drawing ambient occlusion images based on GPU (graphic processing unit) acceleration
US20130321441A1 (en) * 2012-06-05 2013-12-05 Aroon Pahwa Method, system and apparatus for rendering a map according to texture masks
CN109949386A (en) * 2019-03-07 2019-06-28 北京旷视科技有限公司 A kind of Method for Texture Image Synthesis and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
姚超;: "浅谈切线空间法线贴图在三维建模中的应用", 大众文艺, no. 23, pages 96 - 97 *
王冬;: "关于次世代游戏3D高精模型制作与表现的研究", 山东工业技术, no. 04, pages 233 *

Also Published As

Publication number Publication date
CN112837403B (en) 2023-08-08

Similar Documents

Publication Publication Date Title
CN109741280B (en) Image processing method, image processing device, storage medium and electronic equipment
CN113052947B (en) Rendering method, rendering device, electronic equipment and storage medium
CN112053423B (en) Model rendering method and device, storage medium and computer equipment
CN112465945B (en) Model generation method and device, storage medium and computer equipment
CN113546411A (en) Rendering method and device of game model, terminal and storage medium
CN114782605A (en) Rendering method and device of hair virtual model, computer equipment and storage medium
CN117455753A (en) Special effect template generation method, special effect generation device and storage medium
CN113018856A (en) Image processing method, image processing device, electronic equipment and storage medium
CN112837403B (en) Mapping method, mapping device, computer equipment and storage medium
CN113350792A (en) Contour processing method and device for virtual model, computer equipment and storage medium
CN116797631A (en) Differential area positioning method, differential area positioning device, computer equipment and storage medium
CN117876515A (en) Virtual object model rendering method and device, computer equipment and storage medium
CN116328298A (en) Virtual model rendering method and device, computer equipment and storage medium
CN117058298A (en) Texture tiling method, texture tiling device, computer-readable storage medium and computer device
CN115984528A (en) Mapping generation method and device for virtual model, computer equipment and storage medium
CN117541674A (en) Virtual object model rendering method and device, computer equipment and storage medium
CN115888092A (en) Mapping processing method and device for virtual object, computer equipment and storage medium
CN115861519A (en) Rendering method and device of hair model, computer equipment and storage medium
CN115731339A (en) Virtual model rendering method and device, computer equipment and storage medium
CN117618898A (en) Map generation method, map generation device, electronic device and computer readable storage medium
CN115631276A (en) Animation production method, animation production device, computer equipment and computer readable storage medium
CN116993884A (en) Texture data generation method, texture generation model training method and device
CN115526973A (en) Skin rendering method and device, electronic equipment and storage medium
CN115775283A (en) Image compression method, device, storage medium and computer equipment
CN115645917A (en) Virtual model processing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant