Normal map generation method and device and electronic equipment

By generating target images and updating material parameters, the problems of low normal map generation efficiency and high iteration cost in the prior art are solved, and more efficient model structure modification and normal map generation are achieved.

CN119625114APending Publication Date: 2025-03-14NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411535151.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The prior art is inefficient and iteratively cost when generating normal maps of mechanical models, especially when the details are frequently adjusted or sizes are required, and it is necessary to return to the model production stage to re-engrave, resulting in an increase in time and labor costs.

Method used

By generating a target image based on the preset first image and second image, determining the material parameters corresponding to the target image, updating the target image in response to the adjustment instructions of the material parameters, and finally generating the target normal map. This method includes information such as the structural line position of the model, the shape and relative position of the model structure that needs to be added, so that users can make changes according to their needs.

Benefits of technology

It improves the efficiency of modifying the model structure, reduces labor costs, reduces the number of reworks during the iteration process, and achieves faster and more flexible normal map generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625114A_ABST
    Figure CN119625114A_ABST
Patent Text Reader

Abstract

The invention provides a normal map generation method and device and electronic equipment, and the method comprises the steps: generating a target image based on a preset first image and a preset second image, and determining a material parameter corresponding to the target image; in response to an adjustment instruction for the material parameters, adjusting the material parameters; and updating the target image based on the adjusted material parameters, and generating a target normal map based on the lines, the closed region and the relative position between the lines and the closed region in the updated target image. In the mode, the target image comprises information such as the position of the structure line of the model, the shape of the model structure needing to be added and the relative position between the structure line and the model structure needing to be added, the information can serve as material parameters corresponding to the target image, a user can conveniently change the information according to needs, and then the information can be obtained according to relevant information in the changed target image. The new normal chartlet is generated, the modification efficiency of the model structure of the model is improved, and the labor cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of rendering technology, and in particular to a method, device and electronic device for generating a normal map. Background Art

[0002] When making a mechanical model, you need to make some details for the mechanical model, such as various bumps and grooves on the spacecraft model. These details make the mechanical model feel more realistic. The above bumps, grooves and other details are usually distributed along certain structural lines of the mechanical model.

[0003] In the related art, the required details can be carved out in the model in the modeling software, and the detailed normal map can be made by the carved model. However, model making takes a relatively long time, especially when a large number of models need to be made. In addition, when the detail position or size is not suitable for adjustment, it is necessary to return to the model making stage to re-carve and bake, which is costly for optimization iteration. It is also possible to directly draw the normals of the model with details such as convexities and concave grooves in some model mapping software, import the model into the model mapping software, create a drawing layer in the software, and only activate the height channel, adjust the degree of drawing convexity and concave, and directly use the brush to draw, and finally export it as a normal map. However, this method also needs to return to the model for redrawing when it is necessary to iterate the detail position or size, which is inefficient. Summary of the invention

[0004] In view of this, an object of the present disclosure is to provide a method, device and electronic device for generating a normal map, so as to improve the efficiency of modifying the model structure of a model and reduce labor costs.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for generating a normal map, the method comprising: generating a target image based on a preset first image and a second image, and determining material parameters corresponding to the target image; wherein the first image displays a plurality of lines; the lines represent structural lines of a specified model; the second image displays a closed area; the closed area model structure corresponds to a preset model structure; the material parameters are used to indicate at least one of the following: the position of the lines in the first image, the relative position of the model structure and the structural lines, the shape, size, number, density of the model structure, the degree of protrusion or depression of the structural lines, and the degree of protrusion or depression of the model structure; adjusting the material parameters in response to an adjustment instruction for the material parameters; updating the target image based on the adjusted material parameters, and generating a target normal map based on the lines, closed areas, and the relative position between the lines and the closed areas in the updated target image.

[0006] In a second aspect, an embodiment of the present disclosure provides a device for generating a normal map, the device comprising: a target image generation module, for generating a target image based on a preset first image and a second image, and determining material parameters corresponding to the target image; wherein the first image displays a plurality of lines; the lines represent structural lines of a specified model; the second image displays a closed area; the closed area is determined based on the shape of a preset model structure; the material parameters are used to indicate at least one of the following: the position of the lines in the first image, the relative position of the model structure and the structural lines, the shape, size, number, density of the model structure, the degree of protrusion or depression of the structural lines, and the degree of protrusion or depression of the model structure; a material parameter adjustment module, for adjusting the material parameters in response to an adjustment instruction for the material parameters; a target normal map generation module, for updating the target image based on the adjusted material parameters, and generating a target normal map based on the lines, closed areas, and the relative position between the lines and the closed areas in the updated target image.

[0007] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned normal map generation method.

[0008] The embodiments of the present invention bring the following beneficial effects:

[0009] The above-mentioned method, device and electronic device for generating a normal map generate a target image based on a preset first image and a second image, and determine the material parameters corresponding to the target image; adjust the material parameters in response to an adjustment instruction for the material parameters; update the target image based on the adjusted material parameters, and generate a target normal map based on the lines, closed areas and the relative positions between the lines and closed areas in the updated target image. In this method, the target image contains information such as the position of the structural lines of the model and the shape of the model structure to be added and the relative position between the two. This information can be used as the material parameters corresponding to the target image, which is convenient for users to change according to their needs, and then a new normal map can be generated according to the relevant information in the changed target image, thereby improving the efficiency of modifying the model structure of the model and reducing the labor cost. Other features and advantages of the present disclosure will be described in the subsequent description, and part of them will become obvious from the description, or be understood by implementing the present disclosure. The purpose and other advantages of the present disclosure are realized and obtained by the structures specifically pointed out in the description, claims and drawings.

[0010] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0012] Figure 1 A flow chart of a method for generating a normal map provided in an embodiment of the present disclosure;

[0013] Figure 2 A schematic diagram of an extension direction of a structure line and a direction perpendicular to the extension direction provided by an embodiment of the present disclosure;

[0014] Figure 3 A schematic diagram of a first image provided by an embodiment of the present disclosure;

[0015] Figure 4 A schematic diagram of a second image corresponding to a model structure provided in an embodiment of the present disclosure;

[0016] Figure 5 A schematic diagram of a structure line corresponding to a path node provided in an embodiment of the present disclosure;

[0017] Figure 6 A schematic diagram of a target image provided by an embodiment of the present disclosure;

[0018] Figure 7 A schematic diagram of a normal map provided in an embodiment of the present disclosure;

[0019] Figure 8 A schematic diagram of the structure of a normal map generation device provided by an embodiment of the present disclosure;

[0020] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0022] In some game projects, it is necessary to make some details for mechanical models. For example, different details are made for different spaceship models. These details can include various grooves, small bumps, small pits, etc. on the spaceship to make the spaceship feel more realistic. The requirements for details are mainly to distribute some pits of different shapes along certain structural lines of the spaceship. These spaceship details are mainly achieved by making detail normals.

[0023] In the related art, a high-poly baked detail normal map can be directly produced. For example, the required details are first carved out in the model in the modeling software, and the carved high-poly and low-poly are baked into the required detail normals.

[0024] You can also directly draw the normal map of the model through some model mapping software, such as drawing through SubstancePainter (abbreviated as "SP"). In the implementation process, you need to import the model into SubstancePainter. Create a drawing layer in sp (abbreviation for SubstancePainter), activate only the height channel, adjust the degree of drawing bumps and directly use the brush to draw, and finally export it as a normal map.

[0025] Drawing in Substance Painter takes less time than making models directly, but it is also not very friendly for later iterations. When it is necessary to iterate on the position or size of details, it is also necessary to return to the model and redraw it.

[0026] Based on this, the embodiments of the present disclosure provide a method, device and electronic device for generating a normal map, and the technology can be applied to scenes that require model rendering.

[0027] See also Figure 1 First, a method for generating a normal map provided by an embodiment of the present invention is introduced. The method comprises the following steps:

[0028] Step S102, based on the preset first image and second image, generate a target image, and determine the material parameters corresponding to the target image; wherein the first image displays a plurality of lines; the lines represent the structural lines of a specified model; the second image displays a closed area; the closed area model structure corresponds to the preset model structure; the material parameters are used to indicate at least one of the following: the position of the lines in the first image, the relative position of the model structure and the structural line, the shape, size, quantity, density of the model structure, the degree of protrusion or depression of the structural line, and the degree of protrusion or depression of the model structure.

[0029] The above-mentioned first image can be a black and white image or a color image. The lines displayed in the first image represent the structural lines of the specified model. The position of the lines in the first image is consistent with the position of the structural lines in the specified model. The first image can be regarded as a texture coordinate map of the specified model, and the position of the lines in the first image can be determined by unfolding the texture coordinates of the structural lines of the specified model. The surfaces of the specified model corresponding to the two sides of the above-mentioned structural line usually have a height difference, or the model surfaces on both sides of the structural line are not integrated and belong to two parts. It can be set specifically according to needs and is not limited here.

[0030] The above-mentioned second image can usually be a color image, a black and white image, or a black image with only black pixels. The closed area in the second image is determined based on the shape of a preset model structure. The above-mentioned model structure usually refers to a structure that is smaller than the size of a specified model, and can be a groove, a protrusion, or a structure combining a groove and a protrusion, etc., which is not limited here. The shape of the closed area is usually the same as the shape of the main view of the model structure, and can also be the same as the shape of other views, which is not limited here. The second image can be one or more.

[0031] When generating a target image, the closed area in the second image is usually added to the first image. The specific number of closed areas added and the location of the added areas can be set according to the needs. As mentioned above, the model structure is usually distributed along the structure line. The position between the model structure and the structure line is usually determined, or has a certain distance range. For example, the lower edge of the model structure can be aligned with the structure line, or it can have a certain distance, or it can be within a preset distance threshold. The relative position between model structures of different shapes and the structure line can be different. It is set based on the needs and is not limited here.

[0032] Since the closed area is used to simulate the model structure and the lines represent the structural lines, once the relative position of the model structure and the structural line is determined, the position in the first image where the closed area needs to be added can be determined based on the relative position, and the closed area in the second image can be added to the first image. It is usually necessary to add multiple model structures to the surface of a specified model, and correspondingly, it is necessary to add multiple closed areas to the first image. The determined relative position of the model structure and the structural line usually refers to the position perpendicular to the extension direction of the structural line, and the position of the model structure in the extension direction of the structural line is usually uncertain. At this time, the position of the closed area corresponding to the model structure in the first image can be determined in a random manner.

[0033] When determining the location of the closed area in the first image, if the density is set, this parameter needs to be taken into account. The density usually defines the distance between adjacent model structures, usually a distance range, and the distance between adjacent model structures needs to be limited to this distance range.

[0034] The parameters used in the process of generating the target image can be opened to the user as material parameters, and the user can update the target image by setting these material parameters.

[0035] Step S104: adjusting the material parameters in response to the adjustment instruction for the material parameters.

[0036] As described above, the material parameters may include one or more. The material parameters may be used to indicate one or more of the position of the line in the first image, the relative position of the model structure and the structure line, the shape, size, quantity, density of the model structure, the convexity or concavity of the structure line, and the convexity or concavity of the model structure. The material parameters may be set according to the requirements and are not limited here.

[0037] For a model, its structural lines are usually fixed. If the material parameters can indicate the position of the lines in the first image, when the user can change the material parameters, it means that the target image can be controlled to be applied to other models. Usually, by updating the first image, an image showing the structural lines of other models can be introduced to apply the target image to other models. At this time, the position of the lines in the first image usually changes. Similar to the first image, since the shape of the model structure is represented by the closed area of ​​the second image, the shape of the model structure can be updated by inputting a new second image, deleting the original second image, etc.

[0038] Among the material parameters, the parameters for the relative position of the model structure and the structure line may generally include the distance parameter between the model structure and the structure line in the direction perpendicular to the extension direction, and the distance parameter between the model structure and the structure line in the extension direction. Figure 2 As shown in FIG. 1 , the extension direction of the structure line is the direction indicated by arrow a, and the vertical direction of the extension direction of the structure line is the direction indicated by arrow b. The structure line can be a straight line or a curve. Figure 2 Take a straight line as an example. The user can update the distance parameter by inputting the parameter value corresponding to the distance parameter or adjusting the value corresponding to the control corresponding to the distance parameter.

[0039] The size, quantity and density of the above model structures are all related to numerical values, and corresponding parameters can be set respectively. The user can update the above parameters by inputting the parameter value corresponding to the parameter or adjusting the numerical value corresponding to the control corresponding to the parameters.

[0040] The convexity or concavity of the structural line and the convexity or concavity of the model structure can be expressed by numerical values. Usually, the larger the numerical value is, the greater the convexity or concavity is; and the positive and negative values ​​can correspond to the convexity or concavity respectively. Therefore, corresponding parameters can also be set for the convexity or concavity of the structural line and / or the convexity or concavity of the model structure in the material parameters. The user can update the parameter by inputting the parameter value corresponding to the parameter or adjusting the numerical value corresponding to the control corresponding to the parameter.

[0041] Step S106, updating the target image based on the adjusted material parameters, and generating a target normal map based on the lines, closed areas, and relative positions between the lines and closed areas in the updated target image.

[0042] After the material is updated, the target image can be updated based on the adjusted material parameters. The process of updating the target image is similar to the process of generating the target image, which will not be described in detail here. After the updated target image is generated, it is necessary to generate a target normal map based on the target image. When generating the target normal map, it is usually necessary to convert the target image into a black and white image, or the first image and the second image can be converted into black and white images in advance, and the generated target image is also a black and white image. It is also necessary to read the parameter values ​​of the parameters representing the structural lines or the degree of depression, as well as the convexity or concavity of the model structure in the material parameters corresponding to the target image, and determine the height of the lines in the target image and the height of the closed area. The height of the white area in the target image is usually set to 0, or it can be set to other heights, which are not set here. Then, the target normal map can be generated based on the above-mentioned height parameters and the black part in the target image.

[0043] The above-mentioned method for generating a normal map generates a target image based on a preset first image and a second image, and determines the material parameters corresponding to the target image; adjusts the material parameters in response to an adjustment instruction for the material parameters; updates the target image based on the adjusted material parameters, and generates a target normal map based on the lines, closed areas, and the relative positions between the lines and closed areas in the updated target image. In this method, the target image contains information such as the position of the structural lines of the model, the shape of the model structure to be added, and the relative position between the two. This information can be used as the material parameters corresponding to the target image, which is convenient for users to change according to their needs, and then a new normal map can be generated based on the relevant information in the changed target image, thereby improving the efficiency of modifying the model structure of the model and reducing labor costs.

[0044] The following embodiment provides a specific method for generating a target image based on a preset first image and a second image, and determining material parameters corresponding to the target image.

[0045] As described above, the lines displayed in the first image represent the structural lines of the specified model. When the first image is a color image, different colors can be set in different structural areas, so that the lines dividing the two structural areas are represented as structural lines. When the first image is a black and white map, the area except the lines in the first image is usually white. If the first image is not a black and white image, the first image needs to be converted into a black and white image. In the converted first image, only the line part corresponding to the structural line is black, and the other parts are white.

[0046] The second image may be one or more. The shapes of the closed areas in different second images are usually different, corresponding to different model structures. The inside of the closed area in the second image may be set to black, and the outside of the closed area in the second image may be set to white, so as to facilitate identification of the shape of the closed area.

[0047] When generating the target image, it is necessary to add a closed area in the first image based on the preset structure adding parameters and the position of the lines in the first image to obtain the target image. Among them, the structure adding parameters are used to indicate: the initial relative position of the model structure and the structure line and the initial number of the model structure. The structure adding parameters can be used to specify: the model structure is located above the horizontal structure line, the number is 4; you can also specify that the model structure is located above the horizontal structure line, and the distance between the structure line and the structure line is 2, the number is randomly determined between 5 and 10, etc. It can be set according to the needs, and there is no restriction here.

[0048] Specifically, it is necessary to determine the target area in the first image based on the relative position of the model structure and the structure line and the position of the line in the first image. The target area may include a position in a line parallel to the line, or may be an area with a length and width near the line, which is specifically determined by the relative position of the set model structure and the structure line. Then, a closed area matching the number of model structures is set in the target area. When setting the closed area in the target area, it may be determined randomly or according to a certain rule. Specifically, a scattered point method may be adopted.

[0049] Point scattering is a technique for randomly generating points in a specific area, which is widely used in many fields such as computer graphics, geographic information systems, game development, etc. The core idea of ​​the point scattering algorithm is to randomly generate a series of points in a given area. These points can be uniformly distributed or generated according to a specific distribution law (such as Gaussian distribution).

[0050] In practical applications, there may be a need to place structural details along horizontal or vertical structural lines, or to place model structures along structural lines whose length is greater than a specified length. Preset conditions can be set according to these requirements, and a target line among multiple lines can be determined according to the preset conditions. Among them, the size and / or direction of the target line meets the preset conditions. Then, based on the relative position of the model structure and the structural line and the position of the target line in the first image, the target area in the first image is determined. At this time, the target area is near the target line, which can meet the requirements.

[0051] The following embodiment provides a specific method for adjusting material parameters in response to an adjustment instruction for material parameters.

[0052] In actual application, the material parameters may indicate: the position of the line in the first image. The user may generate an update instruction for the first image by deleting the existing first image, inputting a new first image, etc. In response to the update instruction for the first image, the updated first image is determined, and then the position of the line in the updated first image is determined.

[0053] In actual application, the material parameters may indicate: the shape of the model structure. The user may generate an adjustment instruction by deleting an existing second image and / or inputting a new second image. In response to an update instruction for the second image, an updated second image is determined, and a closed area in the updated second image is determined.

[0054] The following embodiment provides a specific method for updating a target image based on adjusted material parameters.

[0055] In actual application, the material parameters may indicate the size of the model structure, and the adjustment instructions for the material parameters may be used to update the size of the model structure. For example, an editable window for setting the size of the model structure may be displayed in a graphical user interface, and the user may edit the value in the window to generate an adjustment instruction for the material parameter, and the size of the updated model structure may be determined based on the value.

[0056] After determining the size of the updated model structure, the closed area needs to be reduced or enlarged based on the size of the updated model structure; based on the size of the processed closed area, the target image is updated, usually by replacing the original closed area in the target image with the processed closed area. In some cases, the position of the replaced closed area needs to be adjusted, such as when making the lower edge fit the line.

[0057] The present disclosure also provides another method for generating a normal map. Figure 1In this method, taking the requirement of having some depressions or protrusions of different shapes on some structural lines of the spacecraft as an example, the method of generating the normal map is specifically explained, which can quickly produce a large number of detail normals that meet the requirements and are easy to iterate. Even if iteration is required in the later stage, it only needs to adjust the material parameters, which is quick and convenient.

[0058] This method converts the problem of generating detail normal maps into the problem of generating black and white grayscale maps. It generates a set of materials with strong flexibility for generating black and white grayscale maps through programming, and finally converts the black and white images into normal maps.

[0059] First, a set of materials is generated programmatically in substanceDesigner (hereinafter referred to as SD), which can randomly place any black and white shape image (equivalent to the above-mentioned "second image") on a black and white line image (equivalent to the above-mentioned "first image") to generate a new black and white image (equivalent to the above-mentioned "target image"), and convert it into the initial normal map through the Normal node.

[0060] Then import the material into Substance Painter, and adjust the material parameters according to the spacecraft model to see different detail effects. Finally, export the effects that meet the conditions into a detail normal map.

[0061] According to the above requirements, this method converts the normal map problem into a black and white grayscale map problem, because in SP, the height channel can convert the corresponding places in the model into corresponding height structures by reading the black and white grayscale map. For example, for the black places in the black and white grayscale map, a downward concave structure will be generated at the corresponding place in the model, and the concave program is adjusted by the height parameter in the height channel. Therefore, the problem of generating a normal map that meets the conditions is converted into the problem of generating a black and white grayscale map that meets the conditions, that is, it is necessary to generate a black and white map with black blocks of different shapes at the lines of the spacecraft structure and randomly distributed on the turning lines.

[0062] For the generation of black and white images, this method procedurally generates a set of black and white image materials that can generate qualified images in SD. In SD, different maps can be generated by combining different nodes. Here, a set of map material system is procedurally generated by combining different nodes.

[0063] The specific method is as follows:

[0064] (1) First, you need to prepare a black and white line drawing of the spacecraft turning line, such as Figure 3 As shown in the figure, we can know where to generate grooves through the line drawing. Next, prepare black and white images of grooves of different shapes (equivalent to the above-mentioned "second image"). Figure 4 Various groove black and white images are shown.

[0065] (2) In SD, the black and white line graph is converted into path nodes, and the values ​​are adjusted through the path nodes to select longer lines from the black and white line graph. The path nodes are then converted into spline nodes. After adjustment, the selected lines meet the conditions, such as Figure 5 shown.

[0066] (3) You can scatter dots on the selected spline lines. You can choose a groove black and white image to scatter dots, so that the groove image can be displayed on the black and white line image.

[0067] If you scatter dots directly on the lines, the groove image is flattened in the turning line, not generated on the turning line. In order to control the overlap between the groove shape and the bottom of the groove black and white image, you can adjust the anchor point of the dot scattering image to (0.5, 0), that is, align it with the bottom of the groove image so that the groove shape is generated on the turning line instead of overlapping with the turning line. After scattering dots, you can generate the following Figure 6 Black and white image shown.

[0068] (4) Convert the input black and white line drawing into a normal map through the Normal node. Convert the input map, scattering map, and the size, density, random position, etc. of the scattering map into parameters and export them as materials.

[0069] (5) Put the prepared SD material into SP. In SP, only keep the normal channel to see the performance of the generated spacecraft groove details. Adjust the material parameters in SP. Regardless of the groove shape, random position, size and density, etc., you can easily achieve it by adjusting the material parameters. Adjust the appropriate material parameters according to different spacecrafts. Finally, export the adjusted performance into a normal map. The generated normal map is as follows Figure 7 shown.

[0070] This method can not only quickly generate detailed normal maps that meet the conditions, but also effectively solve the problem of repeated rework in the later iteration process. Only material parameters need to be adjusted during the iteration process.

[0071] For the above method embodiments, see Figure 8 A normal map generation device is shown, the device comprising:

[0072] The target image generation module 802 is used to generate a target image based on a preset first image and a second image, and determine the material parameters corresponding to the target image; wherein the first image displays a plurality of lines; the lines represent the structure lines of a specified model; the second image displays a closed area; the closed area model structure corresponds to the preset model structure; the material parameters are used to indicate at least one of the following: the position of the line in the first image, the relative position of the model structure and the structure line, the shape, size, quantity, density of the model structure, the convexity or concavity of the structure line, and the convexity or concavity of the model structure;

[0073] The material parameter adjustment module 804 is used to adjust the material parameters in response to the adjustment instruction for the material parameters;

[0074] The target normal map generation module 806 is used to update the target image based on the adjusted material parameters, and generate a target normal map based on the lines, closed areas and the relative positions between the lines and closed areas in the updated target image.

[0075] The above-mentioned normal map generation device generates a target image based on a preset first image and a second image, and determines the material parameters corresponding to the target image; adjusts the material parameters in response to an adjustment instruction for the material parameters; updates the target image based on the adjusted material parameters, and generates a target normal map based on the lines, closed areas, and the relative positions between the lines and closed areas in the updated target image. In this method, the target image contains information such as the position of the structural lines of the model, the shape of the model structure to be added, and the relative position between the two. This information can be used as the material parameters corresponding to the target image, which is convenient for users to change according to their needs, and then a new normal map can be generated based on the relevant information in the changed target image, thereby improving the efficiency of modifying the model structure of the model and reducing labor costs.

[0076] The target image generation module is also used to: add a closed area in the first image based on preset structure adding parameters and the position of the lines in the first image to obtain the target image; the structure adding parameters are used to indicate: the initial relative position of the model structure and the structure line and the initial number of the model structure.

[0077] The target image generation module is also used to: determine the target area in the first image based on the relative position of the model structure and the structure line and the position of the line in the first image; and set the closed area matching the number of model structures in the target area.

[0078] The target image generation module is also used to: determine a target line among multiple lines; the size and / or direction of the target line meets preset conditions; and determine a target area in the first image based on the relative position of the model structure and the structure line and the position of the target line in the first image.

[0079] The material parameters are used to indicate: the position of the line in the first image; the material parameter adjustment module is also used to: respond to the update instruction for the first image, determine the updated first image; determine the position of the line in the updated first image.

[0080] The material parameters are used to indicate: the shape of the model structure; the material parameter adjustment module is also used to: respond to the update instruction for the second image, determine the updated second image; determine the closed area in the updated second image.

[0081] The above material parameters are used to indicate the size of the model structure; the target normal map generation module is also used to: based on the updated size of the model structure, reduce or enlarge the closed area; based on the size of the processed closed area, update the target image.

[0082] This embodiment further provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned normal map generation method, for example:

[0083] Based on a preset first image and a second image, a target image is generated, and material parameters corresponding to the target image are determined; wherein the first image displays a plurality of lines; the lines represent structural lines of a specified model; the second image displays a closed area; the closed area model structure corresponds to a preset model structure; the material parameters are used to indicate at least one of the following: the position of the lines in the first image, the relative position of the model structure and the structural lines, the shape, size, number, density of the model structure, the degree of protrusion or depression of the structural lines, and the degree of protrusion or depression of the model structure; in response to an adjustment instruction for the material parameters, the material parameters are adjusted; based on the adjusted material parameters, the target image is updated, and a target normal map is generated based on the lines, the closed areas, and the relative positions between the lines and the closed areas in the updated target image.

[0084] In the above method, the target image contains information such as the position of the structural lines of the model, the shape of the model structure to be added, and the relative position between the two. This information can be used as the material parameters corresponding to the target image, which is convenient for users to change according to their needs. Then, a new normal map can be generated based on the relevant information in the changed target image, which improves the efficiency of modifying the model structure and reduces labor costs.

[0085] Optionally, the step of generating a target image based on the preset first image and second image includes: adding a closed area in the first image based on preset structure adding parameters and the position of lines in the first image to obtain the target image; the structure adding parameters are used to indicate: the initial relative position of the model structure and the structure line and the initial number of the model structure.

[0086] Optionally, the step of adding a closed area in the first image based on preset structure adding parameters and the position of the line in the first image includes: determining the target area in the first image based on the relative position of the model structure and the structure line and the position of the line in the first image; and setting a closed area matching the number of the model structure in the target area.

[0087] Optionally, the step of determining the target area in the first image based on the relative position of the model structure and the structural line and the position of the line in the first image includes: determining the target line among multiple lines; the size and / or direction of the target line meets preset conditions; and determining the target area in the first image based on the relative position of the model structure and the structural line and the position of the target line in the first image.

[0088] Optionally, the above-mentioned material parameters are used to indicate: the position of the line in the first image; in response to the adjustment instruction for the material parameters, the step of updating the material parameters includes: in response to the update instruction for the first image, determining the updated first image; determining the position of the line in the updated first image.

[0089] Optionally, the above-mentioned material parameters are used to indicate: the shape of the model structure; in response to the adjustment instruction for the material parameters, the step of updating the material parameters includes: in response to the update instruction for the second image, determining the updated second image; determining the closed area in the updated second image.

[0090] Optionally, the above-mentioned material parameters are used to indicate the size of the model structure; the step of updating the target image based on the adjusted material parameters includes: reducing or enlarging the closed area based on the updated size of the model structure; and updating the target image based on the size of the processed closed area.

[0091] See also Fig. 9 As shown, the electronic device includes a processor 100 and a memory 101, wherein the memory 101 stores machine executable instructions that can be executed by the processor 100, and the processor 100 executes the machine executable instructions to implement the above-mentioned normal map generation method.

[0092] Further, Fig. 9The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .

[0093] The memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0094] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 100. The above processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the above embodiment in combination with its hardware.

[0095] This embodiment further provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned normal map generation method.

[0096] A method, device and electronic device for generating a normal map provided in an embodiment of the present disclosure include a computer-readable storage medium storing a program code, wherein the program code includes instructions that can be used to execute the method described in the above method embodiment, for example:

[0097] Based on a preset first image and a second image, a target image is generated, and material parameters corresponding to the target image are determined; wherein the first image displays a plurality of lines; the lines represent structural lines of a specified model; the second image displays a closed area; the closed area model structure corresponds to a preset model structure; the material parameters are used to indicate at least one of the following: the position of the lines in the first image, the relative position of the model structure and the structural lines, the shape, size, number, density of the model structure, the degree of protrusion or depression of the structural lines, and the degree of protrusion or depression of the model structure; in response to an adjustment instruction for the material parameters, the material parameters are adjusted; based on the adjusted material parameters, the target image is updated, and a target normal map is generated based on the lines, the closed areas, and the relative positions between the lines and the closed areas in the updated target image.

[0098] In the above method, the target image contains information such as the position of the structural lines of the model, the shape of the model structure to be added, and the relative position between the two. This information can be used as the material parameters corresponding to the target image, which is convenient for users to change according to their needs. Then, a new normal map can be generated based on the relevant information in the changed target image, which improves the efficiency of modifying the model structure and reduces labor costs.

[0099] Optionally, the step of generating a target image based on the preset first image and second image includes: adding a closed area in the first image based on preset structure adding parameters and the position of lines in the first image to obtain the target image; the structure adding parameters are used to indicate: the initial relative position of the model structure and the structure line and the initial number of the model structure.

[0100] Optionally, the step of adding a closed area in the first image based on preset structure adding parameters and the position of the line in the first image includes: determining the target area in the first image based on the relative position of the model structure and the structure line and the position of the line in the first image; and setting a closed area matching the number of the model structure in the target area.

[0101] Optionally, the step of determining the target area in the first image based on the relative position of the model structure and the structural line and the position of the line in the first image includes: determining the target line among multiple lines; the size and / or direction of the target line meets preset conditions; and determining the target area in the first image based on the relative position of the model structure and the structural line and the position of the target line in the first image.

[0102] Optionally, the above-mentioned material parameters are used to indicate: the position of the line in the first image; in response to the adjustment instruction for the material parameters, the step of updating the material parameters includes: in response to the update instruction for the first image, determining the updated first image; determining the position of the line in the updated first image.

[0103] Optionally, the above-mentioned material parameters are used to indicate: the shape of the model structure; in response to the adjustment instruction for the material parameters, the step of updating the material parameters includes: in response to the update instruction for the second image, determining the updated second image; determining the closed area in the updated second image.

[0104] Optionally, the above-mentioned material parameters are used to indicate the size of the model structure; the step of updating the target image based on the adjusted material parameters includes: reducing or enlarging the closed area based on the updated size of the model structure; and updating the target image based on the size of the processed closed area.

[0105] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0106] In addition, in the description of the embodiments of the present disclosure, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.

[0107] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0108] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present disclosure. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0109] Finally, it should be noted that the above embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above embodiments, those skilled in the art should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A method for generating a normal map, characterized in that: include: Generate a target image based on the preset first image and second image, and determine material parameters corresponding to the target image; wherein the first image displays a plurality of lines; The line represents the structure line of the specified model; the second image shows a closed area; the closed area model structure corresponds to a preset model structure; the material parameter is used to indicate at least one of the following: the position of the line in the first image, the relative position of the model structure and the structure line, the shape, size, number, density of the model structure, the convexity or concavity of the structure line, and the convexity or concavity of the model structure; In response to an adjustment instruction for the material parameter, adjusting the material parameter; The target image is updated based on the adjusted material parameters, and a target normal map is generated based on the lines, closed areas, and relative positions between the lines and the closed areas in the updated target image.

2. The method according to claim 1, characterized in that The step of generating a target image based on the preset first image and second image includes: Based on preset structure adding parameters and the position of the lines in the first image, the closed area is added to the first image to obtain a target image; the structure adding parameters are used to indicate: the initial relative position of the model structure and the structure line and the initial number of the model structure.

3. The method according to claim 2, characterized in that The step of adding the closed area in the first image based on preset structure adding parameters and the position of the line in the first image includes: Determine a target area in the first image based on the relative position of the model structure and the structure line and the position of the line in the first image; A number of closed areas matching the number of the model structures is set in the target area.

4. The method according to claim 3, characterized in that The step of determining a target area in the first image based on the relative position of the model structure and the structure line and the position of the line in the first image comprises: Determine a target line among the multiple lines; the size and / or direction of the target line meets a preset condition; Based on the relative position of the model structure and the structure line and the position of the target line in the first image, a target area in the first image is determined.

5. The method according to claim 1, characterized in that The material parameter is used to indicate: the position of the line in the first image; In response to the adjustment instruction for the material parameter, the step of updating the material parameter comprises: In response to the update instruction for the first image, determining an updated first image; The position of the line in the updated first image is determined.

6. The method according to claim 1, characterized in that The material parameters are used to indicate: the shape of the model structure; In response to the adjustment instruction for the material parameter, the step of updating the material parameter comprises: In response to the update instruction for the second image, determining an updated second image; A closed region in the updated second image is determined.

7. The method according to claim 1, characterized in that The material parameter is used to indicate the size of the model structure; The step of updating the target image based on the adjusted material parameters comprises: Based on the updated size of the model structure, the closed area is reduced or enlarged; The target image is updated based on the size of the processed closed area.

8. A device for generating a normal map, characterized in that: The device comprises: A target image generation module, used to generate a target image based on a preset first image and a second image, and determine a material parameter corresponding to the target image; Wherein, the first image displays a plurality of lines; the lines represent the structural lines of the specified model; the second image displays a closed area; the closed area is determined based on the shape of a preset model structure; the material parameter is used to indicate at least one of the following: the position of the lines in the first image, the relative position of the model structure and the structural lines, the shape, size, quantity, density of the model structure, the convexity or concavity of the structural lines, and the convexity or concavity of the model structure; A material parameter adjustment module, configured to adjust the material parameter in response to an adjustment instruction for the material parameter; The target normal map generation module is used to update the target image based on the adjusted material parameters, and generate the target normal map based on the lines, closed areas and the relative positions between the lines and the closed areas in the updated target image.

9. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for generating a normal map according to any one of claims 1 to 7.

10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the method for generating a normal map according to any one of claims 1 to 7.