Method and device for generating hand-drawn material parameters, electronic equipment and storage medium
By acquiring and combining the base, color block, and brushstroke material rendering parameters, hand-drawn material parameters are generated, solving the problem of complex rendering process, achieving fast rendering of hand-drawn effects, and improving rendering efficiency.
Patent Information
- Application Number
- CN202510168571.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2045-02-14
AI Technical Summary
In existing technologies, the rendering process is too complex and the rendering efficiency is low, making it difficult to quickly generate hand-drawn 3D-to-2D materials.
By acquiring the base material, color block material, and brushstroke material rendering parameters of the target 3D model, hand-drawn material parameters are generated. Combined with the prototype BSDF node, Volonoi texture node, and brick wall texture node in 3D computer graphics software, a fast hand-drawn effect can be achieved.
It improves rendering efficiency, enabling the rapid generation of 3D-to-2D materials that combine color blocks and brushstroke effects, simplifying the rendering process and making it suitable for stylized anime-style products.
Smart Images

Figure CN119991906B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, in particular to a hand-drawn material parameter generation method and device, electronic equipment and a storage medium. BACKGROUND
[0002] In the game development design stage, 3D computer graphics software is usually used as an auxiliary method to improve the efficiency of animation production. The 3D computer graphics software is more suitable for realistic style, and the material system of the 3D computer graphics software is also more in line with the logic of the realistic style.
[0003] In related technologies, in order to achieve three-dimensional-to-two-dimensional or hand-drawn effects, one rendering method usually relies on light and hand-drawn maps to achieve the effects, and another rendering method does not rely on light. Light only accounts for a small part of the rendering process, and only light is drawn in the hand-drawn map to achieve different effects. However, the rendering process of the above two methods is too complex, and the rendering efficiency is low. SUMMARY
[0004] Therefore, the embodiments of the present application provide a hand-drawn material parameter generation method and device, electronic equipment and a storage medium to solve the problem of complex rendering process and low rendering efficiency.
[0005] In a first aspect, the embodiments of the present application provide a hand-drawn material parameter generation method, which comprises:
[0006] obtaining a basic material rendering parameter for a target three-dimensional model;
[0007] obtaining a color block material rendering parameter for the target three-dimensional model;
[0008] obtaining a brush stroke material rendering parameter for the target three-dimensional model;
[0009] generating a hand-drawn material parameter for the target three-dimensional model according to the basic material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter, the hand-drawn material parameter being used for material rendering of the target three-dimensional model, so that the rendered model has a hand-drawn effect.
[0010] In a second aspect, the embodiments of the present application also provide a hand-drawn material parameter generation device, which comprises:
[0011] an obtaining module configured to obtain a basic material rendering parameter for a target three-dimensional model;
[0012] The obtaining module is further configured to obtain a color block material rendering parameter for the target three-dimensional model;
[0013] The obtaining module is further configured to obtain a brush stroke material rendering parameter for the target three-dimensional model.
[0014] generate a hand-drawn texture parameter of the target three-dimensional model according to the base texture rendering parameter, the color block texture rendering parameter and the brush stroke texture rendering parameter, the hand-drawn texture parameter being used for texture rendering of the target three-dimensional model, so that the rendered model has a hand-drawn effect.
[0015] In a third aspect, an electronic device is provided, and the electronic device includes a processor, a memory and a bus. The memory stores machine readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory through the bus. The processor executes the machine readable instructions to perform the method in any one of the first aspect.
[0016] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. When the computer program is run by a processor, the computer program performs the method in any one of the first aspect.
[0017] The present application provides a hand-drawn texture parameter generation method and device, an electronic device and a storage medium. The method includes: obtaining a base texture rendering parameter for a target three-dimensional model, obtaining a color block texture rendering parameter for the target three-dimensional model, obtaining a brush stroke texture rendering parameter for the target three-dimensional model, and generating a hand-drawn texture parameter of the target three-dimensional model according to the base texture rendering parameter, the color block texture rendering parameter and the brush stroke texture rendering parameter. The hand-drawn texture parameter is used for texture rendering of the target three-dimensional model, so that the rendered model has a hand-drawn effect. Thus, the rendered model has both color block and brush stroke effects, and the rendering efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0019] Figure 1 Flowchart of the hand-drawn texture parameter generation method provided by the embodiments of the present application Figure One
[0020] Figure 2 Schematic diagram of the target three-dimensional model provided by the embodiments of the present application Figure One
[0021] Figure 3 Schematic diagram of the target three-dimensional model provided by the embodiments of the present applicationFigure Two ;
[0022] Figure 4 Schematic diagram of target three-dimensional model provided for an embodiment of the present application Figure Three ;
[0023] Figure 5 Schematic diagram of process of hand-drawn material parameter generation method provided for an embodiment of the present application Figure Two ;
[0024] Figure 6 Schematic diagram of process of hand-drawn material parameter generation method provided for an embodiment of the present application Figure Three ;
[0025] Figure 7 Schematic diagram of process of hand-drawn material parameter generation method provided for an embodiment of the present application Figure Four ;
[0026] Figure 8 Schematic diagram of process of hand-drawn material parameter generation method provided for an embodiment of the present application Figure Five ;
[0027] Figure 9 Schematic diagram of process of hand-drawn material parameter generation method provided for an embodiment of the present application Figure Six ;
[0028] Figure 10 Schematic diagram of target three-dimensional model provided for an embodiment of the present application Figure Four ;
[0029] Figure 11 Structural schematic diagram of hand-drawn material parameter generation device provided for an embodiment of the present application
[0030] Figure 12 Structural schematic diagram of electronic device provided for an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the following will be combined with the accompanying drawings for the embodiments of the present application to make a clear and complete description of the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0032] Before introducing the technical solutions of the present application, first explain the professional terms involved:
[0033] 3D computer graphics software: supports scene modeling, rendering, animation production, video editing, special effect synthesis and other functions.
[0034] Three-Dimensional (Cel Shading / Toon Shading) is an artistic style of non-realistic rendering, which creates flat colors on the basic colors of three-dimensional objects, making the objects look three-dimensional perspective effect, while maintaining two-dimensional effect, ultimately giving the rendering engine 3D graphics with 2D hand-drawn-like texture hand-drawn effect.
[0035] Voronoi texture node: a procedural texture node used in Blender, Voronoi texture node can be used to generate various complex texture effects, such as realistic metal "hammering" effect, scales or veins on the skin, etc. By adjusting the parameters of the node, different types of textures can be generated, such as orange peel, tree bark, real leather, sponge, water surface, sand beach, etc.
[0036] Brick wall texture node: a texture node used to generate brick wall effect, commonly used in material editing in Blender. By using this node, you can quickly generate surfaces with brick wall texture, and you can change the color and texture effect of the brick wall by adjusting the parameters of the node, some effects of brick wall texture are needed as a supplement to the brush.
[0037] Voronoi texture (Voronoi Texture): a procedural texture generated based on Voronoi diagram. This texture is very popular in computer graphics because it can simulate many phenomena in nature, such as cell structure, rock crack, animal fur pattern, etc.
[0038] Brick texture (Brick Texture): a common procedural texture widely used in computer graphics, game development and architectural design, etc., used to simulate the appearance of real brick walls.
[0039] In related art, to achieve three-dimensional two-dimensional effect or hand-drawn effect, one rendering method usually relies on lighting and hand-drawn map to achieve, another rendering method does not depend on lighting, lighting is only a small part of it, only draw light in hand-drawn map to achieve different effects, however, these two ways are very time-consuming and increase the cost, resulting in a too complex rendering process and low rendering efficiency.
[0040] It is worth noting that, independent of light and shadow is independent of scene light rendering, that is, the main light + ambient light produces the change of light and shadow on the object by calculation, and drawing light and shadow on the map is to optimize the game, and omitting light and shadow calculation can improve the smoothness of the game, so it is necessary to draw light and shadow on the map to create a "false shadow" feeling.
[0041] Based on this, the application generates hand-drawn material parameters of the target three-dimensional model according to the base material rendering parameters, the color block material rendering parameters and the brush material rendering parameters, and the hand-drawn material parameters are used for material rendering of the target three-dimensional model, so as to quickly generate stylized hand-drawn effect materials, so that the rendered model has a three-dimensional two-dimensional material with color block and brush effect, improves the rendering efficiency, and provides a more convenient and fast style implementation means, which can play an advantage in the stylized two-dimensional product.
[0042] Figure 1 The flowchart of the method for generating hand-drawn material parameters provided by the embodiment of the application Figure One The execution subject of the embodiment can be an electronic device, such as a notebook computer, a desktop computer, etc.
[0043] As shown in the figure, Figure 1 The method can include:
[0044] S101, obtaining base material rendering parameters for a target three-dimensional model.
[0045] The target three-dimensional model is a three-dimensional model to be rendered, Figure 2 The schematic diagram of the target three-dimensional model provided by the embodiment of the application Figure One As shown in the figure, Figure 2 The target three-dimensional model may, for example, be a sphere, a monkey head, or a ring.
[0046] The base material rendering parameters are material parameters for base rendering of the target three-dimensional model, which may, for example, include material parameters, appearance parameters, optical parameters, self-luminous parameters, etc., wherein the material parameters are used to indicate the appearance material type, such as metal material, wood material, the appearance parameters are used to indicate the appearance rendering effect, such as hand-drawn effect, and the optical parameters are used to indicate the appearance optical characteristics, such as transparency.
[0047] In an application scenario, a user can select a target three-dimensional model from a plurality of three-dimensional models provided by a 3D computer graphics software, or import the target three-dimensional model into the software, select the target three-dimensional model, click New Principled BSDF and Material in the shader editor, create a Principled BSDF node and a Material Output node for the target three-dimensional model, and click shift a new-Shader-Emission node / Shader to RGB in the shader editor to insert an Emission node and a Shader to RGB node between the Principled BSDF node and the Material Output node. The BSDF interface of the Principled BSDF node can be connected to the Shader interface of the Shader to RGB node, the color interface of the Shader to RGB node can be connected to the color interface of the Emission node, and the Emission interface of the Emission node can be connected to the surface interface of the Material Output node.
[0048] The Principled BSDF node is a physically-based shader node for simulating material appearance and optical properties, and material parameters, appearance parameters, and optical parameters can be set in the configuration interface of the Principled BSDF node. The Emission node is used to simulate appearance surface light, and the emission intensity can be set in the configuration interface of the Emission node. The Shader to RGB node is used to convert the output of a shader into color values (RGB values) that can be seen in an image or rendering result, which involves understanding how the shader works and how it interacts with the rendering engine to determine the color of each pixel. The Material Output node is used to output the properties, colors, textures, and other information of the material to the rendering engine (3D computer graphics software) for use in the rendering process.
[0049] It is worth noting that the parameters set by the Principled BSDF node can be reused, and they can be saved as a "reserve" for application in different tasks and products.
[0050] S102, obtain a color block material rendering parameter for the target three-dimensional model.
[0051] The color block material rendering parameter is a material parameter for color block rendering of the target three-dimensional model, so that the target three-dimensional model has a color block effect. The color block material rendering parameter may, for example, include parameters of a Voronoi texture, and the parameters of the Voronoi texture may include Voronoi texture coordinates. The color block effect can be achieved by using a Voronoi texture.
[0052] In an application scenario, a Voronoi texture node is added before a principled BSDF node in 3D computer graphics software, and a color block material rendering parameter can be set in a configuration interface of the Voronoi texture node.
[0053] Figure 3 A schematic diagram of a target three-dimensional model provided for an embodiment of the present application Figure Two As shown in Figure 3 , the target three-dimensional model is rendered based on the color block material rendering parameter, and it can be seen that the rendered model has a shadow of a light and shade boundary and a light that is segmented and distorted due to the Voronoi texture node, producing a "color block feeling" in traditional painting, and the rendering effect provides clearer design guidance for editing and production.
[0054] S103, obtain a brush stroke material rendering parameter for the target three-dimensional model.
[0055] The brush stroke material rendering parameter is a material parameter for brush stroke rendering of the target three-dimensional model, so that the target three-dimensional model has a brush stroke effect. The brush stroke refers to a brush method in painting, also known as texture, and often refers to the trace of the brush in oil painting and gouache painting. It is a non-flat and smooth effect.
[0056] The brush stroke material rendering parameter may, for example, include a brick wall texture parameter, which may include a scaling factor (determining the size of the brick wall texture element) and a brick wall texture color. The brick wall texture can achieve a brush stroke effect.
[0057] In an application scenario, a brick wall texture node is added before a Voronoi texture node in 3D computer graphics software, and a brush stroke material rendering parameter can be set in a configuration interface of the brick wall texture node. The brick wall texture parameter can make the light and shade boundary of the model more abundant.
[0058] On the basis of Figure 3 , Figure 4 A schematic diagram of a target three-dimensional model provided for an embodiment of the present application Figure Three As shown in Figure 4 , the target three-dimensional model is rendered based on the brush stroke material rendering parameter, and it can be seen that, compared with Figure 3 , the rendered model has a brush stroke effect, and the rendering effect provides clearer design guidance for editing and production.
[0059] S104, generating a hand-drawn material parameter of the target three-dimensional model according to the base material rendering parameter, the color block material rendering parameter, and the brush stroke material rendering parameter. The hand-drawn material parameter is used for material rendering of the target three-dimensional model, so that the rendered model has a hand-drawn effect.
[0060] According to the base material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter, the hand-drawn material parameter of the target three-dimensional model is generated, wherein the hand-drawn material parameter can include the base material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter, so that the target three-dimensional model is rendered based on the hand-drawn material parameter, and the rendered model has the three-dimensional two-dimensional material with color block and brush stroke effects, that is, has the hand-drawn effect.
[0061] In an application scenario, in the 3D computer graphics software, the parameters set by the principle BSDF node, the self-luminous node, the Shader to RGB node, the Voronoi texture node and the brick wall node can be output to the rendering engine by using the material output node to render the target three-dimensional model, so that the rendered model has the hand-drawn effect.
[0062] In the embodiment, according to the base material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter, the hand-drawn material parameter of the target three-dimensional model is generated to render the target three-dimensional model, so that the rendered model has the three-dimensional two-dimensional material with color block and brush stroke effects, which can quickly produce the material object with the hand-drawn effect, expand the style, reduce the repetitive workload and improve the rendering effect.
[0063] The rendering efficiency is improved, and a more convenient and fast style implementation means is provided, which can play an advantage in the stylized two-dimensional product.
[0064] Figure 5 The flowchart of the method for generating the hand-drawn material parameter provided in the embodiment of the application Figure Two As shown in Figure 5 In an optional embodiment, the color block material rendering parameter includes the vector texture parameter of each surface texture element and the concave-convex parameter of each surface texture element.
[0065] The surface texture element is a texture element of the surface of the target three-dimensional model, which can be a Voronoi texture element, and the vector texture parameter of the surface texture element can include the texture coordinate of the surface texture element and the scaling factor (determining the size of the Voronoi texture element).
[0066] The concave-convex parameter is used to indicate the concave-convex condition of the surface texture element of the target three-dimensional model, and the concave-convex parameter can include the concave-convex intensity (intensity) of each surface texture element.
[0067] In an application scenario, a bump node and a Voronoi texture node are added, the bump strength of each surface texture element can be set in the configuration interface of the bump node, and the vector texture parameter of each surface texture element can be set in the configuration interface of the Voronoi texture node.
[0068] The position interface of the Voronoi texture node is connected to the input normal interface of the bump node, and the output normal interface of the bump node is connected to the normal interface of the principled BSDF node.
[0069] The step S104 comprises: generating the hand-drawn material parameters of the target three-dimensional model according to the base material rendering parameter, the patch material rendering parameter and the stroke material rendering parameter.
[0070] S201, mixing according to the stroke material rendering parameter and the vector texture parameter to obtain a target vector texture parameter.
[0071] The stroke material rendering parameter and the vector texture parameter are mixed by using a preset mixing coefficient to obtain the target vector texture parameter, wherein the target vector texture parameter comprises target coordinate information and a target scaling factor of the surface texture element.
[0072] The mixing of the stroke material rendering parameter and the vector texture parameter can be understood as adjusting the vector texture parameter according to the preset mixing coefficient and the stroke material rendering parameter to obtain the target vector texture parameter.
[0073] In an optional embodiment, the step S201 of mixing according to the stroke material rendering parameter and the vector texture parameter to obtain the target vector texture parameter can comprise:
[0074] The stroke material rendering parameter and the vector texture parameter are respectively taken as color parameters of two color channels.
[0075] The color parameters of the two color channels are mixed according to a preset mixing coefficient of the two color channels to obtain the target vector texture parameter.
[0076] The preset mixing coefficient of the two color channels can be set according to actual conditions, for example, can be 0.115, and the embodiment is not particularly limited in this regard. The stroke material rendering parameter and the vector texture parameter are respectively taken as color parameters of two color channels, and the color parameters of the two color channels are mixed according to a preset mixing coefficient of the two color channels to adjust the vector texture parameter and obtain the target vector texture parameter.
[0077] In some embodiments, a mixing node can be added, the vector texture parameter is taken as color channel 1, and the stroke texture rendering parameter is taken as color channel 2. The mixing node is used to add another texture in front of the Voronoi texture node, so as to increase the stroke while keeping the color block.
[0078] In an optional implementation, the method can further include:
[0079] According to the adjustment operation for the preset mixing coefficient, an adjusted mixing coefficient is obtained;
[0080] According to the preset mixing coefficient of the two color channels, the color parameters of the two color channels are mixed to obtain the target vector texture parameter, which can include:
[0081] According to the adjusted mixing coefficient, the color parameters of the two color channels are mixed to obtain the target vector texture parameter.
[0082] The adjustment operation for the preset mixing coefficient is used to adjust the preset mixing coefficient. The user inputs the adjustment operation for the preset mixing coefficient. According to the adjustment operation, an adjusted mixing coefficient is obtained. The stroke texture rendering parameter and the vector texture parameter are taken as the color parameters of the two color channels, respectively. According to the adjusted mixing coefficient, the color parameters of the two color channels are mixed to adjust the vector texture parameter, so as to obtain the target vector texture parameter. The user adjusts the preset mixing coefficient according to the actual demand, so that the generation of the hand-drawn material parameter is more flexible.
[0083] S202, according to the basic material rendering parameter, the target vector texture parameter and the concave-convex parameter, a hand-drawn material parameter is generated.
[0084] After mixing the vector texture parameter, the hand-drawn material parameter can be generated according to the basic material rendering parameter, the target vector texture parameter and the concave-convex parameter. The hand-drawn material parameter can include the basic material rendering parameter, the target vector texture parameter and the concave-convex parameter, so as to perform material rendering on the target three-dimensional model based on the hand-drawn material parameter. The rendered model has the three-dimensional two-dimensional material with color block and stroke effect, that is, has the hand-drawn effect.
[0085] In this embodiment, the target vector texture parameter is obtained by mixing the stroke texture rendering parameter and the vector texture parameter, so that the rendered model has the stroke effect on the basis of the color block effect, refines the hand-drawn effect of the light-dark boundary, and further makes the rendered model have the hand-drawn effect of the light-dark boundary and better color block effect based on the concave-convex parameter.
[0086] Figure 6 Flowchart of the generation method of the hand-drawn material parameter provided by the embodiments of the present application Figure Three AsFigure 6 In an optional embodiment, the step S102 of obtaining the color block material rendering parameter for the target three-dimensional model can include:
[0087] S301, vector mapping is performed on each surface texture element to obtain a vector texture parameter of each surface texture element.
[0088] The texture coordinates of each surface texture element on the surface of the target three-dimensional model are obtained, and the texture coordinates of each surface texture element are vector mapped according to the vector mapping parameter (Mapping) to obtain a vector texture parameter of each surface texture element. The vector texture parameter can include the texture coordinates (Texture Coordinate) of the surface texture element and a scaling factor (determining the size of the Voronoi texture element).
[0089] In some embodiments, the vector mapping parameter can include a vector rotation parameter and / or a vector scaling factor, that is, the texture coordinates of each surface texture element are rotated and / or scaled according to the vector rotation parameter and / or the vector scaling parameter to obtain the vector texture parameter of each surface texture element.
[0090] In an application scenario, a mapping sub-node and a texture coordinate sub-node are generated, the texture coordinate node can display the texture coordinates of each surface texture element, the mapping sub-node can set the vector mapping parameter for each surface texture element, the normal interface in the texture coordinate sub-node is connected to the input vector interface of the mapping sub-node, the output vector interface of the mapping sub-node is connected to the vector interface of the Voronoi texture node, the position interface of the Voronoi texture node is connected to the input normal interface of the bump node, and the output normal interface of the bump node is connected to the normal interface of the principled BSDF node.
[0091] In addition, a mixing node is newly added and connected between the Voronoi texture node and the mapping sub-node, the vector of the mapping sub-node is connected to color channel 1 in the mixing node, and the color interface of the brick texture node (Brick Texture) is connected to color channel 2 of the mixing node. The mixing node is used to add another texture in front of the Voronoi texture node to increase the brush strokes while retaining the color blocks.
[0092] S302, associating each surface texture element with a parameter of a preset bump configuration item to obtain a bump parameter of each surface texture element.
[0093] After the vector texture parameter of each surface texture element is determined, each surface texture element is associated with the parameter of the bump configuration item to perform parameter configuration on the preset bump configuration item to obtain the bump parameter of each surface texture element.
[0094] In the embodiment, the surface texture elements are vector mapped to obtain vector texture parameters of the surface texture elements, so that the color block effect of the rendered model is better, and by associating the surface texture elements with the parameters of the preset concave-convex configuration item, the concave-convex parameters for the surface texture elements are conveniently set, and the operation convenience is improved.
[0095] Figure 7 Flowchart of the generation method of the hand-drawn material parameter provided in the embodiment Figure Four As shown in the figure, Figure 7 In an optional implementation, the step S104 comprises:
[0096] S401, obtaining a target map according to a map adjustment operation corresponding to the base material rendering parameter, and obtaining a target material rendering parameter corresponding to the target map.
[0097] The base material rendering parameter is determined according to a base map corresponding to the base material parameter. The base map may include a color map, a roughness map, a metal map, etc. The base map is subjected to material rendering parameter extraction to obtain the base material rendering parameter.
[0098] The map adjustment operation is used to adjust the base map to the target map. The user inputs a map adjustment operation corresponding to the base material rendering parameter. According to the map adjustment operation, a target map corresponding to the map adjustment operation is obtained, and the target map is subjected to material rendering parameter extraction to obtain the target material rendering parameter.
[0099] S402, generating a hand-drawn material parameter according to the target material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter.
[0100] The hand-drawn material parameter of the target three-dimensional model is generated according to the target material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter. The hand-drawn material parameter may include the target material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter, so as to perform material rendering on the target three-dimensional model based on the hand-drawn material parameter, so that the rendered model has a three-dimensional color block and brush stroke material effect, i.e. a hand-drawn effect.
[0101] In the embodiment, the map is adjusted according to actual needs to generate a hand-drawn material parameter, so that a three-dimensional color block and brush stroke material effect can be obtained using a realistic material, and the flexibility is high.
[0102] Figure 8 Flowchart of the generation method of the hand-drawn material parameter provided in the embodiment Figure Five As shown in the figure,Figure 8 As shown in an optional embodiment, the method can further include:
[0103] S501, according to the adjustment operation of the scaling factor in the brush stroke material rendering parameter, the adjusted brush stroke material rendering parameter is obtained.
[0104] The brush stroke material rendering parameter includes a scaling factor, which can be a scaling factor of a brick wall texture. The adjustment operation of the scaling factor in the brush stroke material rendering parameter is used to adjust the scaling factor in the brush stroke material rendering parameter.
[0105] The user inputs the adjustment operation of the scaling factor in the brush stroke material rendering parameter. According to the mapping operation, the adjusted brush stroke material rendering parameter is obtained, which includes an adjusted scaling factor.
[0106] The step S201 above, according to the brush stroke material rendering parameter and the vector texture parameter, mixing to obtain the target vector texture parameter, can include:
[0107] S502, according to the adjusted brush stroke material rendering parameter and the vector texture parameter, mixing to obtain the target vector texture parameter.
[0108] The preset mixing coefficient is used to mix the adjusted brush stroke material rendering parameter and the vector texture parameter to obtain the target vector texture parameter, wherein the target vector texture parameter includes target coordinate information of the surface texture element.
[0109] The mixing of the adjusted brush stroke material rendering parameter and the vector texture parameter can be understood as adjusting the vector texture parameter according to the preset mixing coefficient and the adjusted brush stroke material rendering parameter to obtain the target vector texture parameter.
[0110] In this embodiment, the scaling factor in the brush stroke material rendering parameter is adjusted according to the actual demand, so that the target vector texture parameter is obtained by mixing the adjusted brush stroke material rendering parameter and the vector texture parameter, so that the generation of the hand-drawn material parameter is more flexible.
[0111] Figure 9 The flowchart of the generation method of the hand-drawn material parameter provided by the embodiment of the application Figure Six As shown in an optional embodiment, the method can further include: Figure 9
[0112] S601, according to the adjustment operation of the scaling factor in the vector texture parameter, the adjusted vector texture parameter is obtained.
[0113] The vector texture parameter includes a scaling coefficient, which can be a scaling coefficient of the Voronoi texture. The adjustment operation for the scaling coefficient in the vector texture parameter is used to adjust the scaling coefficient in the vector texture parameter.
[0114] The user inputs the adjustment operation for the scaling coefficient in the vector texture parameter. According to the adjustment operation, the adjusted vector texture parameter is obtained, which includes an adjusted scaling coefficient.
[0115] The step S201 of mixing the brush stroke material rendering parameter and the vector texture parameter to obtain the target vector texture parameter can include the following steps.
[0116] S602, mixing the brush stroke material rendering parameter and the adjusted vector texture parameter to obtain the mixed target vector texture parameter.
[0117] The brush stroke material rendering parameter and the adjusted vector texture parameter are mixed by using a preset mixing coefficient to obtain the target vector texture parameter, which includes target coordinate information of a surface texture element and a target scaling coefficient.
[0118] The mixing of the brush stroke material rendering parameter and the vector texture parameter can be understood as adjusting the adjusted vector texture parameter according to the preset mixing coefficient and the brush stroke material rendering parameter to obtain the target vector texture parameter.
[0119] In this embodiment, the scaling coefficient in the vector texture parameter is adjusted according to actual needs, so that the brush stroke material rendering parameter and the adjusted vector texture parameter are mixed to obtain the target vector texture parameter, which makes the generation of the hand-drawn material parameter more flexible.
[0120] On the basis of Figure 4 , it can be seen that Figure 4 the density of the brush strokes of the target three-dimensional model in Figure 10 is still a problem (relatively sparse), Figure Four As shown in Figure 10 , by adjusting at least one of the scaling coefficient in the brush stroke material rendering parameter, the preset mixing coefficient, and the scaling coefficient in the vector texture parameter, the brush strokes of the rendered model are more dense, and the hand-drawn effect is better.
[0121] Figure 11 The structure diagram of the hand-drawn material parameter generation device provided by the embodiment of the present application is shown in the figure. The device can be integrated in an electronic device.
[0122] As shown in Figure 11 , the device can include:
[0123] The acquisition module 701 is configured to acquire a base material rendering parameter for the target three-dimensional model;
[0124] The acquisition module 701 is further configured to acquire a patch material rendering parameter for the target three-dimensional model;
[0125] The acquisition module 701 is further configured to acquire a brush stroke material rendering parameter for the target three-dimensional model;
[0126] The generation module 702 is configured to generate a hand-drawn material parameter of the target three-dimensional model according to the base material rendering parameter, the patch material rendering parameter, and the brush stroke material rendering parameter, where the hand-drawn material parameter is used for material rendering of the target three-dimensional model, so that the rendered model has a hand-drawn effect.
[0127] In an optional implementation, the patch material rendering parameter includes a vector texture parameter of each surface texture element and a concave-convex parameter of each surface texture element.
[0128] The generation module 702 is specifically configured to:
[0129] mix the brush stroke material rendering parameter and the vector texture parameter to obtain a target vector texture parameter;
[0130] generate the hand-drawn material parameter according to the base material rendering parameter, the target vector texture parameter, and the concave-convex parameter.
[0131] In an optional implementation, the generation module 702 is specifically configured to:
[0132] take the brush stroke material rendering parameter and the vector texture parameter as color parameters of two color channels, respectively;
[0133] mix the color parameters of the two color channels according to a preset mixing coefficient of the two color channels to obtain the target vector texture parameter.
[0134] In an optional implementation, the acquisition module 701 is specifically configured to:
[0135] perform vector mapping on each surface texture element to obtain the vector texture parameter of each surface texture element;
[0136] associate each surface texture element with a parameter of a preset concave-convex configuration item to obtain the concave-convex parameter of each surface texture element.
[0137] In an optional implementation, the generation module 702 is specifically configured to:
[0138] acquire a target map according to a map adjustment operation corresponding to the base material rendering parameter, and acquire a target material rendering parameter corresponding to the target map;
[0139] generate the hand-drawn material parameter according to the target material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter.
[0140] In an optional implementation, the obtaining module 701 is further configured to:
[0141] obtain the adjusted brush stroke material rendering parameter according to the adjustment operation on the scaling factor in the brush stroke material rendering parameter;
[0142] The generating module 702 is specifically configured to:
[0143] perform mixing according to the adjusted brush stroke material rendering parameter and the vector texture parameter to obtain the target vector texture parameter.
[0144] In an optional implementation, the obtaining module 701 is further configured to:
[0145] obtain the adjusted mixing coefficient according to the adjustment operation on the preset mixing coefficient;
[0146] The generating module 702 is specifically configured to:
[0147] perform mixing on the color parameters of the two color channels according to the adjusted mixing coefficient to obtain the target vector texture parameter.
[0148] In an optional implementation, the obtaining module 701 is further configured to:
[0149] obtain the adjusted vector texture parameter according to the adjustment operation on the scaling factor in the vector texture parameter;
[0150] The generating module 702 is specifically configured to:
[0151] perform mixing according to the brush stroke material rendering parameter and the adjusted vector texture parameter to obtain the mixed target vector texture parameter.
[0152] In this embodiment, the obtaining module is configured to obtain the base material rendering parameter for the target three-dimensional model, the obtaining module is further configured to obtain the color block material rendering parameter for the target three-dimensional model, the obtaining module is further configured to obtain the brush stroke material rendering parameter for the target three-dimensional model, and the generating module is configured to generate the hand-drawn material parameter of the target three-dimensional model according to the base material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter. The hand-drawn material parameter is used for material rendering on the target three-dimensional model, so that the rendered model has a hand-drawn effect. Thus, the rendered model has the three-dimensional-to-two-dimensional material with color block and brush stroke effects, and the rendering efficiency is improved.
[0153] Figure 12A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown in the figure. The device can include a processor 801, a memory 802, and a bus 803. The memory 802 stores machine-readable instructions executable by the processor 801. When the electronic device is running, the processor 801 communicates with the memory 802 through the bus 803. The processor 801 executes the machine-readable instructions to perform the following steps:
[0154] Obtaining base material rendering parameters for the target three-dimensional model;
[0155] Obtaining patch material rendering parameters for the target three-dimensional model;
[0156] Obtaining brush stroke material rendering parameters for the target three-dimensional model;
[0157] Generating hand-drawn material parameters of the target three-dimensional model according to the base material rendering parameters, the patch material rendering parameters, and the brush stroke material rendering parameters, the hand-drawn material parameters being used for material rendering of the target three-dimensional model, so that the rendered model has a hand-drawn effect.
[0158] In an optional embodiment, the patch material rendering parameters include vector texture parameters of each surface texture element and concave-convex parameters of each surface texture element.
[0159] Generating hand-drawn material parameters of the target three-dimensional model according to the base material rendering parameters, the patch material rendering parameters, and the brush stroke material rendering parameters includes:
[0160] Mixing the brush stroke material rendering parameters and the vector texture parameters to obtain target vector texture parameters;
[0161] Generating the hand-drawn material parameters according to the base material rendering parameters, the target vector texture parameters, and the concave-convex parameters.
[0162] In an optional embodiment, mixing the brush stroke material rendering parameters and the vector texture parameters to obtain mixed target vector texture parameters includes:
[0163] Taking the brush stroke material rendering parameters and the vector texture parameters as color parameters of two color channels, respectively;
[0164] Mixing the color parameters of the two color channels according to a preset mixing coefficient of the two color channels to obtain the target vector texture parameters.
[0165] In an optional embodiment, obtaining the patch material rendering parameters for the target three-dimensional model includes:
[0166] Vector mapping each surface texture element to obtain vector texture parameters of each surface texture element;
[0167] Correlate the surface texture element and the preset concave-convex configuration item parameter to obtain the concave-convex parameter of each surface texture element.
[0168] In an optional implementation, the hand-drawn material parameters of the target three-dimensional model are generated according to the base material rendering parameter, the color block material rendering parameter, and the brush stroke material rendering parameter, and the method comprises the following steps.
[0169] According to the map adjustment operation corresponding to the base material rendering parameter, the target map is obtained, and the target material rendering parameter corresponding to the target map is obtained.
[0170] According to the target material rendering parameter, the color block material rendering parameter, and the brush stroke material rendering parameter, the hand-drawn material parameters are generated.
[0171] In an optional implementation, the method further comprises the following steps.
[0172] According to the adjustment operation of the scaling coefficient in the brush stroke material rendering parameter, the adjusted brush stroke material rendering parameter is obtained.
[0173] The target vector texture parameter is obtained by mixing the brush stroke material rendering parameter and the vector texture parameter, comprising the following steps.
[0174] The target vector texture parameter is obtained by mixing the adjusted brush stroke material rendering parameter and the vector texture parameter.
[0175] In an optional implementation, the method further comprises the following steps.
[0176] According to the adjustment operation of the preset mixing coefficient, the adjusted mixing coefficient is obtained.
[0177] The color parameters of the two color channels are mixed according to the preset mixing coefficient of the two color channels to obtain the target vector texture parameter, comprising the following steps.
[0178] The color parameters of the two color channels are mixed according to the adjusted mixing coefficient to obtain the target vector texture parameter.
[0179] In an optional implementation, the method further comprises the following steps.
[0180] According to the adjustment operation of the scaling coefficient in the vector texture parameter, the adjusted vector texture parameter is obtained.
[0181] The mixed target vector texture parameter is obtained by mixing the brush stroke material rendering parameter and the vector texture parameter, comprising the following steps.
[0182] The mixed target vector texture parameter is obtained by mixing the brush stroke material rendering parameter and the adjusted vector texture parameter.
[0183] In the embodiment, the processor executes machine readable instructions to acquire a base material rendering parameter for a target three-dimensional model, acquire a color block material rendering parameter for the target three-dimensional model, acquire a brush stroke material rendering parameter for the target three-dimensional model, generate a hand-drawn material parameter for the target three-dimensional model according to the base material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter, and the hand-drawn material parameter is used for material rendering of the target three-dimensional model, so that the rendered model has a hand-drawn effect. Thus, the rendered model has a three-dimensional-to-two-dimensional material with color block and brush stroke effects, and the rendering efficiency is improved.
[0184] The embodiment of the application further provides a computer readable storage medium, which has a computer program stored thereon, and the computer program is executed by a processor to perform the following steps:
[0185] acquire a base material rendering parameter for a target three-dimensional model;
[0186] acquire a color block material rendering parameter for the target three-dimensional model;
[0187] acquire a brush stroke material rendering parameter for the target three-dimensional model;
[0188] generate a hand-drawn material parameter for the target three-dimensional model according to the base material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter, and the hand-drawn material parameter is used for material rendering of the target three-dimensional model, so that the rendered model has a hand-drawn effect.
[0189] In an optional implementation, the color block material rendering parameter comprises a vector texture parameter of each surface texture element and a concave-convex parameter of each surface texture element;
[0190] generate a hand-drawn material parameter for the target three-dimensional model according to the base material rendering parameter, the color block material rendering parameter and the brush stroke material rendering parameter, and the hand-drawn material parameter is used for material rendering of the target three-dimensional model, so that the rendered model has a hand-drawn effect.
[0191] mix the brush stroke material rendering parameter and the vector texture parameter to obtain a target vector texture parameter;
[0192] generate the hand-drawn material parameter according to the base material rendering parameter, the target vector texture parameter and the concave-convex parameter.
[0193] In an optional implementation, the mixing of the brush stroke material rendering parameter and the vector texture parameter to obtain a mixed target vector texture parameter comprises:
[0194] the brush stroke material rendering parameter and the vector texture parameter are respectively taken as color parameters of two color channels;
[0195] Mix the color parameters of the two color channels according to preset mixing coefficients of the two color channels, to obtain target vector texture parameters.
[0196] In an optional implementation, the patch material rendering parameters for the target three-dimensional model are acquired, including:
[0197] Vector mapping is performed on each surface texture element to obtain vector texture parameters of each surface texture element.
[0198] The parameters of each surface texture element and the preset bump configuration item are associated to obtain bump parameters of each surface texture element.
[0199] In an optional implementation, the hand-drawn material parameters of the target three-dimensional model are generated according to the base material rendering parameters, the patch material rendering parameters, and the brushstroke material rendering parameters, including:
[0200] According to the map adjustment operation for the base material rendering parameters, a target map is acquired, and target material rendering parameters corresponding to the target map are acquired.
[0201] The hand-drawn material parameters are generated according to the target material rendering parameters, the patch material rendering parameters, and the brushstroke material rendering parameters.
[0202] In an optional implementation, the method further includes:
[0203] According to the adjustment operation for the scaling coefficient in the brushstroke material rendering parameters, an adjusted brushstroke material rendering parameter is acquired.
[0204] Mixing is performed according to the brushstroke material rendering parameters and the vector texture parameters to obtain target vector texture parameters, including:
[0205] Mixing is performed according to the adjusted brushstroke material rendering parameters and the vector texture parameters to obtain target vector texture parameters.
[0206] In an optional implementation, the method further includes:
[0207] According to the adjustment operation for the preset mixing coefficients, an adjusted mixing coefficient is acquired.
[0208] Mixing is performed according to preset mixing coefficients of the two color channels to obtain target vector texture parameters, including:
[0209] Mixing is performed according to the adjusted mixing coefficients to obtain target vector texture parameters.
[0210] In an optional implementation, the method further includes:
[0211] According to the adjustment operation on the scaling coefficient in the vector texture parameter, an adjusted vector texture parameter is obtained.
[0212] According to the brush stroke material rendering parameter and the vector texture parameter, a mixed target vector texture parameter is obtained, including:
[0213] According to the brush stroke material rendering parameter and the adjusted vector texture parameter, a mixed target vector texture parameter is obtained.
[0214] In the embodiment, when the computer program is executed by the processor, the computer program is further used to perform other machine readable instructions to perform the method as described in the embodiments, and the method steps and principles of the specific implementation are described in the embodiments, and will not be described in detail here.
[0215] In the embodiments of the present application, the computer program executed by the processor can also perform other machine readable instructions to perform the method as described in the embodiments, and the method steps and principles of the specific implementation are described in the embodiments, and will not be described in detail here.
[0216] In the embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented by other means. The device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interface, device or unit, which can be electrical, mechanical or other forms.
[0217] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment.
[0218] In addition, each functional unit in the embodiments provided in the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0219] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0220] It should be noted that similar reference numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. In addition, the terms "first", "second", "third" and the like are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0221] Finally, it should be noted that the above-described embodiments are only specific implementations of the present application, which are used to illustrate the technical solutions of the present application, but not to limit them. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily think of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed by the present application, or make equivalent replacements to some of the technical features. These modifications, changes or replacements do not cause the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for generating hand-drawn material parameters, characterized in that, include: Obtain the basic material rendering parameters for the target 3D model; Obtain the color block material rendering parameters for the target 3D model, the color block material rendering parameters including: vector texture parameters of each surface texture element and bump parameters of each surface texture element; Obtain the brushstroke material rendering parameters for the target 3D model; Based on the basic material rendering parameters, the color block material rendering parameters, and the brushstroke material rendering parameters, hand-drawn material parameters of the target 3D model are generated. The hand-drawn material parameters are used to perform material rendering on the target 3D model so that the rendered model has a hand-drawn effect.
2. The method according to claim 1, characterized in that, The step of generating hand-drawn material parameters for the target 3D model based on the base material rendering parameters, the color block material rendering parameters, and the brushstroke material rendering parameters includes: The target vector texture parameters are obtained by mixing the brush stroke material rendering parameters and the vector texture parameters. The hand-drawn material parameters are generated based on the base material rendering parameters, the target vector texture parameters, and the bump parameters.
3. The method according to claim 2, characterized in that, The process of mixing the brushstroke material rendering parameters and the vector texture parameters to obtain the target vector texture parameters includes: The brushstroke material rendering parameters and the vector texture parameters are respectively used as the color parameters of two color channels; The color parameters of the two color channels are mixed according to the preset mixing coefficients of the two color channels to obtain the target vector texture parameters.
4. The method according to claim 2, characterized in that, The step of obtaining the color block material rendering parameters for the target 3D model includes: Perform vector mapping on each surface texture element to obtain the vector texture parameters of each surface texture element; The parameters of each surface texture element and the preset bump configuration item are associated to obtain the bump parameters of each surface texture element.
5. The method according to claim 1, characterized in that, The step of generating hand-drawn material parameters for the target 3D model based on the base material rendering parameters, the color block material rendering parameters, and the brushstroke material rendering parameters includes: Based on the texture adjustment operation corresponding to the basic material rendering parameters, obtain the target texture and the target material rendering parameters corresponding to the target texture; The hand-drawn material parameters are generated based on the target material rendering parameters, the color block material rendering parameters, and the brushstroke material rendering parameters.
6. The method according to claim 2, characterized in that, The method further includes: Based on the adjustment operation of the scaling factor in the brush stroke material rendering parameters, obtain the adjusted brush stroke material rendering parameters; The process of mixing the brushstroke material rendering parameters and the vector texture parameters to obtain the target vector texture parameters includes: The target vector texture parameters are obtained by mixing the adjusted brush stroke material rendering parameters and the vector texture parameters.
7. The method according to claim 3, characterized in that, The method further includes: Based on the adjustment operation for the preset mixing coefficient, the adjusted mixing coefficient is obtained; The step of mixing the color parameters of the two color channels according to the preset mixing coefficients of the two color channels to obtain the target vector texture parameters includes: Based on the adjusted mixing coefficients, the color parameters of the two color channels are mixed to obtain the target vector texture parameters.
8. The method according to claim 2, characterized in that, The method further includes: The adjusted vector texture parameters are obtained by adjusting the scaling factor in the vector texture parameters. The process of mixing the brushstroke material rendering parameters and the vector texture parameters to obtain the target vector texture parameters includes: The target vector texture parameters are obtained by blending the brushstroke material rendering parameters and the adjusted vector texture parameters.
9. A device for generating hand-drawn material parameters, characterized in that, include: The acquisition module is used to obtain the basic material rendering parameters for the target 3D model. The acquisition module is further configured to acquire color block material rendering parameters for the target 3D model, the color block material rendering parameters including: vector texture parameters of each surface texture element and concavity / convexity parameters of each surface texture element; The acquisition module is also used to acquire the brushstroke material rendering parameters for the target 3D model; The generation module is used to generate hand-drawn material parameters for the target 3D model based on the basic material rendering parameters, the color block material rendering parameters, and the brushstroke material rendering parameters. The hand-drawn material parameters are used to perform material rendering on the target 3D model so that the rendered model has a hand-drawn effect.
10. An electronic device, characterized in that, include: The electronic device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is in operation, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Water and ink special effect rendering method and device, storage medium and electronic equipment
CN116051706A
Rendering method and device of stylized cloth, storage medium and computer equipment
CN118114420A