Method and device for generating hand-drawn material parameters, electronic equipment and storage medium
By obtaining and combining the basic, color blocks and brushstroke material rendering parameters, the problem of complex and low efficiency in the existing technology is solved, and a three-dimensional model with rapid generation of hand-painted effects is realized, and the rendering efficiency is improved.
Patent Information
- Application Number
- CN202510168571.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-02-14
AI Technical Summary
In the prior art, the rendering process is too complex and the rendering efficiency is low, making it difficult to quickly achieve hand-drawing effects.
By obtaining the basic material rendering parameters, color block material rendering parameters and stroke material rendering parameters of the target three-dimensional model, it generates hand-painted material parameters, which are used to render the target three-dimensional model to make it have a hand-painted effect.
It realizes the rapid generation of stylized hand-painted effect materials, so that the rendered model has three-rendering and two-rendering materials with color blocks and stroke effects, improving rendering efficiency.
Smart Images

Figure CN119991906A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for generating hand-painted material parameters. Background Art
[0002] During the game development and design stage, 3D computer graphics software is usually used as an auxiliary method to improve the efficiency of animation production. Among them, 3D computer graphics software is more suitable for realistic style, and its built-in material system is more in line with the logic of realistic style.
[0003] In the related art, in order to achieve 3D rendering or hand-painted effects, one rendering method usually relies on lighting and hand-painted textures, and the other rendering method does not rely on lighting, and lighting only accounts for a small part of it, and only lighting is drawn on the hand-painted texture to achieve different effects. However, the rendering process of the above two methods is too complicated and the rendering efficiency is low. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a method, device, electronic device and storage medium for generating hand-drawn material parameters to solve the problem of overly complex rendering process and low rendering efficiency.
[0005] In a first aspect, an embodiment of the present application provides a method for generating hand-painted material parameters, comprising:
[0006] Obtain basic material rendering parameters for the target 3D model;
[0007] Obtaining color block material rendering parameters for the target three-dimensional model;
[0008] Obtaining brushstroke material rendering parameters for the target three-dimensional model;
[0009] According to the basic material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters, hand-drawn material parameters of the target three-dimensional model are generated, and the hand-drawn material parameters are used to perform material rendering on the target three-dimensional model so that the rendered model has a hand-drawn effect.
[0010] In a second aspect, the embodiment of the present application further provides a device for generating hand-painted material parameters, including:
[0011] An acquisition module, used to acquire basic material rendering parameters for a target three-dimensional model;
[0012] The acquisition module is further used to acquire color block material rendering parameters for the target three-dimensional model;
[0013] The acquisition module is further used to acquire brushstroke material rendering parameters for the target three-dimensional model;
[0014] A generation module is used to generate hand-drawn material parameters of the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters, and the hand-drawn material parameters are used to perform material rendering on the target three-dimensional model so that the rendered model has a hand-drawn effect.
[0015] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to execute any one of the methods described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in any one of the first aspects is executed.
[0017] The present application provides a method, device, electronic device and storage medium for generating hand-painted material parameters, wherein the method includes: obtaining basic material rendering parameters for a target three-dimensional model, obtaining color block material rendering parameters for a target three-dimensional model, obtaining brushstroke material rendering parameters for a target three-dimensional model, generating hand-painted material parameters for a target three-dimensional model according to the basic material rendering parameters, color block material rendering parameters and brushstroke material rendering parameters, and the hand-painted material parameters are used to perform material rendering on the target three-dimensional model, so that the rendered model has a hand-painted effect. Thus, the rendered model has three-rendering and two-material with both color block and brushstroke effects, which improves rendering efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 1 ;
[0020] Figure 2 Schematic diagram of the target three-dimensional model provided in the embodiment of the present application Figure 1 ;
[0021] Figure 3 Schematic diagram of the target three-dimensional model provided in the embodiment of the present application Figure 2 ;
[0022] Figure 4 Schematic diagram of the target three-dimensional model provided in the embodiment of the present application Figure 3 ;
[0023] Figure 5 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 2 ;
[0024] Figure 6 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 3 ;
[0025] Figure 7 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 4 ;
[0026] Figure 8 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 5 ;
[0027] Fig. 9 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 6 ;
[0028] Fig.10 Schematic diagram of the target three-dimensional model provided in the embodiment of the present application Figure 4 ;
[0029] Fig.11 A schematic diagram of the structure of a device for generating hand-painted material parameters provided in an embodiment of the present application;
[0030] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the 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 making creative work belong to the scope of protection of the present application.
[0032] Before introducing the technical solution of this application, the professional terms involved are first explained:
[0033] 3D computer graphics software: supports scene modeling, rendering, animation production, video editing, special effects synthesis and other functions.
[0034] Three Renderings Cel Shading / Toon Shading is a non-realistic rendering art style that creates flat colors on the basic colors of three-dimensional objects to make the objects look three-dimensional while maintaining a two-dimensional effect, ultimately giving the rendering engine 3D graphics a 2D hand-painted texture.
[0035] Voronoi texture node: A procedural texture node used in Blender. The Voronoi texture node can be used to generate a variety of complex texture effects, such as realistic metal "hammering" effects, 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, leather, sponge, water surface, beach, etc.
[0036] Brick wall texture node: a texture node used to generate brick wall effects, commonly used in material editing in Blender. By using this node, you can quickly generate a surface with a 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 strokes.
[0037] Voronoi Texture: A procedural texture generated based on the Voronoi Diagram. This texture is very popular in computer graphics because it can simulate many phenomena in nature, such as cell structure, rock cracks, animal fur patterns, etc.
[0038] Brick Texture: is a common procedural texture widely used in computer graphics, game development, architectural design and other fields to simulate the appearance of real brick walls.
[0039] In the related art, in order to achieve a 3D rendering effect or a hand-painted effect, one rendering method usually relies on lighting and hand-painted maps, and the other rendering method does not rely on lighting. Lighting only accounts for a very small part of it. Different effects are achieved by simply drawing lighting on the hand-painted map. However, these two methods are very time-consuming and will also increase costs, resulting in an overly complicated rendering process and low rendering efficiency.
[0040] It is worth mentioning that not relying on light and shadow means not relying on the light and shadow rendering in the scene, that is, the light and dark changes produced by the main light source + ambient light on the object are calculated. Drawing light and shadow on the texture is to optimize the game. Omitting light and shadow calculation will improve the smoothness of the game. Therefore, it is necessary to draw light and shadow on the texture to create a feeling of "fake shadow".
[0041] Based on this, the present application generates hand-drawn material parameters of the target three-dimensional model according to the basic material rendering parameters, color block material rendering parameters and brush stroke material rendering parameters. 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 both three-rendering and two-material with color block and brush stroke effects, which improves the rendering efficiency and provides a faster and more convenient means of style realization, which can play an advantage in stylized two-dimensional products.
[0042] Figure 1 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 1 The execution subject of this embodiment can be an electronic device, such as a laptop computer, a desktop computer, etc.
[0043] like Figure 1 As shown, the method may include:
[0044] S101: Obtain basic material rendering parameters for a target three-dimensional model.
[0045] The target 3D model is the 3D model to be rendered. Figure 2 Schematic diagram of the target three-dimensional model provided in the embodiment of the present application Figure 1 ,like Figure 2 As shown, the target three-dimensional model may be, for example, a sphere, a monkey head, or a ring.
[0046] The basic material rendering parameters are material parameters for basic rendering of the target three-dimensional model, and may 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 and wood material; the appearance parameters are used to indicate the appearance rendering effect, such as hand-painted effect; and the optical parameters are used to indicate the appearance optical properties, such as transparency.
[0047] In an application scenario, a user can select a target 3D model from multiple 3D models provided by 3D computer graphics software, or import the target 3D model into the software, select the target 3D model, click Create Principled BSDF and Material in the Shader Editor, create a new Principled BSDF node and Material Output node for the target 3D model, and click shift a Create-Shader-Self-Emission Node / Shader to RGB in the Shader Editor to insert a Self-Emission node (Emission) 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 Self-Emission node, and the Self-Emission interface of the Self-Emission node can be connected to the Surface (Curve) interface of the Material Output node.
[0048] Among them, the principled BSDF node is a physically based shader node used to simulate the appearance and optical properties of materials. The material parameters, appearance parameters, and optical parameters can be set in the configuration interface of the principled BSDF node. The self-luminous node is used to simulate the light on the appearance surface. The self-luminous intensity (strength) can be set in the configuration interface of the self-luminous node. The Shader to RGB node is used to convert the output of the shader (Shader) into a color value (RGB value) that can be seen in the image or rendering result. This process 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 material's properties, color, texture and other information to the rendering engine (3D computer graphics software) for use in the rendering process.
[0049] It is worth mentioning that the parameters set by the principled BSDF node are reusable and can be saved as a "reservoir" for application in different tasks and products.
[0050] S102: Obtain color block material rendering parameters for the target three-dimensional model.
[0051] Among them, the color block material rendering parameters are material parameters 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 parameters may include parameters of the Voronoi texture, and the parameters of the Voronoi texture may include Voronoi texture coordinates. The color block effect can be achieved by using the Voronoi texture.
[0052] In an application scenario, in 3D computer graphics software, a Voronoi Texture node is added before the Principled BSDF node, and color block material rendering parameters can be set in the configuration interface of the Voronoi Texture node.
[0053] Figure 3 Schematic diagram of the target three-dimensional model provided in the embodiment of the present application Figure 2 ,like Figure 3 As shown in the figure, the target 3D model is rendered based on the color block material rendering parameters. It can be seen that the light and dark boundary shadows and highlights of the rendered model begin to be segmented and distorted due to the Voronoi texture node, producing the "color block feeling" in traditional painting. By observing the rendering effect, clearer design guidance is provided for editing and production.
[0054] S103: Obtain brushstroke material rendering parameters for the target three-dimensional model.
[0055] Among them, the brushstroke material rendering parameters are material parameters for brushstroke rendering of the target 3D model, so that the target 3D model has a brushstroke effect. Brushstroke refers to the brushwork in painting, also known as texture, which often refers to the traces of brushstrokes in oil painting and gouache painting. It is a non-smooth effect.
[0056] The brushstroke material rendering parameters may include brick wall texture parameters, for example. The brick wall texture parameters may include a scaling factor (determining the size of the brick wall texture element), a brick wall texture color, etc. The brick wall texture may be used to achieve a brushstroke effect.
[0057] In an application scenario, in 3D computer graphics software, a brick wall texture node is added before the Voronoi texture node, and the brush stroke material rendering parameters can be set in the configuration interface of the brick wall texture node. The brick wall texture parameters can make the light and dark boundary lines of the model richer.
[0058] exist Figure 3 On the basis of Figure 4 Schematic diagram of the target three-dimensional model provided in the embodiment of the present application Figure 3 ,like Figure 4 As shown, the target 3D model is rendered based on the brush material rendering parameters. It can be seen that Figure 3 In comparison, the rendered model presents the brush stroke effect, and by observing the rendering effect, it provides clearer design guidance for editing and production.
[0059] S104, generating hand-drawn material parameters of the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters, the hand-drawn material parameters are used to perform material rendering on the target three-dimensional model so that the rendered model has a hand-drawn effect.
[0060] According to the basic material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters, the hand-drawn material parameters of the target three-dimensional model are generated, wherein the hand-drawn material parameters may include the basic material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters, so that the target three-dimensional model is material rendered based on the hand-drawn material parameters, so that the rendered model has three-rendering-two-materials with both color block and brush stroke effects, that is, it has a hand-drawn effect.
[0061] In one application scenario, in 3D computer graphics software, a material output node can be used to output the parameters set by a principled BSDF node, a self-illumination node, a Shader to RGB node, a Voronoi texture node, and a brick wall node to a rendering engine to perform material rendering on a target three-dimensional model, so that the rendered model has a hand-painted effect.
[0062] In this embodiment, hand-drawn material parameters of the target three-dimensional model are generated according to basic material rendering parameters, color block material rendering parameters and brush stroke material rendering parameters, so as to perform material rendering on the target three-dimensional model. This enables the rendered model to have three-rendering-two-materials with both color block and brush stroke effects, and can quickly produce material objects with a hand-drawn feel, thereby expanding the style, reducing repetitive workload and improving rendering effects.
[0063] It improves rendering efficiency and provides a faster and more convenient way to achieve style, which can play an advantage in stylized two-dimensional products.
[0064] Figure 5 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 2 ,like Figure 5 As shown, in an optional implementation, the color block material rendering parameters include: vector texture parameters of each surface texture element and concave-convex parameters of each surface texture element.
[0065] The surface texture element is a texture element of the surface of the target three-dimensional model, and the texture element may be a Voronoi texture element. The vector texture parameters of the surface texture element may include the texture coordinates (TextureCoordinate) and the scaling factor (determining the size of the Voronoi texture element) of the surface 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 may include the concave-convex intensity (strength) of each surface texture element.
[0067] In an application scenario, a bump node (Bump) and a Voronoi texture node (VoronoiTexture) are added. The bump strength (strength) of each surface texture element can be set in the configuration interface of the bump node, and the vector texture parameters of each surface texture element can be set in the configuration interface of the Voronoi texture node.
[0068] Among them, the position interface of the Voronoi texture node can be connected to the input normal interface of the bump node, and the output normal interface of the bump node can be connected to the normal interface of the principled BSDF node.
[0069] The above step S104 generates hand-painted material parameters of the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters and the brushstroke material rendering parameters, including:
[0070] S201 , mixing brushstroke material rendering parameters and vector texture parameters to obtain target vector texture parameters.
[0071] The brushstroke material rendering parameters and the vector texture parameters are mixed with a preset mixing coefficient to obtain target vector texture parameters, wherein the target vector texture parameters include target coordinate information and a target scaling coefficient of a surface texture element.
[0072] The mixing of the brushstroke material rendering parameters and the vector texture parameters can be understood as adjusting the vector texture parameters according to the preset mixing coefficient and the brushstroke material rendering parameters to obtain the target vector texture parameters.
[0073] In an optional implementation, the above step S201, mixing the brushstroke material rendering parameters and the vector texture parameters to obtain the target vector texture parameters, may include:
[0074] Use the brush material rendering parameters and vector texture parameters as the color parameters of the two color channels respectively;
[0075] According to the preset mixing coefficients of the two color channels, the color parameters of the two color channels are mixed to obtain the target vector texture parameters.
[0076] The preset mixing coefficients of the two color channels can be set according to actual conditions, for example, 0.115, which is not particularly limited in this embodiment. The brushstroke material rendering parameters and the vector texture parameters are respectively used as the color parameters of the two color channels, and the color parameters of the two color channels are mixed according to the preset mixing coefficients of the two color channels to adjust the vector texture parameters and obtain the target vector texture parameters.
[0077] In some embodiments, a blend node may be added, with the vector texture parameters as color channel 1 and the brushstroke material rendering parameters as color channel 2. The blend node is to add another texture to the front-end of the Voronoi texture node, which is used to increase brushstrokes while retaining color blocks.
[0078] In an optional embodiment, the method may further include:
[0079] According to the adjustment operation on the preset mixing coefficient, obtaining the adjusted mixing coefficient;
[0080] According to the preset mixing coefficients of the two color channels, the color parameters of the two color channels are mixed to obtain the target vector texture parameters, which may include:
[0081] According to the adjusted mixing coefficient, the color parameters of the two color channels are mixed to obtain the target vector texture parameters.
[0082] Among them, 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, the adjusted mixing coefficient is obtained, and the brush material rendering parameters and the vector texture parameters are respectively used as the color parameters of the two color channels. According to the adjusted mixing coefficient, the color parameters of the two color channels are mixed to adjust the vector texture parameters to obtain the target vector texture parameters. The user adjusts the preset mixing coefficient according to actual needs, making the generation of hand-painted material parameters more flexible.
[0083] S202, generating hand-painted material parameters according to basic material rendering parameters, target vector texture parameters and concave-convex parameters.
[0084] After the vector texture parameters are mixed, hand-drawn material parameters can be generated according to the basic material rendering parameters, the target vector texture parameters and the bump parameters, wherein the hand-drawn material parameters may include the basic material rendering parameters, the target vector texture parameters and the bump parameters, so as to perform material rendering on the target three-dimensional model based on the hand-drawn material parameters, so that the rendered model has a three-rendering-two-material with both color blocks and brush stroke effects, that is, a hand-drawn effect.
[0085] In this embodiment, the brush stroke material rendering parameters and the vector texture parameters are mixed to obtain the target vector texture parameters, so that the rendered model has a brush stroke effect on the basis of the color block effect, and the hand-drawn effect of the light and dark boundary line is refined. Moreover, based on the concave and convex parameters, the light and dark boundary line of the rendered model further produces a hand-drawn effect, and the color block effect is better.
[0086] Figure 6 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 3 ,like Figure 6 As shown, in an optional implementation, the above step S102, obtaining the color block material rendering parameters for the target three-dimensional model, may include:
[0087] S301 . Perform vector mapping on each surface texture element to obtain a vector texture parameter of each surface texture element.
[0088] Among them, the texture coordinates of each surface texture element on the surface of the target three-dimensional model are obtained, and according to the vector mapping parameters (Mapping), the texture coordinates of each surface texture element are vector mapped to obtain the vector texture parameters of each surface texture element. The vector texture parameters may include the texture coordinates (Texture Coordinate) of the surface texture element and the scaling factor (determining the size of the Voronoi texture element).
[0089] In some embodiments, the vector mapping parameters may include: vector rotation parameters and / or vector scaling factors, that is, according to the vector rotation parameters and / or vector scaling parameters, the texture coordinates of each surface texture element are rotated and / or scaled to obtain the vector texture parameters of each surface texture element.
[0090] In an application scenario, a mapping subnode and a texture coordinate subnode are generated. The texture coordinates of each surface texture element can be displayed in the texture coordinate node. Vector mapping parameters can be set for each surface texture element in the mapping subnode. The normal interface in the texture coordinate subnode can be connected to the input vector interface of the mapping subnode, and the output vector interface of the mapping subnode can be 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 new Mix node is connected between the Voronoi texture node and the Map subnode, the vector of the Map subnode is connected to the color channel 1 in the Mix node, and the color interface of the Brick Texture node is connected to the color channel 2 of the Mix node. The Mix node is to add another texture to the front link of the Voronoi texture node, which is used to increase brush strokes while retaining the color blocks.
[0092] S302: Associating each surface texture element with a parameter of a preset concave-convex configuration item to obtain a concave-convex parameter of each surface texture element.
[0093] After determining the vector texture parameters of each surface texture element, each surface texture element is associated with the parameters of the concave-convex configuration item to configure the parameters of the preset concave-convex configuration item to obtain the concave-convex parameters of each surface texture element.
[0094] In this embodiment, vector mapping is performed on each surface texture element to obtain vector texture parameters of each surface texture element, which further improves the color block effect of the rendered model. In addition, by associating each surface texture element with the parameters of the preset concave-convex configuration item, it is convenient to set the concave-convex parameters for each surface texture element, thereby improving the convenience of operation.
[0095] Figure 7 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 4 ,like Figure 7 As shown, in an optional implementation, the above step S104 generates hand-painted material parameters of the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters and the brushstroke material rendering parameters, including:
[0096] S401. According to a texture adjustment operation corresponding to a base material rendering parameter, a target texture is obtained, and target material rendering parameters corresponding to the target texture are obtained.
[0097] Among them, the basic material rendering parameters are determined according to the basic map corresponding to the basic material parameters. The basic map may include, for example, a color map, a roughness map, a metal map, etc. The material rendering parameters are extracted from the basic map to obtain the basic material rendering parameters.
[0098] The texture adjustment operation is used to adjust the base texture to the target texture. The user inputs the texture adjustment operation corresponding to the base material rendering parameters. According to the texture adjustment operation, the target texture corresponding to the texture adjustment operation is obtained, and the material rendering parameters of the target texture are extracted to obtain the target material rendering parameters.
[0099] S402, generating hand-painted material parameters according to target material rendering parameters, color block material rendering parameters and brush stroke material rendering parameters.
[0100] According to the target material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters, the hand-drawn material parameters of the target three-dimensional model are generated, wherein the hand-drawn material parameters may include the target material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters, so that the target three-dimensional model is material rendered based on the hand-drawn material parameters, so that the rendered model has three-rendering and two-material with both color block and brush stroke effects, that is, it has a hand-drawn effect.
[0101] In this embodiment, the texture is adjusted according to actual needs to generate hand-painted material parameters, so that the three-dimensional rendering of the color block brushstroke material effect can be obtained using realistic materials, which has high flexibility.
[0102] Figure 8 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 5 ,like Figure 8 As shown, in an optional implementation, the method may further include:
[0103] S501. According to the adjustment operation on the scaling factor in the brushstroke material rendering parameters, the adjusted brushstroke material rendering parameters are obtained.
[0104] The brushstroke material rendering parameters include: a scaling factor, which may be a scaling factor of a brick wall texture, and the adjustment operation of the scaling factor in the brushstroke material rendering parameters is used to adjust the scaling factor in the brushstroke material rendering parameters.
[0105] The user inputs an adjustment operation for the zoom factor in the brushstroke material rendering parameters, and according to the mapping operation, the adjusted brushstroke material rendering parameters are obtained, wherein the adjusted brushstroke material rendering parameters include: an adjusted zoom number.
[0106] The above step S201, mixing the brushstroke material rendering parameters and the vector texture parameters to obtain the target vector texture parameters, may include:
[0107] S502 , mixing the adjusted brushstroke material rendering parameters and vector texture parameters to obtain target vector texture parameters.
[0108] The adjusted stroke material rendering parameters and vector texture parameters are mixed using a preset mixing coefficient to obtain target vector texture parameters, wherein the target vector texture parameters include target coordinate information of surface texture elements.
[0109] The mixing of the adjusted brushstroke material rendering parameters and the vector texture parameters can be understood as adjusting the vector texture parameters according to the preset mixing coefficient and the adjusted brushstroke material rendering parameters to obtain the target vector texture parameters.
[0110] In this embodiment, the scaling factor in the brushstroke material rendering parameters is adjusted according to actual needs, and the adjusted brushstroke material rendering parameters are mixed with the vector texture parameters to obtain the target vector texture parameters, so that the generation of hand-painted material parameters is more flexible.
[0111] Fig. 9 Schematic diagram of the process of generating hand-painted material parameters provided in the embodiment of the present application Figure 6 ,like Fig. 9 As shown, in an optional implementation, the method may further include:
[0112] S601. Obtain adjusted vector texture parameters according to an adjustment operation on a scaling factor in a vector texture parameter.
[0113] The vector texture parameters include: a scaling factor, which may be a scaling factor of a Voronoi texture, and the adjustment operation on the scaling factor in the vector texture parameters is used to adjust the scaling factor in the vector texture parameters.
[0114] The user inputs an adjustment operation for the scaling factor in the vector texture parameter, and according to the adjustment operation, the adjusted vector texture parameter is obtained, wherein the adjusted vector texture parameter includes: an adjusted scaling number.
[0115] The above step S201, mixing the brushstroke material rendering parameters and the vector texture parameters to obtain the target vector texture parameters, may include:
[0116] S602 , mixing the stroke material rendering parameters and the adjusted vector texture parameters to obtain mixed target vector texture parameters.
[0117] The brushstroke material rendering parameters and the adjusted vector texture parameters are mixed using a preset mixing coefficient to obtain target vector texture parameters, wherein the target vector texture parameters include target coordinate information and a target scaling coefficient of a surface texture element.
[0118] The mixing of the brushstroke material rendering parameters and the vector texture parameters can be understood as adjusting the adjusted vector texture parameters according to the preset mixing coefficient and the brushstroke material rendering parameters to obtain the target vector texture parameters.
[0119] In this embodiment, the scaling factor in the vector texture parameters is adjusted according to actual needs, so as to mix the brush material rendering parameters and the adjusted vector texture parameters to obtain the target vector texture parameters, thereby making the generation of hand-painted material parameters more flexible.
[0120] exist Figure 4 On the basis of, it can be seen that Figure 4 The density of the brush strokes of the target 3D model is still problematic (it is relatively sparse). Fig.10 Schematic diagram of the target three-dimensional model provided in the embodiment of the present application Figure 4 ,like Fig.10 As shown, by adjusting at least one of the scaling factor in the brushstroke material rendering parameters, the preset blending factor, and the scaling factor in the vector texture parameters, the brushstrokes of the rendered model are made tighter and the hand-painted effect is better.
[0121] Fig.11 This is a schematic diagram of the structure of a device for generating hand-drawn material parameters provided in an embodiment of the present application, which can be integrated in an electronic device.
[0122] like Fig.11 As shown, the device may include:
[0123] An acquisition module 701 is used to acquire basic material rendering parameters for a target three-dimensional model;
[0124] The acquisition module 701 is also used to acquire the color block material rendering parameters for the target three-dimensional model;
[0125] The acquisition module 701 is also used to acquire the brushstroke material rendering parameters for the target three-dimensional model;
[0126] The generation module 702 is used to generate hand-painted material parameters of the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters. The hand-painted material parameters are used to perform material rendering on the target three-dimensional model so that the rendered model has a hand-painted effect.
[0127] In an optional implementation, the color block material rendering parameters include: vector texture parameters of each surface texture element and concave-convex parameters of each surface texture element;
[0128] The generating module 702 is specifically used for:
[0129] Mix the brush stroke material rendering parameters and the vector texture parameters to obtain the target vector texture parameters;
[0130] Generate hand-painted material parameters according to basic material rendering parameters, target vector texture parameters and bump parameters.
[0131] In an optional implementation, the generating module 702 is specifically configured to:
[0132] Use the brush material rendering parameters and vector texture parameters as the color parameters of the two color channels respectively;
[0133] According to the preset mixing coefficients of the two color channels, the color parameters of the two color channels are mixed to obtain the target vector texture parameters.
[0134] In an optional implementation, the acquisition module 701 is specifically configured to:
[0135] Performing vector mapping on each surface texture element to obtain vector texture parameters of each surface texture element;
[0136] The parameters of each surface texture element and the preset concave-convex configuration item are associated to obtain the concave-convex parameters of each surface texture element.
[0137] In an optional implementation, the generating module 702 is specifically configured to:
[0138] According to the texture adjustment operation corresponding to the base material rendering parameters, a target texture is obtained, and the target material rendering parameters corresponding to the target texture are obtained;
[0139] Generate hand-painted material parameters according to target material rendering parameters, color block material rendering parameters and brush stroke material rendering parameters.
[0140] In an optional implementation, the acquisition module 701 is further configured to:
[0141] According to the adjustment operation on the scaling factor in the brush stroke material rendering parameter, the adjusted brush stroke material rendering parameter is obtained;
[0142] The generating module 702 is specifically used for:
[0143] The adjusted stroke material rendering parameters and vector texture parameters are mixed to obtain target vector texture parameters.
[0144] In an optional implementation, the acquisition module 701 is further configured to:
[0145] According to the adjustment operation on the preset mixing coefficient, obtaining the adjusted mixing coefficient;
[0146] The generating module 702 is specifically used for:
[0147] According to the adjusted mixing coefficient, the color parameters of the two color channels are mixed to obtain the target vector texture parameters.
[0148] In an optional implementation, the acquisition module 701 is further configured to:
[0149] According to the adjustment operation on the scaling factor in the vector texture parameter, an adjusted vector texture parameter is obtained;
[0150] The generating module 702 is specifically used for:
[0151] The stroke material rendering parameters and the adjusted vector texture parameters are mixed to obtain mixed target vector texture parameters.
[0152] In this embodiment, the acquisition module is used to acquire the basic material rendering parameters for the target three-dimensional model, the acquisition module is also used to acquire the color block material rendering parameters for the target three-dimensional model, the acquisition module is also used to acquire the brush stroke material rendering parameters for the target three-dimensional model, and the generation module is used to generate the hand-painted material parameters of the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters. The hand-painted material parameters are used to perform material rendering on the target three-dimensional model, so that the rendered model has a hand-painted effect. Thus, the rendered model has three-rendering and two-material with both color block and brush stroke effects, which improves the rendering efficiency.
[0153] Fig.12A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, as shown in the figure, the device may 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, and the processor 801 executes the machine-readable instructions to perform the following steps:
[0154] Obtain basic material rendering parameters for the target 3D model;
[0155] Obtaining color block material rendering parameters for the target 3D model;
[0156] Obtaining brush material rendering parameters for the target 3D model;
[0157] According to the basic material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters, the hand-drawn material parameters of the target three-dimensional model are generated. The hand-drawn material parameters are used to perform material rendering on the target three-dimensional model so that the rendered model has a hand-drawn effect.
[0158] In an optional implementation, the color block material rendering parameters include: vector texture parameters of each surface texture element and concave-convex parameters of each surface texture element;
[0159] According to the basic material rendering parameters, color block material rendering parameters and brush stroke material rendering parameters, the hand-painted material parameters of the target 3D model are generated, including:
[0160] Mix the brush stroke material rendering parameters and the vector texture parameters to obtain the target vector texture parameters;
[0161] Generate hand-painted material parameters according to basic material rendering parameters, target vector texture parameters and bump parameters.
[0162] In an optional implementation, the brushstroke material rendering parameters and the vector texture parameters are mixed to obtain the mixed target vector texture parameters, including:
[0163] Use the brush material rendering parameters and vector texture parameters as the color parameters of the two color channels respectively;
[0164] According to the preset mixing coefficients of the two color channels, the color parameters of the two color channels are mixed to obtain the target vector texture parameters.
[0165] In an optional implementation, obtaining color block material rendering parameters for the target three-dimensional model includes:
[0166] Performing vector mapping on each surface texture element to obtain vector texture parameters of each surface texture element;
[0167] The parameters of each surface texture element and the preset concave-convex configuration item are associated to obtain the concave-convex parameters of each surface texture element.
[0168] In an optional implementation, generating hand-painted material parameters of the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters, and the brushstroke material rendering parameters includes:
[0169] According to the texture adjustment operation corresponding to the base material rendering parameters, a target texture is obtained, and the target material rendering parameters corresponding to the target texture are obtained;
[0170] Generate hand-painted material parameters according to target material rendering parameters, color block material rendering parameters and brush stroke material rendering parameters.
[0171] In an optional embodiment, the method further comprises:
[0172] According to the adjustment operation on the scaling factor in the brush stroke material rendering parameter, the adjusted brush stroke material rendering parameter is obtained;
[0173] According to the brush material rendering parameters and the vector texture parameters, the target vector texture parameters are obtained, including:
[0174] The adjusted stroke material rendering parameters and vector texture parameters are mixed to obtain target vector texture parameters.
[0175] In an optional embodiment, the method further comprises:
[0176] According to the adjustment operation on the preset mixing coefficient, obtaining the adjusted mixing coefficient;
[0177] According to the preset mixing coefficients of the two color channels, the color parameters of the two color channels are mixed to obtain the target vector texture parameters, including:
[0178] According to the adjusted mixing coefficient, the color parameters of the two color channels are mixed to obtain the target vector texture parameters.
[0179] In an optional embodiment, the method further comprises:
[0180] According to the adjustment operation on the scaling factor in the vector texture parameter, an adjusted vector texture parameter is obtained;
[0181] According to the brush material rendering parameters and the vector texture parameters, the mixed target vector texture parameters are obtained, including:
[0182] The stroke material rendering parameters and the adjusted vector texture parameters are mixed to obtain mixed target vector texture parameters.
[0183] In this embodiment, the processor executes machine-readable instructions to obtain basic material rendering parameters for the target three-dimensional model, obtain color block material rendering parameters for the target three-dimensional model, obtain brush stroke material rendering parameters for the target three-dimensional model, and generate hand-painted material parameters for the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters, and the brush stroke material rendering parameters. The hand-painted material parameters are used to perform material rendering on the target three-dimensional model, so that the rendered model has a hand-painted effect. Therefore, the rendered model has three-rendering and two-material with both color block and brush stroke effects, which improves rendering efficiency.
[0184] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to perform the following steps:
[0185] Obtain basic material rendering parameters for the target 3D model;
[0186] Obtaining color block material rendering parameters for the target 3D model;
[0187] Obtaining brush material rendering parameters for the target 3D model;
[0188] According to the basic material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters, the hand-drawn material parameters of the target three-dimensional model are generated. The hand-drawn material parameters are used to perform material rendering on 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 parameters include: vector texture parameters of each surface texture element and concave-convex parameters of each surface texture element;
[0190] According to the basic material rendering parameters, color block material rendering parameters and brush stroke material rendering parameters, the hand-painted material parameters of the target 3D model are generated, including:
[0191] Mix the brush stroke material rendering parameters and the vector texture parameters to obtain the target vector texture parameters;
[0192] Generate hand-painted material parameters according to basic material rendering parameters, target vector texture parameters and bump parameters.
[0193] In an optional implementation, the brushstroke material rendering parameters and the vector texture parameters are mixed to obtain the mixed target vector texture parameters, including:
[0194] Use the brush material rendering parameters and vector texture parameters as the color parameters of the two color channels respectively;
[0195] According to the preset mixing coefficients of the two color channels, the color parameters of the two color channels are mixed to obtain the target vector texture parameters.
[0196] In an optional implementation, obtaining color block material rendering parameters for the target three-dimensional model includes:
[0197] Performing vector mapping 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 concave-convex configuration item are associated to obtain the concave-convex parameters of each surface texture element.
[0199] In an optional implementation, generating hand-painted material parameters of the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters, and the brushstroke material rendering parameters includes:
[0200] According to the texture adjustment operation corresponding to the base material rendering parameters, a target texture is obtained, and the target material rendering parameters corresponding to the target texture are obtained;
[0201] Generate hand-painted material parameters according to target material rendering parameters, color block material rendering parameters and brush stroke material rendering parameters.
[0202] In an optional embodiment, the method further comprises:
[0203] According to the adjustment operation on the scaling factor in the brush stroke material rendering parameter, the adjusted brush stroke material rendering parameter is obtained;
[0204] According to the brush material rendering parameters and the vector texture parameters, the target vector texture parameters are obtained, including:
[0205] The adjusted stroke material rendering parameters and vector texture parameters are mixed to obtain target vector texture parameters.
[0206] In an optional embodiment, the method further comprises:
[0207] According to the adjustment operation on the preset mixing coefficient, obtaining the adjusted mixing coefficient;
[0208] According to the preset mixing coefficients of the two color channels, the color parameters of the two color channels are mixed to obtain the target vector texture parameters, including:
[0209] According to the adjusted mixing coefficient, the color parameters of the two color channels are mixed to obtain the target vector texture parameters.
[0210] In an optional embodiment, the method further comprises:
[0211] According to the adjustment operation on the scaling factor in the vector texture parameter, an adjusted vector texture parameter is obtained;
[0212] According to the brush material rendering parameters and the vector texture parameters, the mixed target vector texture parameters are obtained, including:
[0213] The stroke material rendering parameters and the adjusted vector texture parameters are mixed to obtain mixed target vector texture parameters.
[0214] In this embodiment, the computer program is executed by the processor when it is running to obtain basic material rendering parameters for the target three-dimensional model, obtain color block material rendering parameters for the target three-dimensional model, obtain brush stroke material rendering parameters for the target three-dimensional model, and generate hand-painted material parameters for the target three-dimensional model according to the basic material rendering parameters, color block material rendering parameters and brush stroke material rendering parameters. The hand-painted material parameters are used to perform material rendering on the target three-dimensional model, so that the rendered model has a hand-painted effect. Therefore, the rendered model has three-rendering and two-material with both color block and brush stroke effects, which improves rendering efficiency.
[0215] In the embodiment of the present application, the computer program can also execute other machine-readable instructions when run by the processor to execute other methods described in the embodiment. For the specific execution method steps and principles, please refer to the description of the embodiment, which will not be repeated here.
[0216] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0217] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0218] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0219] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, 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, which is stored in a storage medium and includes several instructions for 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 methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0220] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0221] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, 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 application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for generating hand-painted material parameters, characterized in that: include: Obtain basic material rendering parameters for the target 3D model; Obtaining color block material rendering parameters for the target three-dimensional model; Obtaining brushstroke material rendering parameters for the target three-dimensional model; According to the basic material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters, hand-drawn material parameters of the target three-dimensional model are generated, and the hand-drawn material parameters are used to perform material rendering on the target three-dimensional model so that the rendered model has a hand-drawn effect.
2. The method according to claim 1, characterized in that The color block material rendering parameters include: vector texture parameters of each surface texture element and concave-convex parameters of each surface texture element; The step of generating the hand-painted material parameters of the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters and the brushstroke material rendering parameters includes: Mixing the brushstroke material rendering parameters and the vector texture parameters to obtain target vector texture parameters; The hand-painted material parameters are generated according to the basic material rendering parameters, the target vector texture parameters and the concave-convex parameters.
3. The method according to claim 2, characterized in that The step of mixing the brushstroke material rendering parameter and the vector texture parameter to obtain a target vector texture parameter comprises: Using the brushstroke material rendering parameters and the vector texture parameters as color parameters of two color channels respectively; 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 color block material rendering parameters for the target three-dimensional model includes: Performing vector mapping on each of the surface texture elements to obtain vector texture parameters of each of the surface texture elements; The surface texture elements are associated with parameters of preset concave-convex configuration items to obtain concave-convex parameters of the surface texture elements.
5. The method according to claim 1, characterized in that The step of generating the hand-painted material parameters of the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters and the brushstroke material rendering parameters includes: According to the texture adjustment operation corresponding to the basic material rendering parameters, a target texture is obtained, and target material rendering parameters corresponding to the target texture are obtained; The hand-painted material parameters are generated according to the target material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters.
6. The method according to claim 2, characterized in that The method further comprises: According to the adjustment operation on the scaling factor in the brushstroke material rendering parameter, obtaining the adjusted brushstroke material rendering parameter; The step of mixing the brushstroke material rendering parameter and the vector texture parameter to obtain a target vector texture parameter comprises: The target vector texture parameters are obtained by mixing the adjusted brushstroke material rendering parameters and the vector texture parameters.
7. The method according to claim 3, characterized in that The method further comprises: According to the adjustment operation on the preset mixing coefficient, obtaining an adjusted mixing coefficient; 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: The color parameters of the two color channels are mixed according to the adjusted mixing coefficient to obtain the target vector texture parameter.
8. The method according to claim 2, characterized in that: The method further comprises: According to the adjustment operation on the scaling coefficient in the vector texture parameter, an adjusted vector texture parameter is obtained; The step of mixing the brushstroke material rendering parameter and the vector texture parameter to obtain a target vector texture parameter comprises: The brushstroke material rendering parameters and the adjusted vector texture parameters are mixed to obtain mixed target vector texture parameters.
9. A device for generating hand-painted material parameters, characterized in that: include: An acquisition module, used to acquire basic material rendering parameters for a target three-dimensional model; The acquisition module is further used to acquire color block material rendering parameters for the target three-dimensional model; The acquisition module is further used to acquire brushstroke material rendering parameters for the target three-dimensional model; A generation module is used to generate hand-drawn material parameters of the target three-dimensional model according to the basic material rendering parameters, the color block material rendering parameters and the brush stroke material rendering parameters, and the hand-drawn material parameters are used to perform material rendering on the target three-dimensional model so that the rendered model has a hand-drawn effect.
10. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the method described in 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, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is executed.
Citation Information
Patent Citations
Art stylization image processing method
CN105719327A
3D scene wash and ink painting style rendering method based on 3dsmax
CN115880413A
Water and ink special effect rendering method and device, storage medium and electronic equipment
CN116051706A
Generation method and device of stylized hand drawing effect, storage medium and electronic device
CN117911600A
Rendering method and device of stylized cloth, storage medium and computer equipment
CN118114420A