CN113034661A - Method and device for generating MatCap map - Google Patents
Method and device for generating MatCap map Download PDFInfo
- Publication number
- CN113034661A CN113034661A CN202110316070.8A CN202110316070A CN113034661A CN 113034661 A CN113034661 A CN 113034661A CN 202110316070 A CN202110316070 A CN 202110316070A CN 113034661 A CN113034661 A CN 113034661A
- Authority
- CN
- China
- Prior art keywords
- matcap
- map
- baking
- model
- material ball
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 239000000463 material Substances 0.000 claims abstract description 154
- 230000002194 synthesizing effect Effects 0.000 claims abstract description 13
- 238000013507 mapping Methods 0.000 claims description 52
- 230000000694 effects Effects 0.000 claims description 30
- 238000004590 computer program Methods 0.000 claims description 12
- 238000006073 displacement reaction Methods 0.000 claims description 12
- 238000009877 rendering Methods 0.000 claims description 10
- 238000005070 sampling Methods 0.000 claims description 8
- 230000015572 biosynthetic process Effects 0.000 claims description 4
- 238000003786 synthesis reaction Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 27
- 238000006243 chemical reaction Methods 0.000 description 7
- 238000005286 illumination Methods 0.000 description 7
- 238000004519 manufacturing process Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000006467 substitution reaction Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 239000012634 fragment Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000008188 pellet Substances 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/10—Geometric effects
- G06T15/20—Perspective computation
- G06T15/205—Image-based rendering
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/52—Controlling the output signals based on the game progress involving aspects of the displayed game scene
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/04—Texture mapping
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/50—Lighting effects
- G06T15/55—Radiosity
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Graphics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computing Systems (AREA)
- Geometry (AREA)
- Image Generation (AREA)
Abstract
The embodiment of the invention provides a method and a device for generating a MatCap map, aiming at a low-modulus baking normal map of a preset model; converting the normal map into a replacement map, and generating a first MatCap map according to the replacement map and the MatCap material ball; endowing the MatCap material ball with a low model of the preset model, and baking to obtain a second MatCap map; and synthesizing the first MatCap map and the second MatCap map to obtain a target MatCap map. The MatCap map is obtained by converting the normal map into the replacement map and baking the replacement map, so that the low mould for baking has the details of the high mould after the replacement map is applied, the MatCap map is convenient to bake, and the problems of high baking time cost and insufficient stereoscopic impression of an object caused by directly baking the replacement map are solved.
Description
Technical Field
The invention relates to the technical field of computer graphics, in particular to a method and a device for generating a MatCap map.
Background
At present, a MatCap material rendering scheme is used in game engine rendering. The effect of MatCap is exhibited if one wants to appear on the map, typically using a manual processing scheme: the method directly maps the screenshot with the effect presented by the high mode to the map with the low mode, but the scheme maps a plurality of angles, and the seam is required to be repaired after the mapping is finished, so that the method wastes time and labor, and the method can only ensure that the effect of one mapping angle is good, has obvious directional shadow, cannot meet the condition that the display of a plurality of angles is correct, and has lower manufacturing efficiency.
Another is to implement the scheme by replacing the map: the method is characterized in that a plane matched with low-mode UV is extruded with displacement details, MatCap material display is given to the plane model with the displacement details to bake the MatCap material to a map, however, the low-mode of the scheme needs to bake a displacement map, and the realization in a game flow is relatively troublesome, because the low-mode and the high-mode are two completely different objects, the displacement map is inconvenient to bake, for example, the low-mode baking displacement map is not easy to realize in ZBursh, the effect of baking the displacement map by other software is not good, the baking time cost is high, and the stereoscopic impression of the object is not enough.
Disclosure of Invention
In view of the above, embodiments of the present invention are proposed to provide a method of MatCap map generation and a corresponding apparatus of MatCap map generation that overcome or at least partially solve the above problems.
In a first aspect, an embodiment of the present invention discloses a method for generating a MatCap map, including:
aiming at a low-mould baking normal map of a preset model;
converting the normal map into a replacement map, and generating a first MatCap map according to the replacement map and the MatCap material ball;
endowing the MatCap material ball with a low model of the preset model, and baking to obtain a second MatCap map;
and synthesizing the first MatCap map and the second MatCap map to obtain a target MatCap map.
Optionally, the normal map corresponds to a high mode of the preset model.
Optionally, the generating a first MatCap map according to the replacement map and the MatCap material ball includes:
creating a square patch model;
endowing the replacement chartlet and the MatCap material ball to the square patch model;
and baking the square surface patch model to obtain a first MatCap map.
Optionally, the step of giving the MatCap material ball a low modulus of the preset model and baking to obtain a second MatCap map includes:
determining a color map corresponding to the MatCap material ball;
and endowing the MatCap material ball with a low modulus of the preset model according to the color map, and baking to obtain a second MatCap map.
Optionally, the determining a color map corresponding to the MatCap material ball includes:
acquiring a material image corresponding to the MatCap material ball;
mapping the world normal map of the preset model from-1 to the position between 0 and 1 of the texture map to obtain a mapping result;
and sampling from the material image by taking the mapping result as a texture mapping coordinate to obtain a color map corresponding to the MatCap material ball.
Optionally, the giving the MatCap material ball to a low modulus of the preset model according to the color map, and baking to obtain a second MatCap map includes:
pasting the normal mapping and the color map into a material ball to obtain a MatCap material ball with a normal mapping effect;
and endowing the MatCap material ball with the normal mapping effect with a low model of the preset model, and baking to obtain a second MatCap mapping.
Optionally, the step of giving the MatCap material ball a low modulus of the preset model and baking to obtain a second MatCap map includes:
and endowing the MatCap material ball with a low model of the preset model, and baking by an Arold renderer to obtain a second MatCap map.
Optionally, the synthesizing the first MatCap map and the second MatCap map to obtain a target MatCap map includes:
converting the second MatCap map into a gray scale map, and performing color inversion processing on the gray scale map;
and taking the image after the reverse phase processing as a mask of the first MatCap map, and synthesizing the first MatCap map and the second MatCap map after adding the mask to obtain a target MatCap map.
Optionally, the method further comprises:
and rendering the preset model according to the target MatCap map so as to display the preset model with MatCap material effect in a game scene.
In a second aspect, an embodiment of the present invention further discloses a device for generating a MatCap map, including:
the normal map baking module is used for baking a normal map according to a low model of a preset model;
the first map generating module is used for converting the normal map into a replacement map and generating a first MatCap map according to the replacement map and the MatCap material balls;
the second mapping generation module is used for endowing the MatCap material ball with a low model of the preset model and baking to obtain a second MatCap mapping;
and the map synthesis module is used for synthesizing the first MatCap map and the second MatCap map to obtain a target MatCap map.
In a third aspect, an embodiment of the present invention further discloses an electronic device, including:
the device comprises a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, when an electronic device runs, the processor is communicated with the storage medium through the bus, and the processor executes the machine-readable instructions to execute the method according to any one of the embodiment of the invention.
In a fourth aspect, the embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs the method according to any one of the embodiments of the present invention.
The embodiment of the invention has the following advantages:
in the implementation of the invention, the normal map is baked according to the low model of the preset model, the normal map is converted into the replacement map, a first MatCap map is generated according to the replacement map and the MatCap material balls, the MatCap material balls are endowed with the low model of the preset model and baked to obtain a second MatCap map, and the first MatCap map and the second MatCap map are synthesized to obtain the target MatCap map. The method comprises the steps of converting a normal map into a replacement map and baking the replacement map to obtain the MatCap map, enabling a low mould for baking to have details of a high mould, facilitating baking of the MatCap map, avoiding the problems of high baking time cost and insufficient stereoscopic impression of an object caused by direct baking of the replacement map, enabling a MatCap material ball to be given to the low mould of a preset model to be baked to obtain a second MatCap map, enabling the MatCap map to be baked under the global illumination of the MatCap material ball, enabling display of multiple angles to be correct, avoiding obvious directional shadows, not needing to manually process the angles to manufacture corresponding MatCap maps, and improving the efficiency of manufacturing the MatCap map.
Drawings
FIG. 1 is a flowchart illustrating the steps of an embodiment of a method for generating a MatCap map according to the present invention;
FIG. 2 is a schematic illustration of a normal map of the present invention;
FIG. 3A is a schematic view of a low mode of the present invention without a normal map;
FIG. 3B is a schematic view of a low mode with normal map of the present invention;
FIG. 4 is a schematic diagram of a replacement map obtained using the normal map conversion shown in FIG. 2 according to the present invention;
FIG. 5 is a schematic view of a MatCap ball according to the present invention;
FIG. 6 is a schematic illustration of a first MatCap map generated using the MatCap material balls of FIG. 5 in accordance with the present invention;
FIG. 7 is a schematic diagram of rendering a default model using the first MatCap map of FIG. 6 according to the present invention;
FIG. 8 is a schematic illustration of a second MatCap map of the present invention obtained by baking the MatCap pellet of FIG. 5;
FIG. 9 is a schematic diagram of rendering a default model using the second MatCap map of FIG. 8 according to the present invention;
FIG. 10 is a schematic diagram of a target MatCap map synthesized from FIGS. 6 and 8 according to the present invention;
FIG. 11 is a block diagram illustrating an embodiment of a MatCap map generating apparatus according to the present invention;
FIG. 12 is a block diagram of an electronic device of the present invention;
fig. 13 is a block diagram of a storage medium of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a method for generating a MatCap map according to the present invention is shown, where the method specifically includes the following steps:
the preset model can be a preset three-dimensional model, and the preset model needs to realize the MatCap material effect in a game scene.
In order to avoid replacing the map by directly baking the low mold, in the embodiment of the invention, the normal map is baked for the low mold of the preset model, wherein the normal map corresponds to the high mold of the preset model, and the normal map for the high mold is baked for the low mold of the preset model, so that the low mold has the details of the high mold, and the MatCap material ball is easy to bake to the map.
In a specific implementation, since some applications have a normal baking function, the normal map may be baked by the applications for a low model of a preset model, for example, by applications such as knald, ZBrush, and Maya, which is not limited in this embodiment of the present invention. Fig. 2 shows a schematic diagram of a normal map, fig. 3A is a schematic diagram of a low mode without a normal map, fig. 3B is a schematic diagram of a low mode with a normal map, and as can be seen from fig. 3A and 3B, the low mode with a normal map can embody more details of the model and is better in performance.
102, converting the normal map into a replacement map, and generating a first MatCap map according to the replacement map and the MatCap material ball;
in embodiments of the present invention, the normal map may be converted to a displacement map to extrude displacement details of the model. Specifically, the normal map can be converted into a substitution map through knald software, the conversion parameters are set during conversion, so that the converted substitution map meets the condition of realizing high-modulus substitution details, and after the conversion is completed, the conversion result is exported to be the substitution map in a 16-bit Tiff format. Fig. 4 shows a schematic diagram of a permutation map obtained by conversion from the normal map shown in fig. 2.
After the conversion to obtain the replacement map, a first MatCap map may be generated according to the replacement map and a MatCap Material ball, where the MatCap (Material Capture) Material ball may be a preset Material for adding some display effect to the model.
103, endowing the MatCap material ball with a low model of the preset model, and baking to obtain a second MatCap map;
in the embodiment of the invention, the MatCap material ball can be given to the low modulus of the preset model to realize the MatCap material rendering effect, and then the low modulus of the preset model with the MatCap material effect is baked to obtain the second MatCap map.
Specifically, a normal map can be attached to the low model through Maya software, then the MatCap material ball is given the low model, global illumination is added to the environment of the low model, and an Arold renderer is used for baking in the Maya software to obtain a second MatCap map.
And 104, synthesizing the first MatCap map and the second MatCap map to obtain a target MatCap map.
In the embodiment of the present invention, the first MatCap map and the second MatCap map may be synthesized to obtain the finally required first MatCap map and second MatCap map. Specifically, the second MatCap map is made into a mask of the first MatCap map through Adobe Photoshop software, some unnecessary images in the second MatCap map are hidden through the mask, then the mask images are subjected to reverse processing, the first MatCap map and the images subjected to reverse processing are respectively led into the Adobe Photoshop software as different image layers, and then 2 image layers are synthesized to obtain the target MatCap map.
In a preferred embodiment of the present invention, the step 102 may comprise the following sub-steps:
creating a square patch model; endowing the replacement chartlet and the MatCap material ball to the square patch model; and baking the square surface patch model to obtain a first MatCap map.
In an embodiment of the invention, a square patch model is first created for baking a first MatCap map with details of MatCap material balls and displacement maps, the created square patch model is given displacement maps and MatCap material balls, and then the square patch model is baked to obtain the first MatCap map.
As an example, a first MatCap map is obtained by baking a Matcap ball and a displacement map in ZBursh software. Specifically, a square patch model is created in ZBursh software, then UV is expanded to the maximum and is filled in a UV quadrant, the size of a canvas is set to 4096 x 4096, a MatCap material sphere is selected, the model is selected and displayed to a view in a maximized manner, the replacement map in the step 102 is imported, a replacement intensity value is set, the square patch model in the view displays the replaced high-modulus details, and the ZBursh baking of the MatCap material sphere to the map is completed after the image is exported. Fig. 5 shows a schematic diagram of a MatCap ball, fig. 6 shows a schematic diagram of a first MatCap map generated by using the MatCap ball in fig. 5, and fig. 7 shows a schematic diagram of a preset model rendered by using the first MatCap map in fig. 6.
In a preferred embodiment of the present invention, the step 103 may comprise the following sub-steps:
determining a color map corresponding to the MatCap material ball; and endowing the MatCap material ball with a low modulus of the preset model according to the color map, and baking to obtain a second MatCap map.
Specifically, the low mode of the preset model to which the MatCap material ball is assigned can be determined by Maya software. Because the Maya software does not have the MatCap material ball, the MatCap material ball can be endowed with a low modulus of a preset model in the Maya software in a way of creating the MatCap material ball on a material node in the Maya software. In the specific implementation, a color map corresponding to the MatCap material ball is determined, the MatCap material ball is endowed with a low mode of a preset model according to the color map, global illumination is added to the environment of the low mode of the preset model, and an Aronld renderer is used for baking in Maya software to obtain a second MatCap map. Fig. 8 is a schematic diagram showing a second MatCap map obtained by baking the MatCap material ball in fig. 5, and fig. 9 is a schematic diagram showing a preset model rendered by using the second MatCap map in fig. 8 according to the present invention, and it can be seen that the model rendered according to the second MatCap map has an obvious shadow effect.
In a preferred embodiment of the present invention, the determining a color map of a material ball corresponding to the MatCap material includes:
acquiring a material image corresponding to the MatCap material ball; mapping the world normal of the preset model from-1 to the position between 0 and 1 of the texture map to obtain a mapping result; and sampling from the material image by taking the mapping result as a texture mapping coordinate to obtain a color map corresponding to the MatCap material ball.
In the embodiment of the present invention, a material image corresponding to the MatCap material ball may be obtained first, for example, the material image corresponding to the MatCap material ball may be obtained from zscrub software, that is, the material image is obtained by capturing a screen of the MatCap material ball in the zscrub software. Furthermore, texture mapping coordinates sampled from the material image can be determined, so as to obtain a color map corresponding to the MatCap material by sampling from the material image according to the texture mapping coordinates.
Specifically, some setting material nodes are provided in Maya software, including a sampleInfo information sampling tool node, a multiplyDivide multiplication and division tool node, a plusMinusAverage addition and subtraction average node, an aiImage image node, and the like, and a color map corresponding to the MatCap material ball can be determined through these material nodes.
In a specific implementation, after a sampleInfo node in Maya is used to link a multiplyDivide node, a parameter is set to multiply by 0.5 in a multiply-divide attribute of the multiplyDivide node, then the multipledivide node is used to link a plosMinusaverage node, and a parameter is set to add 0.5 in an add-subtract-average attribute of the plosMinusaverage node, through the linking of the material nodes, a world normal of each patch in a preset model can be mapped from original-1 to 0 to 1 of a texture map in a fragment shader, so as to obtain a mapping result, and the mapping result is used as a texture map coordinate. And finally, using a plusMinusAverage node to link the aiImage node, importing a material image corresponding to the MatCap material ball into the image attribute of the aiImage node, and pasting the material image on uv of the ailmage node of the Matcap map, so that sampling can be performed from the material image according to the texture map coordinates to obtain a color map corresponding to the MatCap material ball.
In a preferred embodiment of the present invention, the giving the MatCap material ball to the low modulus of the preset model according to the color map, and baking to obtain a second MatCap map includes:
pasting the normal mapping and the color map into a material ball to obtain a MatCap material ball with a normal mapping effect; and endowing the MatCap material ball with the normal mapping effect with a low model of the preset model, and baking to obtain a second MatCap mapping.
In the embodiment of the invention, the MatCap material ball with the normal mapping effect can be obtained by mapping the normal to the material ball, and mapping the color map corresponding to the MatCap material ball to the material ball with the normal mapping, and then the MatCap material ball with the normal mapping effect is endowed with the low modulus of the preset model, and is baked to obtain the second MatCap mapping. The material ball for pasting the normal map may be a preset material ball, for example, an aisandardsurface material ball in Maya software, and creating a MatCap material ball with a normal map effect in Maya software by pasting a color map corresponding to the MatCap material ball to the material ball with the normal map may be implemented by pasting a color map corresponding to the MatCap material ball to the material ball with the normal map.
Specifically, Maya software may further include an aiFalt node and an aiStandardSurface material ball node, and a normal map is introduced into the aiStandardSurface node by linking the aiImage node to the aiFalt node and then linking the aiStandardSurface node to the aiStandardSurface node by using the aiFalt node, so that the normal map may be attached to the aiStandardSurface material ball, and a color map corresponding to the MatCap material ball is attached to the aiStandardSurface material ball to which the normal map is attached, thereby obtaining the MatCap material ball with the normal map effect.
In a preferred embodiment of the present invention, the step of assigning the MatCap material ball to a low mode of the preset model and baking to obtain a second MatCap map includes:
and endowing the MatCap material ball with a low model of the preset model, and baking the MatCap material ball through a renderer to obtain a second MatCap map.
In the embodiment of the invention, the MatCap material ball can be endowed with a low modulus of the preset model, and the low modulus of the preset model is baked by the renderer to obtain the second MatCap map.
As an example, baking may be performed by an Aronld renderer, the function of the Aronld renderer is integrated in Maya software, and baking may be performed by the Aronld renderer at the Aronld renderer to obtain the second MatCap map. Specifically, because the ai standard surface material ball of Maya software is used, during baking, aiSkyDomeLights need to be created to be used as global illumination, and the second MatCap map is obtained by baking under the global illumination. Due to the fact that global illumination is added, the display effect of each angle in the obtained second MatCap map is correct, the corresponding MatCap maps do not need to be manufactured from multiple angles, and manufacturing efficiency is improved. Fig. 7 shows a schematic diagram of a second MatCap map of the present invention.
In a preferred embodiment of the present invention, the synthesizing the first MatCap map and the second MatCap map to obtain a target MatCap map includes:
converting the second MatCap map into a gray scale map, and performing color inversion processing on the gray scale map; and taking the image after the reverse phase processing as a mask of the first MatCap map, and synthesizing the first MatCap map and the second MatCap map after adding the mask to obtain a target MatCap map.
In the embodiment of the present invention, the second MatCap map is made into a mask of the first MatCap map, and the first MatCap map and the second MatCap map are synthesized, so that the expression effect of the MatCap maps can be improved. Specifically, the second MatCap map may be converted into a gray scale map, then the gray scale map is subjected to color inversion processing, the image subjected to the color inversion processing is added to the first MatCap map as a mask, and the first MatCap map and the second MatCap map to which the mask is added are synthesized to obtain the target MatCap map.
The mask serves to hide some unwanted image information, and the composition of the first and second MatCap maps can control whether the color map has shadows, because the second MatCap map baked in Maya has too distinct black shadows, while the first MatCap map baked in ZBrush can cover these black shadows, improving the representation of the MatCap map. Fig. 10 is a schematic diagram illustrating a target MatCap map synthesized from fig. 6 and 8.
In a preferred embodiment of the present invention, the method may further comprise the steps of:
and rendering the preset model according to the target MatCap map so as to display the preset model with MatCap material effect in a game scene.
Specifically, when the game runs and a preset model needs to be displayed in a game scene, the preset model can be rendered according to the target MatCap map so as to display the preset model with the MatCap material effect in the game scene.
In the implementation of the invention, the normal map is baked according to the low model of the preset model, the normal map is converted into the replacement map, a first MatCap map is generated according to the replacement map and the MatCap material balls, the MatCap material balls are endowed with the low model of the preset model and baked to obtain a second MatCap map, and the first MatCap map and the second MatCap map are synthesized to obtain the target MatCap map. The method comprises the steps of converting a normal map into a replacement map and baking the replacement map to obtain the MatCap map, enabling a low mould for baking to have details of a high mould, facilitating baking of the MatCap map, avoiding high baking time cost and insufficient stereoscopic impression of an object caused by direct baking of the replacement map, enabling a MatCap material ball to be given to the low mould of a preset model to be baked to obtain a second MatCap map, enabling the MatCap map to be baked under global illumination of the MatCap material ball, enabling display of multiple angles to be correct, avoiding obvious directional shadows, not needing to manually process the angles to manufacture corresponding MatCap maps, and improving the efficiency of manufacturing the MatCap map.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 11, a block diagram of a structure of an embodiment of an apparatus for generating a MatCap map according to the present invention is shown, and specifically, the apparatus may include the following modules:
a normal map baking module 1101, configured to bake a normal map for a low model of a preset model;
a first map generating module 1102, configured to convert the normal map into a replacement map, and generate a first MatCap map according to the replacement map and a MatCap material ball;
a second map generating module 1103, configured to assign the MatCap material balls to a low model of the preset model, and bake to obtain a second MatCap map;
and the map synthesis module 1104 is configured to synthesize the first MatCap map and the second MatCap map to obtain a target MatCap map.
In a preferred embodiment of the invention, the normal map corresponds to a high modulus of the predetermined model.
In a preferred embodiment of the present invention, the first map generating module 1102 includes:
the patch model creating submodule is used for creating a square patch model;
the material endowing submodule is used for endowing the replacement chartlet and the MatCap material ball to the square surface patch model;
and the baking submodule is used for baking the square dough sheet model to obtain a first MatCap map.
In a preferred embodiment of the present invention, the second map generating module 1103 includes:
the color map determining submodule is used for determining a color map corresponding to the MatCap material ball;
and the second mapping generation submodule is used for endowing the MatCap material ball with a low modulus of the preset model according to the color map, and baking to obtain a second MatCap mapping.
In a preferred embodiment of the present invention, the color map determining sub-module includes:
a material image obtaining unit, configured to obtain a material image corresponding to the MatCap material ball;
the coordinate mapping unit is used for mapping the world normal of the preset model from-1 to the position between 0 and 1 of the texture map to obtain a mapping result;
and the image sampling unit is used for sampling the mapping result from the material image as a texture mapping coordinate to obtain a color map corresponding to the MatCap material ball.
In a preferred embodiment of the present invention, the second map generation sub-module includes:
the material ball generating unit is used for pasting the normal mapping and the color map into the material ball to obtain a MatCap material ball with a normal mapping effect;
and the second mapping generating unit is used for endowing the MatCap material ball with the normal mapping effect with a low model of the preset model, and baking to obtain a second MatCap mapping.
In a preferred embodiment of the present invention, the second map generating module 1103 includes:
and the second map generating module is used for endowing the MatCap material ball with a low model of the preset model and baking the MatCap material ball through a renderer to obtain a second MatCap map.
In a preferred embodiment of the present invention, the map composition module 1104 includes:
the inverse processing submodule is used for converting the second MatCap map into a gray scale map and carrying out color inverse processing on the gray scale map;
and the image synthesis submodule is used for taking the image subjected to the reverse phase processing as a mask of the first MatCap map, and synthesizing the first MatCap map and the second MatCap map added with the mask to obtain a target MatCap map.
In a preferred embodiment of the present invention, the apparatus further comprises:
and the MatCap map rendering module is used for rendering the preset model according to the target MatCap map so as to display the preset model with MatCap material effect in a game scene.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, as shown in fig. 12, including:
the device comprises a processor 1201, a storage medium 1202 and a bus 1203, wherein the storage medium 1202 stores machine readable instructions executable by the processor 1201, when the electronic device runs, the processor 1201 and the storage medium 1202 communicate through the bus 1203, and the processor 901 executes the machine readable instructions to execute the method according to any one of the embodiments of the invention. The specific implementation manner and technical effects are similar to those of the method embodiment, and are not described herein again.
An embodiment of the present invention further provides a computer-readable storage medium, as shown in fig. 13, where a computer program 1301 is stored on the storage medium, and when executed by a processor, the computer program 1301 executes the method according to any one of the embodiments of the present invention. The specific implementation manner and technical effects are similar to those of the method embodiment, and are not described herein again.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The method for generating the MatCap map and the device for generating the MatCap map provided by the invention are described in detail, specific examples are applied in the text to explain the principle and the implementation mode of the invention, and the description of the examples is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, 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 invention.
Claims (12)
1. A method for generating MatCap maps, comprising:
aiming at a low-mould baking normal map of a preset model;
converting the normal map into a replacement map, and generating a first MatCap map according to the replacement map and the MatCap material ball;
endowing the MatCap material ball with a low model of the preset model, and baking to obtain a second MatCap map;
and synthesizing the first MatCap map and the second MatCap map to obtain a target MatCap map.
2. The method of claim 1, wherein the normal map corresponds to a high mode of the pre-set model.
3. The method of claim 1, wherein generating a first MatCap map from the displacement map and MatCap material balls comprises:
creating a square patch model;
endowing the replacement chartlet and the MatCap material ball to the square patch model;
and baking the square surface patch model to obtain a first MatCap map.
4. The method of claim 1, wherein said assigning said MatCap material spheres to a low modulus of said predetermined model and baking to obtain a second MatCap map comprises:
determining a color map corresponding to the MatCap material ball;
and endowing the MatCap material ball with a low modulus of the preset model according to the color map, and baking to obtain a second MatCap map.
5. The method of claim 4, wherein said determining a color map corresponding to said MatCap ball comprises:
acquiring a material image corresponding to the MatCap material ball;
mapping the world normal of the preset model from-1 to the position between 0 and 1 of the texture map to obtain a mapping result;
and sampling from the material image by taking the mapping result as a texture mapping coordinate to obtain a color map corresponding to the MatCap material ball.
6. The method according to claim 4 or 5, wherein said assigning said MatCap material ball to a low modulus of said predetermined model according to said color map and baking to obtain a second MatCap map comprises:
pasting the normal mapping and the color map into a material ball to obtain a MatCap material ball with a normal mapping effect;
and endowing the MatCap material ball with the normal mapping effect with a low model of the preset model, and baking to obtain a second MatCap mapping.
7. The method of claim 1, wherein said assigning said MatCap material spheres to a low modulus of said predetermined model and baking to obtain a second MatCap map comprises:
and endowing the MatCap material ball with a low model of the preset model, and baking the MatCap material ball through a renderer to obtain a second MatCap map.
8. The method of claim 1, wherein said synthesizing said first and second MatCap maps to obtain a target MatCap map comprises:
converting the second MatCap map into a gray scale map, and performing color inversion processing on the gray scale map;
and taking the image after the reverse phase processing as a mask of the first MatCap map, and synthesizing the first MatCap map and the second MatCap map after adding the mask to obtain a target MatCap map.
9. The method according to claim 1 or 8, characterized in that the method further comprises:
and rendering the preset model according to the target MatCap map so as to display the preset model with MatCap material effect in a game scene.
10. An apparatus for generating MatCap map, comprising:
the normal map baking module is used for baking a normal map according to a low model of a preset model;
the first map generating module is used for converting the normal map into a replacement map and generating a first MatCap map according to the replacement map and the MatCap material balls;
the second mapping generation module is used for endowing the MatCap material ball with a low model of the preset model and baking to obtain a second MatCap mapping;
and the map synthesis module is used for synthesizing the first MatCap map and the second MatCap map to obtain a target MatCap map.
11. An electronic device, comprising:
a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the method of any one of claims 1-9.
12. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the method according to any one of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110316070.8A CN113034661B (en) | 2021-03-24 | 2021-03-24 | MatCap map generation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110316070.8A CN113034661B (en) | 2021-03-24 | 2021-03-24 | MatCap map generation method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113034661A true CN113034661A (en) | 2021-06-25 |
CN113034661B CN113034661B (en) | 2023-05-23 |
Family
ID=76473672
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110316070.8A Active CN113034661B (en) | 2021-03-24 | 2021-03-24 | MatCap map generation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113034661B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113808246A (en) * | 2021-09-13 | 2021-12-17 | 深圳须弥云图空间科技有限公司 | Method and device for generating map, computer equipment and computer readable storage medium |
CN114191815A (en) * | 2021-11-09 | 2022-03-18 | 网易(杭州)网络有限公司 | Display control method and device in a game |
WO2023098358A1 (en) * | 2021-12-05 | 2023-06-08 | 北京字跳网络技术有限公司 | Model rendering method and apparatus, computer device, and storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140035940A1 (en) * | 2012-08-06 | 2014-02-06 | Nvidia Corporation | Method and system for generating a displacement map from a normal map |
CN104574488A (en) * | 2014-12-08 | 2015-04-29 | 北京理工大学 | Method for optimizing three-dimensional model for mobile augmented reality browser |
CN107622520A (en) * | 2017-09-29 | 2018-01-23 | 上海开圣影视文化传媒股份有限公司 | The method for accelerating to render |
CN108090946A (en) * | 2017-12-14 | 2018-05-29 | 苏州蜗牛数字科技股份有限公司 | A kind of construction method and device of material ball |
CN108564646A (en) * | 2018-03-28 | 2018-09-21 | 腾讯科技(深圳)有限公司 | Rendering intent and device, storage medium, the electronic device of object |
CN109427088A (en) * | 2017-08-18 | 2019-03-05 | 腾讯科技(深圳)有限公司 | A kind of rendering method and terminal of illumination simulation |
CN109523619A (en) * | 2018-11-12 | 2019-03-26 | 厦门启尚科技有限公司 | A method of 3D texturing is generated by the picture of multi-angle polishing |
CN111563951A (en) * | 2020-05-12 | 2020-08-21 | 网易(杭州)网络有限公司 | Map generation method and device, electronic equipment and storage medium |
CN112037311A (en) * | 2020-09-08 | 2020-12-04 | 腾讯科技(深圳)有限公司 | Animation generation method, animation playing method and related device |
-
2021
- 2021-03-24 CN CN202110316070.8A patent/CN113034661B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140035940A1 (en) * | 2012-08-06 | 2014-02-06 | Nvidia Corporation | Method and system for generating a displacement map from a normal map |
CN104574488A (en) * | 2014-12-08 | 2015-04-29 | 北京理工大学 | Method for optimizing three-dimensional model for mobile augmented reality browser |
CN109427088A (en) * | 2017-08-18 | 2019-03-05 | 腾讯科技(深圳)有限公司 | A kind of rendering method and terminal of illumination simulation |
US20200184714A1 (en) * | 2017-08-18 | 2020-06-11 | Tencent Technology (Shenzhen) Company Limited | Method for renfering of simulating illumination and terminal |
CN107622520A (en) * | 2017-09-29 | 2018-01-23 | 上海开圣影视文化传媒股份有限公司 | The method for accelerating to render |
CN108090946A (en) * | 2017-12-14 | 2018-05-29 | 苏州蜗牛数字科技股份有限公司 | A kind of construction method and device of material ball |
CN108564646A (en) * | 2018-03-28 | 2018-09-21 | 腾讯科技(深圳)有限公司 | Rendering intent and device, storage medium, the electronic device of object |
CN109523619A (en) * | 2018-11-12 | 2019-03-26 | 厦门启尚科技有限公司 | A method of 3D texturing is generated by the picture of multi-angle polishing |
CN111563951A (en) * | 2020-05-12 | 2020-08-21 | 网易(杭州)网络有限公司 | Map generation method and device, electronic equipment and storage medium |
CN112037311A (en) * | 2020-09-08 | 2020-12-04 | 腾讯科技(深圳)有限公司 | Animation generation method, animation playing method and related device |
Non-Patent Citations (5)
Title |
---|
MICHAEL DOGGETT: "Adaptive view dependent tessellation of displacement maps" * |
冯裕良;: "次世代游戏模型贴图的制作方法" * |
姜满如: "Zbrush软件在《造物的智慧》电子出版物中的应用研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 * |
开发游戏的老王: "置换贴图(Displacement map),凹凸贴图(Bump map)与法线贴图(Normal map)的区别", 《HTTPS://WWW.CSDN.NET/》 * |
范津宁: " 一种Unity3D高清材质的渲染方法", 《电脑编程技巧与维护》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113808246A (en) * | 2021-09-13 | 2021-12-17 | 深圳须弥云图空间科技有限公司 | Method and device for generating map, computer equipment and computer readable storage medium |
CN113808246B (en) * | 2021-09-13 | 2024-05-10 | 深圳须弥云图空间科技有限公司 | Method and device for generating map, computer equipment and computer readable storage medium |
CN114191815A (en) * | 2021-11-09 | 2022-03-18 | 网易(杭州)网络有限公司 | Display control method and device in a game |
WO2023098358A1 (en) * | 2021-12-05 | 2023-06-08 | 北京字跳网络技术有限公司 | Model rendering method and apparatus, computer device, and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113034661B (en) | 2023-05-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113034661B (en) | MatCap map generation method and device | |
CN109427088B (en) | Rendering method for simulating illumination and terminal | |
CN107680042B (en) | Rendering method, device, engine and storage medium combining texture and convolution network | |
CN111047506B (en) | Environmental map generation and hole filling | |
JP2018081672A (en) | New view composition using deep-layer convolutional neural network | |
US11276150B2 (en) | Environment map generation and hole filling | |
CN102411791B (en) | Method and equipment for changing static image into dynamic image | |
TW201610915A (en) | Image processing method for transforming 2D image into 3D model | |
CN111429553B (en) | Animation preview method, device, computer equipment and storage medium | |
CN111144491A (en) | Image processing method, device and electronic system | |
WO2018096775A1 (en) | Image processing device, image processing method, and program | |
WO2021171982A1 (en) | Image processing device, three-dimensional model generating method, learning method, and program | |
CN113936084B (en) | Generation method of target elements in virtual sky and related equipment | |
CN117078849A (en) | Normal map generation method and device | |
CN116681854A (en) | Virtual city generation method and device based on target detection and building reconstruction | |
CN112862929B (en) | Method, device, equipment and readable storage medium for generating virtual target model | |
CN112508831B (en) | Ultrasonic wide-view image generation method, device, equipment and storage medium | |
CN109729285B (en) | Fuse grid special effect generation method and device, electronic equipment and storage medium | |
CN114299202A (en) | Processing method and device, storage medium and terminal for virtual scene production | |
CN111726566A (en) | Implementation method for correcting splicing anti-shake in real time | |
CN117252974A (en) | Mapping method and device for three-dimensional image, electronic equipment and storage medium | |
CN111354064B (en) | Texture image generation method and device | |
CN116205787B (en) | Image processing method and storage medium | |
CN119251339A (en) | A multi-modal large model driven image color changing method, system and medium | |
CN117218265A (en) | Hair map generation method, device, electronic equipment and readable 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 |