Information processing method, device, electronic device and storage medium
By determining the conditional area and performing specific sampling and processing steps in character clothing rendering, the problem that the clothing rendering in the prior art does not conform to the comic style is solved, and a high degree of fit clothing and character style is achieved.
Patent Information
- Application Number
- CN202210731151.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-06-24
AI Technical Summary
The existing technology is difficult to achieve a high degree of fit in the comic style in character costume rendering, resulting in a low degree of fit in the character costume and the character itself.
By obtaining the normal normal direction and normal lighting direction of each colored point in the clothing image to be rendered, four conditional areas are determined, and the preset grid map is sampled based on different scaling multiples, multiplying and parameter maximum processing is performed, and the target clothing image is generated based on the color components of the align map.
The fit between the clothing and the character style is improved, and the layering of the lines is enhanced by increasing the color difference between different parts of the clothing and adjusting the density of the lines.
Smart Images

Figure CN115317911B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of three-dimensional image technology, and in particular to an information processing method, device, electronic equipment and storage medium. Background Art
[0002] Character costumes are a component that accounts for a relatively large proportion of the screen in character rendering. When presented on the screen, they have a great impact on the impression and perception of the character on the player. Therefore, the rendering of character costumes is an important part of the character image and needs to complement the expression of other game content.
[0003] In the existing solutions, the rendering of clothing is generally achieved by adding hand-painted texture stripes during rendering, or by drawing hand-painted lines on the texture when making the albedo texture.
[0004] However, the lines in the existing solutions cannot fully reflect the various evaluation criteria of the comic style, resulting in a low degree of fit between the character's costume and the comic style of the character itself. Summary of the invention
[0005] The present invention provides an information processing method, device, electronic device and storage medium for rendering clothing in a comic style with large color difference and strong line layering, thereby improving the fit between clothing and the comic style of the character.
[0006] A first aspect of an embodiment of the present invention provides an information processing method, comprising: obtaining the normalized normal direction and the normalized illumination direction of each shading point in a clothing image to be rendered; determining four conditional areas in the clothing image to be rendered according to the normalized normal direction and the normalized illumination direction; sampling a preset grid map twice based on different zoom factors to obtain two sampling results; performing multiplication processing and maximum value processing on the two sampling results respectively to obtain processing results; sampling a preset albedo map to obtain color components; and generating a target clothing image according to the processing results, the four conditional areas and the color components.
[0007] In a feasible implementation manner, the determining four conditional areas in the clothing image to be rendered according to the normalized normal direction and the normalized illumination direction includes: generating illumination intensity according to the normalized normal direction and the normalized illumination direction; and dividing the clothing image to be rendered into regions according to the illumination intensity to obtain four conditional areas.
[0008] In a feasible implementation manner, the clothing image to be rendered is divided into regions according to the light intensity to obtain four conditional regions, including: determining a first preset parameter and a second preset parameter of the clothing image to be rendered; determining a first conditional region according to a first step condition according to the light intensity, the first preset parameter and the second preset parameter; determining a second conditional region according to a second step condition according to the light intensity, the first preset parameter and the second preset parameter; determining a third conditional region according to a third step condition according to the first preset parameter, the second preset parameter and the second conditional region; determining a fourth conditional region according to a fourth step condition according to the first conditional region and the second conditional region.
[0009] In a feasible implementation, the preset grid map is sampled twice based on different zoom factors to obtain two sampling results, including: sampling the preset grid map according to a first zoom factor to obtain a first sampling result; sampling the grid map according to a second zoom factor to obtain a second sampling result, and the second zoom factor is different from the first zoom factor.
[0010] In a feasible implementation manner, the two sampling results are subjected to parameter multiplication processing and parameter maximum value processing respectively to obtain a processing result, including: determining a first sampling parameter and a second sampling parameter, wherein the value ranges of the first sampling parameter and the second sampling parameter are both greater than or equal to 0 and less than or equal to 1; finding the maximum value between the first sampling result and the first sampling parameter, and recording the determined maximum value as the first processing result; multiplying the second sampling result and the second sampling parameter, and recording the multiplication result as the second processing result.
[0011] In a feasible implementation manner, generating a target clothing image based on the processing result, the four conditional areas and the color component includes: performing calculations according to preset rules based on the processing result and the four conditional areas to obtain a first calculation result; comparing the numerical values between the first settlement result and the color component, taking the minimum value as the pixel value of each shading point, and obtaining the target clothing image.
[0012] In a feasible implementation, the sampling of a preset albedo map to obtain color components includes: obtaining the albedo map corresponding to the clothing image to be rendered, the albedo map being the color information of the clothing without considering lighting factors; sampling the albedo map at each shading point to obtain the color components corresponding to the clothing image to be rendered.
[0013] In a feasible implementation manner, before obtaining the normalized normal direction and the normalized illumination direction of each shading point in the clothing image to be rendered, the method further includes: obtaining a grid map, which is a four-sided continuous image.
[0014] The second aspect of an embodiment of the present invention provides an information processing device, comprising: a first acquisition module, used to acquire the normalized normal direction and normalized illumination direction of each shading point in a clothing image to be rendered; a determination module, used to determine four conditional areas in the clothing image to be rendered according to the normalized normal direction and the normalized illumination direction; a first sampling module, used to sample a preset grid map twice based on different zoom factors to obtain two sampling results; a processing module, used to perform multiplication processing and maximum value processing on the two sampling results respectively to obtain processing results; a second sampling module, used to sample a preset albedo map to obtain color components; a generation module, used to generate a target clothing image according to the processing results, the four conditional areas and the color components.
[0015] In a feasible implementation, the determination module includes: a generation submodule for generating light intensity according to the normalized normal direction and the normalized light direction; and a division submodule for dividing the clothing image to be rendered into regions according to the light intensity to obtain four conditional regions.
[0016] In a feasible implementation, the division submodule is specifically used to: determine the first preset parameter and the second preset parameter of the clothing image to be rendered; determine the first condition area according to the first step condition based on the light intensity, the first preset parameter and the second preset parameter; determine the second condition area according to the second step condition based on the light intensity, the first preset parameter and the second preset parameter; determine the third condition area according to the third step condition based on the first preset parameter, the second preset parameter and the second condition area; determine the fourth condition area according to the first condition area and the second condition area according to the fourth step condition.
[0017] In a feasible implementation, the first sampling module is specifically used to: sample a preset grid map according to a first zoom factor to obtain a first sampling result; sample the grid map according to a second zoom factor to obtain a second sampling result, and the second zoom factor is different from the first zoom factor.
[0018] In a feasible implementation, the processing module is specifically used to: determine a first sampling parameter and a second sampling parameter, wherein the value ranges of the first sampling parameter and the second sampling parameter are both greater than or equal to 0 and less than or equal to 1; obtain a maximum value between the first sampling result and the first sampling parameter, and record the determined maximum value as a first processing result; multiply the second sampling result and the second sampling parameter, and record the multiplication result as a second processing result.
[0019] In a feasible implementation, the generation module is specifically used to: perform calculations according to preset rules based on the processing results and the four conditional areas to obtain a first calculation result; compare the numerical values between the first settlement result and the color components, and use the minimum value as the pixel value of each shading point to obtain a target clothing image.
[0020] In a feasible implementation, the second sampling module is specifically used to: obtain the albedo map corresponding to the clothing image to be rendered, the albedo map being the color information of the clothing without considering the lighting factor; and sample the albedo map at each shading point to obtain the color component corresponding to the clothing image to be rendered.
[0021] In a feasible implementation manner, the information processing device further includes: a second acquisition module, configured to acquire a grid map, wherein the grid map is a four-square continuous image.
[0022] A third aspect of an embodiment of the present invention provides an electronic device, comprising: a memory and at least one processor, wherein instructions are stored in the memory; the at least one processor calls the instructions in the memory so that the electronic device executes the above-mentioned information processing method.
[0023] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned information processing method.
[0024] In the technical solution provided by the embodiment of the present invention, the normalized normal direction and the normalized illumination direction of each shading point in the to-be-rendered clothing image are obtained; four conditional areas are determined in the to-be-rendered clothing image according to the normalized normal direction and the normalized illumination direction; the preset grid map is sampled twice based on different zoom factors to obtain two sampling results; the two sampling results are respectively subjected to parameter multiplication processing and parameter maximum value processing to obtain processing results; the preset albedo map is sampled to obtain color components; and the target clothing image is generated according to the processing results, the four conditional areas and the color components. The embodiment of the present invention increases the differentiation of each conditional area by dividing the four conditional areas and independently calculating the shading points in each conditional area, increases the color difference between different parts of the clothing, adjusts the line density between the conditional areas by different zoom factors, improves the layering of the lines, and thus improves the fit between the clothing and the character style. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a schematic diagram of a first embodiment of an information processing method in an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of a second embodiment of the information processing method in an embodiment of the present invention;
[0027] Figure 3 is a schematic diagram of a target clothing image in an embodiment of the present invention;
[0028] Figure 4 is a schematic diagram of a third embodiment of the information processing method in an embodiment of the present invention;
[0029] Figure 5 A schematic diagram of an embodiment of an information processing device in an embodiment of the present invention;
[0030] Figure 6 FIG. 1 is a schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The present invention provides an information processing method, device, electronic device and storage medium for rendering clothing in a comic style with large color difference and strong line layering, thereby improving the fit between clothing and the comic style of the character.
[0032] It is understandable that the present invention can be applied to an electronic device. As an example but not a limitation, the electronic device can be a server or a terminal. This application is described using a server as an example.
[0033] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] In the existing solutions, hand-drawn texture stripes are generally added during rendering, or hand-drawn lines are drawn on the texture when making the albedo texture. However, the hand-drawn lines are not highly correlated with the comic style of the character itself, resulting in a low degree of fit. The present invention improves the fit between the character's clothing and the character's style by providing an information processing method.
[0035] See also Figure 1 , the first flow chart of the information processing method provided by the embodiment of the present invention specifically includes:
[0036] 101. Obtain the normalized normal direction and normalized illumination direction of each shading point in the clothing image to be rendered.
[0037] When the character clothing that appears in the game needs to be rendered, the server will transform the normalized normal direction N of the current shading point, which is baked into the model tangent space and normal map, into the world space to obtain the required normal direction. Among them, the lighting direction is the vector of the clothing pointing to the light source.
[0038] Among them, character costumes generally refer to costumes worn by humanoid characters, including non-player characters (NPC) and player characters. For example, NPCs can be humanoid characters such as dwarves, humans, elves, etc., and player characters can be characters created by players in the game, such as werewolves, humans, etc. who need to wear costumes. There is no specific limitation here.
[0039] 102. Determine four conditional areas in the clothing image to be rendered according to the normalized normal direction and the normalized illumination direction.
[0040] The server determines four conditional regions in the garment image to be rendered according to the normalized normal direction and the normalized illumination direction. It should be noted that the normalized normal direction and the normalized illumination direction are relative to each shading point, that is, each shading point has a corresponding normalized normal direction and normalized illumination direction.
[0041] 103. Sample the preset grid map twice based on different zoom factors to obtain two sampling results.
[0042] The server samples the preset grid map twice based on different zoom factors to obtain two sampling results. It should be noted that the zoom factors of the two samples are set to be different, and the layering of the lines between different areas is enhanced by setting different zoom factors.
[0043] 104. Perform parameter multiplication processing and parameter maximum value processing on the two sampling results to obtain the processing results.
[0044] The server performs parameter multiplication processing and parameter maximum value processing on the two sampling results respectively to obtain the processing results. The two sampling results include the first sampling result and the second sampling result. When the first sampling result is processed by parameter multiplication, the second sampling result is processed by parameter maximum value; when the second sampling result is processed by parameter multiplication, the first sampling result is processed by parameter maximum value.
[0045] 105. Sample the preset albedo map to obtain color components.
[0046] The server samples the preset albedo map to obtain color components. It should be noted that the albedo map here is the color map corresponding to the clothing in the present invention, and the color map is baked in the corresponding software and contains the color information of the clothing without considering the lighting factor.
[0047] 106. Generate a target clothing image based on the processing results, the four conditional regions and the color components.
[0048] The server generates the target clothing image according to the processing results, the four conditional areas and the color components. The calculated values of the four conditional areas are independent of each other. The server samples the middle two areas of the four conditional areas according to the preset intensity parameters according to the set zoom multiples to obtain the processing results of the two middle areas.
[0049] The embodiment of the present invention increases the differentiation of each conditional area and increases the color difference between different parts of the clothing by dividing the conditional areas into four and independently calculating the colored points in each conditional area. The density of lines between the conditional areas is adjusted by different zoom factors, the layering of the lines is improved, and the fit between the clothing and the character style is thereby improved.
[0050] See also Figure 2 , a second flow chart of the information processing method provided by an embodiment of the present invention specifically includes:
[0051] 201. Obtain the normalized normal direction and normalized illumination direction of each shading point in the clothing image to be rendered.
[0052] When the character clothing that appears in the game needs to be rendered, the server will transform the normalized normal direction N of the current shading point, which is baked into the model tangent space and normal map, into the world space to obtain the required normal direction. Among them, the lighting direction is the vector of the clothing pointing to the light source.
[0053] Among them, character costumes generally refer to costumes worn by humanoid characters, including non-player characters (NPC) and player characters. For example, NPCs can be humanoid characters such as dwarves, humans, elves, etc., and player characters can be characters created by players in the game, such as werewolves, humans, etc. who need to wear costumes. There is no specific limitation here.
[0054] 202. Determine four conditional regions in the garment image to be rendered according to the normalized normal direction and the normalized illumination direction.
[0055] For example, the server generates a light intensity NoL according to the normalized normal direction N and the normalized light direction L; the server divides the clothing image to be rendered into regions according to the light intensity NoL, and obtains four conditional regions A1, A2, A3, and A4.
[0056] 203. Sample the preset grid map twice based on different zoom factors to obtain two sampling results.
[0057] The server samples the preset grid map according to the first zoom factor to obtain a first sampling result; the server samples the grid map according to the second zoom factor to obtain a second sampling result, and the second zoom factor is different from the first zoom factor. For example, the server samples the preset grid map according to the first zoom factor tiling1 to obtain a first sampling result t1; the server samples the grid map according to the second zoom factor tiling2 to obtain a second sampling result t2, and the second zoom factor tiling1 is different from the first zoom factor tiling2.
[0058] 204. Perform parameter multiplication processing and parameter maximum value processing on the two sampling results respectively to obtain the processing results.
[0059] The server determines a first sampling parameter and a second sampling parameter, and the value ranges of the first sampling parameter and the second sampling parameter are both greater than or equal to 0 and less than or equal to 1; the server seeks a maximum value between the first sampling result and the first sampling parameter, and records the determined maximum value as the first processing result; the server multiplies the second sampling result and the second sampling parameter, and records the multiplication result as the second processing result.
[0060] For example, the server determines a first sampling parameter f1 and a second sampling parameter f2, the value range of f1 is [0,1], and the value range of f2 is [0,1]; the server finds the maximum value between the first sampling result t1 and the first sampling parameter f1, that is, max(t1,f1), and records the determined maximum value max(t1,f1) as the first processing result C1; the server multiplies the second sampling result t2 and the second sampling parameter f2, that is, t2*f2, and records the multiplication result as the second processing result C2.
[0061] 205. Sample the preset albedo map to obtain color components.
[0062] The server obtains the albedo map corresponding to the clothing image to be rendered, and the albedo map is the color information of the clothing when the lighting factor is not considered; the server samples the albedo map at each shading point to obtain the color component corresponding to the clothing image to be rendered, and the color component is represented by Color. It should be noted that the albedo map here is the color map corresponding to the clothing in the present invention, and the color map is baked in the corresponding software, which contains the color information of the clothing when the lighting factor is not considered.
[0063] 206. Perform calculation according to the processing result and the four condition areas according to preset rules to obtain a first calculation result.
[0064] The server calculates according to the processing results and the four conditional areas according to the preset rules to obtain a first calculation result. For example, the server calculates according to the processing results C1 and C2 and the four conditional areas A1, A2, A3, and A4 according to the preset rules. The preset rules are: X = A1*C2+A2+A3*C1+A4*f1, and obtains the first calculation result X.
[0065] 207. Compare the numerical values of the first settlement result and the color components, take the minimum value as the pixel value of each coloring point, and obtain the target clothing image.
[0066] The server compares the numerical values between the first settlement result and the color component, and uses the minimum value as the pixel value of each coloring point to obtain the target clothing image. For example, the server compares the numerical values between the first settlement result X and the color component Color, and uses the minimum value R as the pixel value of each coloring point, R = Min (Color, A1*C2+A2+A3*C1+A4*f1), to obtain the target clothing image. The target clothing image is as follows Figure 3 As shown, Figure 3 The sneakers and trouser legs have obvious traces of stylization.
[0067] The embodiment of the present invention increases the differentiation of each conditional area and increases the color difference between different parts of the clothing by dividing the conditional areas into four and independently calculating the colored points in each conditional area. The density of lines between the conditional areas is adjusted by different zoom factors, the layering of the lines is improved, and the fit between the clothing and the character style is thereby improved.
[0068] See also Figure 4 , a third flow chart of the information processing method provided by an embodiment of the present invention specifically includes:
[0069] 401. Obtain a grid map, where the grid map is a four-square continuous image.
[0070] Specifically, the server obtains a grid map, which is a four-square continuous image, such as Figure 4 As shown, when the mesh object is within the screen display range, the server will mark the corresponding position of the screen rendering result image through rasterization.
[0071] 402. Obtain the normalized normal direction and the normalized illumination direction of each shading point in the garment image to be rendered.
[0072] 403. Determine four conditional regions in the garment image to be rendered according to the normalized normal direction and the normalized illumination direction.
[0073] For example, the server generates a light intensity NoL according to the normalized normal direction N and the normalized light direction L; the server divides the clothing image to be rendered into regions according to the light intensity NoL, and obtains four conditional regions A1, A2, A3, and A4.
[0074] In a feasible implementation manner, the server divides the clothing image to be rendered into regions according to the light intensity NoL, and obtains four conditional regions including: determining the first preset parameter and the second preset parameter of the clothing image to be rendered; determining the first conditional region according to the first step condition according to the light intensity, the first preset parameter and the second preset parameter; determining the second conditional region according to the second step condition according to the light intensity, the first preset parameter and the second preset parameter; determining the third conditional region according to the third step condition according to the first preset parameter, the second preset parameter and the second conditional region; determining the fourth conditional region according to the first conditional region and the second conditional region according to the fourth step condition.
[0075] For example, the server determines a first preset parameter m and a second preset parameter s of a clothing image to be rendered, wherein m and s are intermediate calculation parameters and have no actual physical meaning; the server determines a first conditional area A1 according to a first step condition based on the light intensity NoL, the first preset parameter m and the second preset parameter s, and the first step condition is: A1=step(smoothstep(ms,m+s,NoL),ms); the server determines a second conditional area A2 according to a second step condition based on the light intensity NoL, the first preset parameter m and the second preset parameter s, and the second step condition is: The condition is: A2=step(m+s,smoothstep(ms,m+s,NoL)); the server determines the third conditional area A3 according to the first preset parameter m, the second preset parameter s and the second conditional area A2 according to the third step condition: A3=step(m,smoothstep(ms,m+s,NoL))*(1-A2); the server determines the fourth conditional area A4 according to the first conditional area A1 and the second conditional area A2 according to the fourth step condition, and the fourth step condition is: A4=(1-A1)*(1-A2).
[0076] 404. Sample the preset grid map twice based on different zoom factors to obtain two sampling results.
[0077] 405. Perform parameter multiplication processing and parameter maximum value processing on the two sampling results respectively to obtain the processing results.
[0078] 406. Sample the preset albedo map to obtain color components.
[0079] 407. Perform calculation according to the processing result and the four condition areas according to preset rules to obtain a first calculation result.
[0080] 408. Compare the numerical values of the first settlement result and the color components, take the minimum value as the pixel value of each coloring point, and obtain the target clothing image.
[0081] Steps 404-408 are similar to steps 203-207 and will not be described again here.
[0082] The embodiment of the present invention increases the differentiation of each conditional area and increases the color difference between different parts of the clothing by dividing the conditional areas into four and independently calculating the colored points in each conditional area. The density of lines between the conditional areas is adjusted by different zoom factors, the layering of the lines is improved, and the fit between the clothing and the character style is thereby improved.
[0083] The above describes the information processing method in the embodiment of the present invention. The following describes the information processing device in the embodiment of the present invention. Figure 5 , an embodiment of the information processing device in the embodiment of the present invention includes:
[0084] The first acquisition module 501 is used to acquire the normalized normal direction and the normalized illumination direction of each shading point in the garment image to be rendered;
[0085] A determination module 502, configured to determine four conditional regions in the garment image to be rendered according to the normalized normal direction and the normalized illumination direction;
[0086] A first sampling module 503 is used to sample the preset grid map twice based on different zoom factors to obtain two sampling results;
[0087] A processing module 504 is used to perform parameter multiplication processing and parameter maximum value processing on the two sampling results to obtain a processing result;
[0088] The second sampling module 505 is used to sample the preset albedo map to obtain color components;
[0089] The generating module 506 is used to generate a target clothing image according to the processing result, the four conditional regions and the color components.
[0090] In a feasible implementation manner, the determining module 502 includes:
[0091] A generating submodule 5021, configured to generate illumination intensity according to the normalized normal direction and the normalized illumination direction;
[0092] The division submodule 5022 is used to divide the clothing image to be rendered into regions according to the light intensity to obtain four conditional regions.
[0093] In a feasible implementation manner, the division submodule 5022 is specifically used for:
[0094] Determining a first preset parameter and a second preset parameter of the garment image to be rendered;
[0095] Determine a first condition area according to the light intensity, the first preset parameter and the second preset parameter according to a first step condition;
[0096] Determine a second condition area according to the light intensity, the first preset parameter and the second preset parameter according to a second step condition;
[0097] determining a third conditional region according to the first preset parameter, the second preset parameter and the second conditional region according to a third step condition;
[0098] A fourth condition region is determined according to the first condition region and the second condition region according to a fourth step condition.
[0099] In a feasible implementation manner, the first sampling module 503 is specifically configured to:
[0100] Sampling a preset grid map according to a first zoom factor to obtain a first sampling result;
[0101] The grid map is sampled according to a second zoom factor to obtain a second sampling result, where the second zoom factor is different from the first zoom factor.
[0102] In a feasible implementation manner, the processing module 504 is specifically used for:
[0103] Determine a first sampling parameter and a second sampling parameter, wherein the value ranges of the first sampling parameter and the second sampling parameter are both greater than or equal to 0 and less than or equal to 1;
[0104] Finding a maximum value between the first sampling result and the first sampling parameter, and recording the determined maximum value as a first processing result;
[0105] The second sampling result and the second sampling parameter are multiplied, and the multiplication result is recorded as a second processing result.
[0106] In a feasible implementation manner, the generating module 506 is specifically used for:
[0107] Perform calculation according to the processing result and the four conditional areas according to preset rules to obtain a first calculation result;
[0108] The numerical values of the first settlement result and the color components are compared, and the minimum value is used as the pixel value of each coloring point to obtain the target clothing image.
[0109] In a feasible implementation manner, the second sampling module 505 is specifically configured to:
[0110] Obtaining an albedo map corresponding to the clothing image to be rendered, wherein the albedo map is color information of the clothing without considering lighting factors;
[0111] The albedo map is sampled at each shading point to obtain a color component corresponding to the clothing image to be rendered.
[0112] In a feasible implementation manner, the information processing device further includes:
[0113] The second acquisition module 507 is used to acquire a grid image, where the grid image is a four-square continuous image.
[0114] The embodiment of the present invention increases the differentiation of each conditional area and increases the color difference between different parts of the clothing by dividing the conditional areas into four and independently calculating the colored points in each conditional area. The density of lines between the conditional areas is adjusted by different zoom factors, the layering of the lines is improved, and the fit between the clothing and the character style is thereby improved.
[0115] Figure 6 6 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device 600 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 610 (for example, one or more processors) and a memory 620, and one or more storage media 630 (for example, one or more mass storage devices) storing application programs 633 or data 632. Among them, the memory 620 and the storage medium 630 can be short-term storage or permanent storage. The program stored in the storage medium 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the electronic device 600. Furthermore, the processor 610 can be configured to communicate with the storage medium 630 to execute a series of instruction operations in the storage medium 630 on the electronic device 600.
[0116] The electronic device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input and output interfaces 660, and / or one or more operating devices 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 6 The structure of the electronic device shown does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0117] By way of example and not limitation, electronic device 600 may be a server or a terminal.
[0118] An embodiment of the present invention provides an electronic device, including: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the electronic device executes the above-mentioned information processing method, and the specific method steps include:
[0119] The normalized normal direction and normalized illumination direction of each shading point in the to-be-rendered clothing image are obtained; four conditional regions are determined in the to-be-rendered clothing image according to the normalized normal direction and the normalized illumination direction; the preset grid map is sampled twice based on different zoom factors to obtain two sampling results; the two sampling results are respectively subjected to parameter multiplication processing and parameter maximum value processing to obtain the processing result; the preset albedo map is sampled to obtain the color component; the target clothing image is generated according to the processing result, the four conditional regions and the color component. By dividing the four conditional regions and independently calculating the shading points in each conditional region, the differentiation of each conditional region is increased, the color difference between different parts of the clothing is increased, the density of the lines between the conditional regions is adjusted by different zoom factors, the layering of the lines is improved, and the fit between the clothing and the character style is improved.
[0120] The above method of determining four conditional regions in the clothing image to be rendered according to the normalized normal direction and the normalized illumination direction includes: generating illumination intensity according to the normalized normal direction and the normalized illumination direction; dividing the clothing image to be rendered into regions according to the illumination intensity to obtain four conditional regions. In this method, the dot product result of the normal direction and the illumination direction is used as the illumination intensity, and the illumination intensity is used as the basis for region division, which increases the differences between the regions.
[0121] The above method divides the clothing image to be rendered into regions according to the illumination intensity to obtain four conditional regions, including: determining the first preset parameter and the second preset parameter of the clothing image to be rendered; determining the first conditional region according to the illumination intensity, the first preset parameter and the second preset parameter according to the first step condition; determining the second conditional region according to the illumination intensity, the first preset parameter and the second preset parameter according to the second step condition; determining the third conditional region according to the first preset parameter, the second preset parameter and the second conditional region according to the third step condition; determining the fourth conditional region according to the first conditional region and the second conditional region according to the fourth step condition. In this method, the relationship between the illumination direction and the normal in each region is limited to ensure that the shading points in a single region are of the same type.
[0122] The above-mentioned two samplings of the preset grid map based on different zoom factors to obtain two sampling results include: sampling the preset grid map according to the first zoom factor to obtain the first sampling result; sampling the grid map according to the second zoom factor to obtain the second sampling result, and the second zoom factor is different from the first zoom factor. In this method, two sampling processes with different zoom factors are provided, and the density of the sampling lines is adjusted by different zoom factors, thereby improving the layering of the lines.
[0123] The above-mentioned two sampling results are respectively subjected to parameter multiplication processing and parameter maximum value processing to obtain the processing result, including: determining the first sampling parameter and the second sampling parameter, the value range of the first sampling parameter and the second sampling parameter are both greater than or equal to 0 and less than or equal to 1; finding the maximum value between the first sampling result and the first sampling parameter, and recording the determined maximum value as the first processing result; multiplying the second sampling result and the second sampling parameter, and recording the multiplication result as the second processing result. In this way, sampling is performed by different intensity parameters, and the difference between the sampling results is enhanced.
[0124] The above method generates a target clothing image based on the processing result, the four conditional areas and the color component, including: performing calculation according to the processing result and the four conditional areas according to preset rules to obtain a first calculation result; comparing the numerical values between the first calculation result and the color component, taking the minimum value as the pixel value of each coloring point, and obtaining the target clothing image. In this method, the pixel value obtained by calculation is compared with the color of the clothing itself, and the smaller value is taken as the output value of the coloring point, thereby improving the color difference of each area in the clothing image.
[0125] The above-mentioned sampling of the preset albedo map to obtain the color components includes: obtaining the albedo map corresponding to the clothing image to be rendered, the albedo map is the color information of the clothing when the lighting factor is not considered; sampling the albedo map at each shading point to obtain the color components corresponding to the clothing image to be rendered. In this method, the calculation process of the color components is refined, the color of the clothing itself is determined, and the influence of lighting on the color calculation results is reduced.
[0126] Before obtaining the normalized normal direction and normalized illumination direction of each shading point in the garment image to be rendered, the method further includes: obtaining a grid map, which is a four-sided continuous image. In this method, a step of obtaining a grid map is provided, and a specific sampling object is provided.
[0127] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer executes the steps of the information processing method, which specifically include:
[0128] The normalized normal direction and normalized illumination direction of each shading point in the to-be-rendered clothing image are obtained; four conditional regions are determined in the to-be-rendered clothing image according to the normalized normal direction and the normalized illumination direction; the preset grid map is sampled twice based on different zoom factors to obtain two sampling results; the two sampling results are respectively subjected to parameter multiplication processing and parameter maximum value processing to obtain the processing result; the preset albedo map is sampled to obtain the color component; the target clothing image is generated according to the processing result, the four conditional regions and the color component. By dividing the four conditional regions and independently calculating the shading points in each conditional region, the differentiation of each conditional region is increased, the color difference between different parts of the clothing is increased, the density of the lines between the conditional regions is adjusted by different zoom factors, the layering of the lines is improved, and the fit between the clothing and the character style is improved.
[0129] The above method of determining four conditional regions in the clothing image to be rendered according to the normalized normal direction and the normalized illumination direction includes: generating illumination intensity according to the normalized normal direction and the normalized illumination direction; dividing the clothing image to be rendered into regions according to the illumination intensity to obtain four conditional regions. In this method, the dot product result of the normal direction and the illumination direction is used as the illumination intensity, and the illumination intensity is used as the basis for region division, which increases the differences between the regions.
[0130] The above method divides the clothing image to be rendered into regions according to the illumination intensity to obtain four conditional regions, including: determining the first preset parameter and the second preset parameter of the clothing image to be rendered; determining the first conditional region according to the illumination intensity, the first preset parameter and the second preset parameter according to the first step condition; determining the second conditional region according to the illumination intensity, the first preset parameter and the second preset parameter according to the second step condition; determining the third conditional region according to the first preset parameter, the second preset parameter and the second conditional region according to the third step condition; determining the fourth conditional region according to the first conditional region and the second conditional region according to the fourth step condition. In this method, the relationship between the illumination direction and the normal in each region is limited to ensure that the shading points in a single region are of the same type.
[0131] The above-mentioned two samplings of the preset grid map based on different zoom factors to obtain two sampling results include: sampling the preset grid map according to the first zoom factor to obtain the first sampling result; sampling the grid map according to the second zoom factor to obtain the second sampling result, and the second zoom factor is different from the first zoom factor. In this method, two sampling processes with different zoom factors are provided, and the density of the sampling lines is adjusted by different zoom factors, thereby improving the layering of the lines.
[0132] The above-mentioned two sampling results are respectively subjected to parameter multiplication processing and parameter maximum value processing to obtain the processing result, including: determining the first sampling parameter and the second sampling parameter, the value range of the first sampling parameter and the second sampling parameter are both greater than or equal to 0 and less than or equal to 1; finding the maximum value between the first sampling result and the first sampling parameter, and recording the determined maximum value as the first processing result; multiplying the second sampling result and the second sampling parameter, and recording the multiplication result as the second processing result. In this way, sampling is performed by different intensity parameters, and the difference between the sampling results is enhanced.
[0133] The above method generates a target clothing image based on the processing result, the four conditional areas and the color component, including: performing calculation according to the processing result and the four conditional areas according to preset rules to obtain a first calculation result; comparing the numerical values between the first calculation result and the color component, taking the minimum value as the pixel value of each coloring point, and obtaining the target clothing image. In this method, the pixel value obtained by calculation is compared with the color of the clothing itself, and the smaller value is taken as the output value of the coloring point, thereby improving the color difference of each area in the clothing image.
[0134] The above-mentioned sampling of the preset albedo map to obtain the color components includes: obtaining the albedo map corresponding to the clothing image to be rendered, the albedo map is the color information of the clothing when the lighting factor is not considered; sampling the albedo map at each shading point to obtain the color components corresponding to the clothing image to be rendered. In this method, the calculation process of the color components is refined, the color of the clothing itself is determined, and the influence of lighting on the color calculation results is reduced.
[0135] Before obtaining the normalized normal direction and normalized illumination direction of each shading point in the garment image to be rendered, the method further includes: obtaining a grid map, which is a four-sided continuous image. In this method, a step of obtaining a grid map is provided, and a specific sampling object is provided.
[0136] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0137] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0138] 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 invention, 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. The computer software product is stored in a storage medium, including 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 invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0139] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0140] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, 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 invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. An information processing method, characterized in that: include: Obtain the normalized normal direction and normalized illumination direction of each shading point in the garment image to be rendered; Determining four conditional areas in the garment image to be rendered according to the normalized normal direction and the normalized illumination direction; The preset grid map is sampled twice based on different zoom factors to obtain two sampling results; The two sampling results are respectively subjected to parameter multiplication processing and parameter maximum value processing to obtain processing results; Sample the preset albedo map to get the color component; generating a target clothing image according to the processing result, the four conditional regions and the color components; Determining four conditional areas in the clothing image to be rendered according to the normalized normal direction and the normalized illumination direction includes: Generate illumination intensity according to the normalized normal direction and the normalized illumination direction; Determining a first preset parameter and a second preset parameter of the garment image to be rendered; Determine a first condition area according to the light intensity, the first preset parameter and the second preset parameter according to a first step condition; Determine a second condition area according to the light intensity, the first preset parameter and the second preset parameter according to a second step condition; determining a third conditional region according to the first preset parameter, the second preset parameter and the second conditional region according to a third step condition; A fourth condition region is determined according to the first condition region and the second condition region according to a fourth step condition.
2. The information processing method according to claim 1, characterized in that: The method of sampling the preset grid map twice based on different zoom factors to obtain two sampling results includes: Sampling a preset grid map according to a first zoom factor to obtain a first sampling result; The grid map is sampled according to a second zoom factor to obtain a second sampling result, where the second zoom factor is different from the first zoom factor.
3. The information processing method according to claim 2, characterized in that: The two sampling results are respectively subjected to parameter multiplication processing and parameter maximum value processing to obtain processing results, including: Determine a first sampling parameter and a second sampling parameter, wherein the value ranges of the first sampling parameter and the second sampling parameter are both greater than or equal to 0 and less than or equal to 1; Finding a maximum value between the first sampling result and the first sampling parameter, and recording the determined maximum value as a first processing result; The second sampling result and the second sampling parameter are multiplied, and the multiplication result is recorded as a second processing result.
4. The information processing method according to claim 1, characterized in that: The step of generating a target clothing image according to the processing result, the four conditional regions and the color component comprises: Perform calculation according to the processing result and the four conditional areas according to preset rules to obtain a first calculation result; The numerical values of the first calculation result and the color components are compared, and the minimum value is used as the pixel value of each coloring point to obtain the target clothing image.
5. The information processing method according to any one of claims 1 to 4, characterized in that: The sampling of the preset albedo map to obtain color components includes: Obtaining an albedo map corresponding to the clothing image to be rendered, wherein the albedo map is color information of the clothing without considering lighting factors; The albedo map is sampled at each shading point to obtain a color component corresponding to the clothing image to be rendered.
6. The information processing method according to any one of claims 1 to 4, characterized in that: Before obtaining the normalized normal direction and the normalized illumination direction of each shading point in the garment image to be rendered, the method further includes: A grid image is obtained, where the grid image is a four-square continuous image.
7. An information processing device, characterized in that: include: A first acquisition module is used to acquire the normalized normal direction and the normalized illumination direction of each shading point in the garment image to be rendered; A determination module, used for determining four conditional areas in the garment image to be rendered according to the normalized normal direction and the normalized illumination direction; A first sampling module is used to sample a preset grid map twice based on different zoom factors to obtain two sampling results; A processing module, used for performing parameter multiplication processing and parameter maximum value processing on the two sampling results respectively to obtain a processing result; The second sampling module is used to sample the preset albedo map to obtain color components; A generating module, used for generating a target clothing image according to the processing result, the four conditional areas and the color component; The determination module comprises: A generating submodule, used for generating illumination intensity according to the normalized normal direction and the normalized illumination direction; A division submodule is used to determine the first preset parameter and the second preset parameter of the clothing image to be rendered; determine the first condition area according to the first step condition based on the light intensity, the first preset parameter and the second preset parameter; determine the second condition area according to the second step condition based on the light intensity, the first preset parameter and the second preset parameter; determine the third condition area according to the third step condition based on the first preset parameter, the second preset parameter and the second condition area; determine the fourth condition area according to the first condition area and the second condition area according to the fourth step condition.
8. An electronic device, characterized in that: The electronic device comprises: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instructions in the memory so that the electronic device executes the information processing method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed by a processor, the information processing method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Image rendering method and device, electronic equipment and computer readable storage medium
CN110084154A
Graph processing method and device, computer equipment and storage medium
CN114119847A