Three-dimensional virtual model processing method and device, storage medium and electronic equipment

By obtaining the normal vector and the light source direction vector in the three-dimensional virtual model processing for dot product, smoothing the initial lighting value, and combining the display parameter correlation, the problem of low efficiency in the existing technology is solved, and more efficient three-dimensional virtual model processing and better artistic effects are achieved.

CN120339488APending Publication Date: 2025-07-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410064698.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-16
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

When processing a three-dimensional virtual model, the prior art only relies on the initial illumination value for light and dark changes, and does not consider the correlation of display parameters in multiple dimensions, resulting in long calculation time, large resource occupancy and low efficiency.

Method used

By obtaining the normal vector and light source direction vector of the surface area of the three-dimensional virtual model, dot product operation to determine the initial lighting value, and smoothing it, combining the correlation between the lighting value and the display parameters of other dimensions, quickly determine the display parameters of the surface area.

Benefits of technology

It improves the processing efficiency of the three-dimensional virtual model, reduces the investment in computing resources and storage space, and improves the artistic effect of the three-dimensional virtual characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120339488A_ABST
    Figure CN120339488A_ABST
Patent Text Reader

Abstract

The invention discloses a three-dimensional virtual model processing method and device, a storage medium and electronic equipment. The method comprises the steps that a normal vector of a surface area of a three-dimensional virtual model and a light source direction vector of a virtual light source are obtained, the normal vector is a unit vector perpendicular to the surface area, and the light source direction vector is a unit vector pointing to the virtual light source from the surface area; performing dot product operation on the normal vector and the light source direction vector to obtain a dot product value, and determining an initial illumination value according to the dot product value; smoothing the initial illumination value to obtain a first illumination value; and determining display parameters of the surface area according to the first illumination value. The technical problem that the efficiency is low in the processing process of the three-dimensional virtual model is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a method and apparatus for processing a three-dimensional virtual model, a storage medium, and an electronic device. Background Art

[0002] In a virtual scene, different rendering methods are usually adopted to process virtual characters in the virtual scene. For example, lighting processing, stylized rendering, etc. are performed on the surface of a three-dimensional virtual model corresponding to a cartoon character in a two-dimensional game.

[0003] In the related art, the initial lighting value is mainly determined according to the light source direction on the triangular patches of the three-dimensional virtual model corresponding to the cartoon character, and based on this, the bright part or the dark part on the three-dimensional virtual model corresponding to the cartoon character is determined. Then, the corresponding base color (Basecolor) is applied to the bright part, and the shadow color (Shadowcolor) is applied to the dark part.

[0004] In order to improve the art effect of the three-dimensional virtual character, in addition to the influence of the above initial lighting value on the light and shadow changes in the surface area of the three-dimensional virtual model, display parameters in multiple dimensions such as the coloring effect, line arrangement effect (for example, the density and curvature of lines), and skin bleeding effect on the surface area also affect the dynamic sense and three-dimensional sense of the three-dimensional virtual model.

[0005] However, the processing method in the related art has at least the following problems: 1) Since only the initial lighting value is relied on to process the light and dark changes in the surface area of the three-dimensional virtual model in the related art, and the correlation between the display parameters in the above multiple dimensions is not considered, it is necessary to calculate, process, and store the display parameters in each dimension separately, which not only consumes a lot of time but also occupies a lot of hardware resources (for example, storage space, arithmetic processing); 2) Since the light source direction and light intensity will continuously change in the actual application scenario, when the lighting information changes, it is necessary to not only recalculate the initial lighting value but also calculate the other display parameters in multiple dimensions under different lighting conditions separately, resulting in the technical problem of low efficiency in the process of processing the three-dimensional virtual model.

[0006] To address the above problems, no effective solution has been proposed yet. Summary of the Invention

[0007] Embodiments of this application provide a method and apparatus for processing a three-dimensional virtual model, a storage medium, and an electronic device, so as to at least solve the technical problem of low efficiency in the process of processing the three-dimensional virtual model.

[0008] According to one aspect of the embodiments of the present application, a method for processing a three-dimensional virtual model is provided, including: obtaining a normal vector of a surface area of the three-dimensional virtual model and a light source direction vector of a virtual light source, where the normal vector is a unit vector perpendicular to the surface area, and the light source direction vector is a unit vector pointing from the surface area to the virtual light source; performing a dot product operation on the normal vector and the light source direction vector to obtain a dot product value, and determining an initial illumination value according to the dot product value; performing a smoothing process on the initial illumination value to obtain a first illumination value; and determining a display parameter of the surface area according to the first illumination value.

[0009] Optionally, the determining the initial illumination value according to the dot product value includes: mapping the dot product value to a preset first value range to obtain a mapping value of the dot product value within the first value range, where the initial illumination value is the mapping value, and the first value range is a value range greater than 0.

[0010] Optionally, the mapping the dot product value to a preset first value range to obtain a mapping value of the dot product value within the first value range includes: performing a multiplication operation on the dot product value and a target mean value to obtain a first product value, where the target mean value is the mean value of the lower boundary value and the upper boundary value of the first value range; and performing an addition operation on the first product value and the target mean value to obtain the mapping value.

[0011] Optionally, the performing a smoothing process on the initial illumination value to obtain a first illumination value includes: when the initial illumination value is less than the lower boundary value of a preset first difference range, determining the first illumination value as a preset first value; when the initial illumination value is greater than the upper boundary value of the first difference range, determining the first illumination value as a preset second value, where the second value is greater than the first value; and when the initial illumination value is greater than or equal to the lower boundary value of the first difference range and less than or equal to the upper boundary value of the first difference range, determining the first illumination value as a value within a second value range, where the lower boundary value of the second value range is the first value and the upper boundary value of the second value range is the second value.

[0012] Optionally, the determining the first illumination value as a value within a second value range includes: dividing the first difference by a second difference to obtain a linear mapping value, where the first difference is the difference obtained by subtracting the lower boundary value of the first difference range from the initial illumination value, and the second difference is the difference obtained by subtracting the lower boundary value of the first difference range from the upper boundary value of the first difference range; using the linear mapping value as an input parameter of a target curve function to obtain a value of the target curve function, where the first illumination value is the value of the target curve function, and the value range of the value of the target curve function is the second value range.

[0013] Optionally, determining the display parameters of the surface area according to the first light value includes: determining the value of the color parameter of the surface area according to the first light value, where the display parameters include color parameters.

[0014] Optionally, determining the value of the color parameter of the surface area according to the first light value includes: determining a color adjustment value according to the first light value, where the color adjustment value is used to determine a target color value within a third value range, the lower boundary value of the third value range is a first sampled color value sampled from a preset two-dimensional highlight texture map, and the upper boundary value of the third value range is a second sampled color value sampled from a preset two-dimensional shadow texture map; determining the value of the color parameter as the target color value within the third value range according to the color adjustment value.

[0015] Optionally, determining the color adjustment value according to the first light value includes: determining a target adjustment value according to the first light value and a preset first sampled value; in the case where the target adjustment value is less than the lower boundary value of a preset fourth difference range, determining the color adjustment value as a preset third value; in the case where the target adjustment value is greater than the upper boundary value of the fourth difference range, determining the color adjustment value as a preset fourth value, where the fourth value is greater than the third value; in the case where the target adjustment value is greater than or equal to the lower boundary value of the fourth difference range and less than or equal to the upper boundary value of the fourth difference range, determining the color adjustment value as a value within a fourth value range, where the lower boundary value of the fourth value range is the third value and the upper boundary value of the fourth value range is the fourth value.

[0016] Optionally, determining the target adjustment value according to the first light value and a preset first sampled value includes: sampling a preset wire arrangement texture map on the surface area to obtain a first sampled value; performing a multiplication operation on the first light value and a preset first coefficient to obtain a second product value, where the first coefficient is greater than 1; subtracting the first sampled value from a preset second coefficient to obtain a third difference, where the second coefficient is greater than or equal to 1; subtracting the third difference from the second product value to obtain the target adjustment value.

[0017] Optionally, determining the value of the color parameter as the target color value within the third value range according to the color adjustment value includes: performing a multiplication operation on the color adjustment value and a first color difference to obtain a third product value, where the first color difference is the difference obtained by subtracting the first sampled color value from the second sampled color value; performing an addition operation on the first sampled color value and the third product value to obtain the target color value.

[0018] Optionally, determining the display parameters of the surface area according to the first light value includes: sampling a preset first black line map on the surface area to obtain a second sampling value, where the first black line map includes a first set of black lines arranged in parallel; sampling a preset second black line map on the surface area to obtain a third sampling value, where the second black line map includes a second set of black lines arranged in parallel, and the number of black lines arranged in a unit area in the first black line map is less than the number of black lines arranged in a unit area in the second set of black lines; determining the value of the black line parameter of the surface area according to the first light value, the second sampling value, and the third sampling value, where the value of the black line parameter is used to represent the black lines displayed in the surface area, the display parameters include the black line parameter, and the value of the black line parameter is a value within a fifth value range, the lower boundary value of the fifth value range is the second sampling value, and the upper boundary value of the fifth value range is the third sampling value.

[0019] Optionally, determining the value of the black line parameter of the surface area according to the first light value, the second sampling value, and the third sampling value includes: performing a multiplication operation on the first light value and the first sampling difference to obtain a fourth product value, where the first sampling difference is the difference obtained by subtracting the second sampling value from the third sampling value; performing an addition operation on the second sampling value and the fourth product value to obtain the value of the black line parameter.

[0020] Optionally, determining the display parameters of the surface area according to the first light value includes: performing an addition operation on the initial light value and a preset offset value to obtain an offset light value; in the case where the offset light value is less than the lower boundary value of a preset first difference range, determining the second light value as a preset first value; in the case where the offset light value is greater than the upper boundary value of the first difference range, determining the second light value as a preset second value, where the second value is greater than the first value; in the case where the offset light value is greater than or equal to the lower boundary value of the first difference range and less than or equal to the upper boundary value of the first difference range, determining the second light value as a value within a second value range, where the lower boundary value of the second value range is the first value and the upper boundary value of the second value range is the second value; determining the value of the scattering parameter according to the first light value and the second light value, where the display parameters include the scattering parameter, and the value of the scattering parameter is used to represent the transparency of light passing through the surface area.

[0021] Optionally, determining the value of the scattering parameter according to the first light value and the second light value includes: performing a multiplication operation on the second light value and a fourth difference to obtain the value of the scattering parameter, where the fourth difference is the difference obtained by subtracting the first light value from a preset third coefficient, and the third coefficient is greater than or equal to 1.

[0022] Optionally, after determining the display parameters of the surface area according to the first illumination value, the above method further includes: displaying the surface area according to the display parameters of the surface area.

[0023] According to another aspect of the embodiments of the present application, there is also provided a processing device for a three-dimensional virtual model, including: a first acquisition unit, configured to acquire a normal vector of a surface area of the three-dimensional virtual model and a light source direction vector of a virtual light source, where the normal vector is a unit vector perpendicular to the surface area, and the light source direction vector is a unit vector pointing from the surface area to the virtual light source; a first processing unit, configured to perform a dot product operation on the normal vector and the light source direction vector to obtain a dot product value, and determine an initial illumination value according to the dot product value; a second processing unit, configured to perform smoothing processing on the initial illumination value to obtain a first illumination value; a third processing unit, configured to determine the display parameters of the surface area according to the first illumination value.

[0024] According to another aspect of the embodiments of the present application, there is also provided a computer program product, including computer programs / instructions, and when the computer programs / instructions are executed by a processor, the steps of the above method are implemented.

[0025] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to execute the above processing method of the three-dimensional virtual model through the computer program.

[0026] Through the above embodiments provided by the present application, an initial illumination value is obtained according to the dot product value determined by the normal vector of the surface area of the three-dimensional virtual model and the light source direction vector of the virtual light source, and then the initial illumination value is smoothed to obtain a first illumination value, and the display parameters of the surface area are further determined. In other words, in the embodiments of the present application, by smoothing the initial illumination value, the illumination information on the surface area of the three-dimensional virtual model is made more realistic; and by using the correlation between the smoothed first illumination value and the display parameters in other dimensions, the values of the display parameters in other dimensions can be quickly determined, reducing the time cost, reducing the input of computing resources, and at the same time avoiding occupying a large amount of storage space, improving the processing efficiency of the three-dimensional virtual model and enhancing the artistic effect of the three-dimensional virtual character. Description of the Drawings

[0027] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments and descriptions thereof of the present application are used to explain the present application, and do not constitute an improper limitation of the present application.

[0028] Figure 1 It is a schematic diagram of an application scenario of an optional processing method of a three-dimensional virtual model according to an embodiment of the present application;

[0029] Figure 2 is a flowchart of an optional method for processing a three-dimensional virtual model according to an embodiment of the present application;

[0030] Figure 3 is a schematic diagram of an optional normal vector and a light source direction vector according to an embodiment of the present application;

[0031] Figure 4 is a comparison diagram of the effects of processing methods for three-dimensional virtual models between related technologies and the technical solution of the present application;

[0032] Figure 5 is a schematic diagram of an optional method for controlling the softness and hardness of light and shadow transition by using a preset _hardness parameter according to an embodiment of the present application;

[0033] Figure 6 is a schematic diagram of an optional process for sampling a Diffuse map and a Dark map to determine the value of a color parameter according to an embodiment of the present application;

[0034] Figure 7 is a specific embodiment of the influence of UV pairs on the line density in a wireframe map according to an embodiment of the present application;

[0035] Figure 8 is a schematic diagram of an optional method for simulating a hand-drawn wireframe effect according to an embodiment of the present application;

[0036] Figure 9 is a schematic diagram of an optional method for displaying only hand-drawn wireframes at the light and dark boundaries according to an embodiment of the present application;

[0037] Figure 10 is a schematic diagram of an optional method for simulating the degree of curvature of a line according to an embodiment of the present application;

[0038] Figure 11 is a schematic diagram of an optional first black line map and a second black line map according to an embodiment of the present application;

[0039] Figure 12 is a schematic diagram of an optional method for customizing the 3S bleeding effect of skin according to an embodiment of the present application;

[0040] Figure 13 is a schematic diagram of an optional method for determining the value of a scattering parameter according to an embodiment of the present application;

[0041] Figure 14 is a schematic diagram of the structure of an optional device for processing a three-dimensional virtual model according to an embodiment of the present application;

[0042] Figure 15It is a schematic structural diagram of an optional electronic device according to an embodiment of the present application. Detailed implementation manners

[0043] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0045] The technical solutions in the embodiments of the present application will comply with legal regulations during the implementation process. When operating according to the technical solutions in the embodiments, the data used does not involve user privacy, ensuring the compliance and legality of the operation process while guaranteeing the security of the data.

[0046] Glossary:

[0047] Lambert illumination model: The Lambert illumination model is a calculation method based on the diffuse reflection illumination model, used to simulate the illumination phenomenon on the surface of rough objects. By calculating the dot product of the normal vector and the light source direction vector, the light and dark changes of the object surface under different illumination conditions can be obtained;

[0048] Bisection method: The bisection method is a cartoon rendering technique that determines whether the object surface is a bright surface or a dark surface by judging whether the dot product result of the normal vector (N) and the light source direction vector (L) exceeds a certain threshold. The bright surface is painted with BaseColor, and the dark surface is painted with ShadowColor;

[0049] Cel Shading: Cel Shading (also known as cartoon rendering) is a computer graphics rendering technique used to simulate hand-drawn cartoon effects. By dividing the light and dark on the surface of an object into several discrete color levels, a rendering effect with a hand-drawn style can be achieved;

[0050] SmoothStep function: SmoothStep function is a mathematical function used for smooth interpolation. By limiting the input value between 0 and 1 and performing smoothing, the softness and hardness of the light and shadow transition can be controlled;

[0051] PBR (Physically Based Rendering): PBR is a rendering technology based on physical principles. By simulating the interaction between light and the surface of objects, more realistic and natural rendering effects can be achieved.

[0052] SSS (Subsurface Scattering): SSS is a phenomenon that simulates the scattering of light inside a translucent object. By simulating the 3S effect, the scattering of light can be increased at the junction of light and dark, making the character's skin present a richer sense of layering and three-dimensionality;

[0053] Texture Map: Texture Map is a technology that maps a two-dimensional image to the surface of a three-dimensional model. By using different types of texture maps (such as hand-painted line maps, hand-painted black line maps, etc.), richer and more diverse rendering effects can be achieved;

[0054] Dot Product: Dot product is a vector operation method used to calculate the angle between two vectors. By calculating the dot product of the normal vector and the light source direction vector, the brightness and darkness of the object surface under different lighting conditions can be obtained;

[0055] Linear interpolation (Lerp): Linear interpolation is a mathematical interpolation method used to calculate the smooth transition between two values. By using the linear interpolation function, you can achieve dynamic mixing of hand-painted black line maps of different densities;

[0056] Light source direction vector (L): The light source direction vector refers to the unit vector pointing from the object surface to the light source. It is used to calculate the brightness and darkness changes of the object surface under lighting conditions;

[0057] Normal vector (N): The normal vector is a unit vector perpendicular to the surface of an object. It is used to calculate the brightness and darkness changes of the surface of an object under lighting conditions;

[0058] Half Lambert: Half Lambert is a method that maps the dot product result of the normal vector and the light source direction vector to the range of (0, 1). By calculating the Half Lambert value, all lighting information can be retained to achieve a more natural and harmonious rendering effect;

[0059] American Comic Style: American Comic Style refers to the comic style originating from the United States, which is characterized by obvious changes in line thickness, strong lighting effects and a sense of dynamics;

[0060] Tiling: Tiling refers to the process of repeatedly distributing texture maps on the surface of a 3D model. By adjusting the tiling value, the simulation of line thickness and distortion degree can be achieved;

[0061] Base / ShadowColor: BaseColor (base color) refers to the color of the object surface without the influence of light. In Cel Shading rendering, BaseColor is used for the lit part of the surface. ShadowColor (shadow color) refers to the color in the shadow, which is the shadow color generated on the object surface under the influence of light. In Cel Shading rendering, ShadowColor is used for painting the dark part of the surface.

[0062] According to one aspect of the embodiments of the present application, a method for processing a 3D virtual model is provided. As an alternative implementation, the above method for processing a 3D virtual model can be but is not limited to being applied to an application scenario as Figure 1 shown. In the application scenario as Figure 1 shown, the terminal device 102 can communicate with the server 106 through the network 104, and the server 106 can perform operations on the database 108, such as write data operations or read data operations. The above terminal device 102 can include but is not limited to a human-computer interaction screen, a processor and a memory. The above human-computer interaction screen can be used to display 3D virtual models, virtual light sources, etc. on the terminal device 102. The above processor can be used to respond to the above human-computer interaction operations, perform corresponding operations, or generate corresponding instructions and send the generated instructions to the server 106. The above memory is used to store relevant processing data, such as legal vectors, light source direction vectors and initial lighting values, etc.

[0063] As an alternative approach, the following steps in the processing method of the three-dimensional virtual model can be executed on the server 106: Step S102, obtain the normal vector of the surface area of the three-dimensional virtual model and the light source direction vector of the virtual light source, where the normal vector is a unit vector perpendicular to the surface area, and the light source direction vector is a unit vector pointing from the surface area to the virtual light source; Step S104, perform a dot product operation on the normal vector and the light source direction vector to obtain a dot product value, and determine an initial illumination value based on the dot product value; Step S106, perform smoothing processing on the initial illumination value to obtain a first illumination value; Step S108, determine the display parameters of the surface area based on the first illumination value.

[0064] The processing method of the three-dimensional virtual model in the embodiments of the present application can be but is not limited to being applied to the processing of the three-dimensional virtual model of a cartoon character in a virtual scene. For example, it is used for the light and shadow transition processing, rendering processing, etc. of the surface area of the three-dimensional virtual model corresponding to a cartoon character in a second-generation game.

[0065] By adopting the above method, through smoothing the initial illumination value, the illumination information on the surface area of the three-dimensional virtual model becomes more realistic; and by utilizing the correlation between the smoothed first illumination value and the display parameters in other dimensions, the values of the display parameters in other dimensions can be quickly determined, reducing the time cost, reducing the input of computing resources, and at the same time avoiding occupying a large amount of storage space, improving the processing efficiency of the three-dimensional virtual model and enhancing the artistic effect of the three-dimensional virtual character.

[0066] To solve the problem of low accuracy that appears in the above multi-task learning process, a processing method of a three-dimensional virtual model is proposed in the embodiments of the present application. Figure 2 It is a flowchart of the processing method of the three-dimensional virtual model according to the embodiments of the present application, and this process includes the following steps S202 to step S208.

[0067] Step S202, obtain the normal vector of the surface area of the three-dimensional virtual model and the light source direction vector of the virtual light source, where the normal vector is a unit vector perpendicular to the surface area, and the light source direction vector is a unit vector pointing from the surface area to the virtual light source;

[0068] Step S204, perform a dot product operation on the normal vector and the light source direction vector to obtain a dot product value, and determine an initial illumination value based on the dot product value;

[0069] Step S206, perform smoothing processing on the initial illumination value to obtain a first illumination value;

[0070] Step S208, determine the display parameters of the surface area based on the first illumination value.

[0071] Such asFigure 3 As shown, assume that the three-dimensional virtual model corresponding to the virtual character is composed of tiled triangular patches. For the surface area where one of the triangular patches is located, assume that one of its vertices A represents the triangular patch. Then, the unit vector perpendicular to the surface area is the normal vector N, and the unit vector pointing from vertex A to the virtual light source is the light source direction vector L of the virtual light source.

[0072] Perform a dot product operation on the normal vector and the light source direction vector to obtain the dot product value dot(N,L), that is, obtain the cosine value cosθ of the angle between the normal vector and the light source direction vector, and determine the initial illumination value according to the dot product value.

[0073] Among them, the value range of the above dot product value is (-1, 1). 1 means that the light source direction is completely consistent with the normal direction, and -1 means that the light source direction is completely opposite to the normal direction.

[0074] In order to retain all lighting information, it is necessary to map the above dot product result, specifically including:

[0075] Map the dot product value to a preset first value range to obtain the mapped value of the dot product value in the first value range. Among them, the initial illumination value is the mapped value, and the first value range is a value range greater than 0.

[0076] Specifically, through the half Lambert method, map the dot product result of the normal vector and the light source direction vector to the range (0, 1). By calculating the half Lambert value, all lighting information can be retained, achieving a more natural and harmonious rendering effect.

[0077] The specific method for calculating the half Lambert value is as follows:

[0078] Perform a multiplication operation on the dot product value and the target mean value to obtain the first product value, where the target mean value is the mean value of the lower boundary value and the upper boundary value of the first value range;

[0079] And perform an addition operation on the first product value and the target mean value to obtain the mapped value.

[0080] Specifically, map the above dot product value to a preset first value range through the following formula (1) to obtain the initial illumination value halfLambert:

[0081] halfLambert = (dot(N,L) * 0.5 + 0.5) (1)

[0082] Among them, in this embodiment, it is assumed that the target mean value is the mean value of 0.5 determined according to the upper boundary value 1 and the lower boundary value 0 of the first value range (0, 1). When the value of halfLambert is 0, it means that the surface area of the three-dimensional virtual model is completely in the shadow; when the value of halfLambert is 1, it means that the surface area of the three-dimensional virtual model is completely under the light.

[0083] It is easy to understand that for the surface area that is completely under the light (bright area), the initial light value obtained by the above method is 1, and for the surface area that is completely in the shadow (dark area), the initial light value is 0. However, due to the structural properties of the three-dimensional virtual model itself, there is a light-dark boundary area. For example, as Figure 4 shown, the waist of the three-dimensional virtual character is the light-dark boundary.

[0084] Using the traditional dichotomy method, by judging whether the dot product result of the normal vector and the light source direction vector exceeds the preset threshold, if so, paint the bright surface with Basecolor, otherwise paint the dark surface with Shadowcolor, then the processed effect is as shown in Figure 4 the left figure in. It can be seen that the three-dimensional virtual model obtained by using the traditional dichotomy method is prone to the defect of relatively rigid light and shadow transition at the light-dark boundary.

[0085] To solve the above problems, a smoothing method is proposed in the embodiment of the present application to make the light and shadow transition at the light-dark boundary softer, specifically as follows:

[0086] In the case where the initial light value is less than the lower boundary value of the preset first difference range, the first light value is determined as the preset first value;

[0087] In the case where the initial light value is greater than the upper boundary value of the first difference range, the first light value is determined as the preset second value, where the second value is greater than the first value;

[0088] In the case where the initial light value is greater than or equal to the lower boundary value of the first difference range and less than or equal to the upper boundary value of the first difference range, the first light value is determined as a value within the second value range, where the lower boundary value of the second value range is the first value and the upper boundary value of the second value range is the second value.

[0089] To adjust the softness and hardness of the light transition (which can also be understood as the light and shadow transition), the SmoothStep function is introduced in this embodiment. Among them, the SmoothStep function adjusts the halfLambert value according to a preset _hardness parameter.

[0090] The specific implementation process is through the following formula (2):

[0091] float celLight=smoothstep(_hardness,(1-_hardness),halfLambert) (2)

[0092] Among them, _hardness is a parameter used to control the hardness of the light transition, ranging from (0 to 0.499). When _hardness = 0, it is the original halfLambert effect, and when _hardness = 0.499, it is a very hard transition.

[0093] By adjusting the value of _hardness, the light and shadow transition effect of the surface area of the 3D virtual model can be controlled. Figure 5 As shown, it can be seen intuitively that when _hardness=0, the light and shadow transition at the light and dark junction of the three-dimensional virtual model surface is the softest; when _hardness=0.25, the light and shadow transition at the light and dark junction of the three-dimensional virtual model surface is relatively soft; when _hardness=0.499, the light and shadow transition at the light and dark junction of the three-dimensional virtual model surface is very abrupt.

[0094] In this embodiment, the lower boundary value of the first difference range may be but is not limited to _hardness, and the upper boundary value is (1-_hardness). When the initial illumination value halfLambert of the surface area of the three-dimensional virtual model is less than the lower boundary value of the first difference range, the first illumination value celLight is determined as the preset first value; when the initial illumination value halfLambert of the surface area of the three-dimensional virtual model is greater than the lower boundary value of the first difference range, the first illumination value celLight is determined as the preset second value; when the initial illumination value halfLambert of the surface area of the three-dimensional virtual model is between the upper and lower boundary values of the first difference range, the first illumination value is determined as a value within the second value range.

[0095] As an optional implementation manner, determining the first illumination value as a value within the second value range includes:

[0096] Dividing the first difference by the second difference to obtain a linear mapping value, wherein the first difference is a difference obtained by subtracting a lower boundary value of the first difference range from the initial illumination value, and the second difference is a difference obtained by subtracting a lower boundary value of the first difference range from an upper boundary value of the first difference range;

[0097] The linear mapping value is used as an input parameter of the target curve function to obtain a value of the target curve function, wherein the first illumination value is the value of the target curve function, and a value range of the value of the target curve function is a second value range.

[0098] Assume that the value of a = _hardness, the value of b = (1 - _hardness), and the value of x = halfLambert. Then, through the following linear mapping method, the linear mapping value k1 = (x - a) / (b - a) is obtained; then, the linear mapping value is used as the input function of the target curve function to perform a non-linear mapping on the initial light value to obtain the corresponding first light value.

[0099] Among them, the first difference is the difference between halfLambert and _hardness, and the second difference is the difference between (1 - _hardness) and _hardness.

[0100] The above target curve function can be but is not limited to The value K of the target function is the value of the first light value celLight after smoothing processing.

[0101] Through the above smoothing processing, the light values of the surface area at the light and dark boundary of the three-dimensional virtual model can be more evenly transitioned, so that the light and shadow transition of the three-dimensional virtual model is softer, and the lighting effect of the light is more realistically displayed, laying a foundation for improving the rendering effect of the three-dimensional virtual character.

[0102] In addition to using the above first light value to smooth the light values of the surface area of the three-dimensional virtual model, in the embodiments of the present application, the initial light value can also be used to determine other display parameters of the surface area, such as color parameters, sampling values of the wireframe texture, sampling values of the black line texture, etc. The implementation processes of determining the display parameters in the above respective dimensions will be described below in conjunction with specific embodiments.

[0103] As an optional example, determining the display parameters of the surface area according to the first light value includes:

[0104] Determining the value of the color parameter of the surface area according to the first light value, where the display parameter includes the color parameter.

[0105] Exemplarily, determining the value of the color parameter of the surface area according to the first light value includes:

[0106] Determining a color adjustment value according to the first light value, where the color adjustment value is used to determine a target color value within a third value range, the lower boundary value of the third value range is a first sampled color value sampled from a preset two-dimensional highlight texture, and the upper boundary value of the third value range is a second sampled color value sampled from a preset two-dimensional shadow texture;

[0107] Determining the value of the color parameter as the target color value within the third value range according to the color adjustment value.

[0108] According to the color adjustment value hatchLine, determine the value of the color parameter as the target color value within the third value range, and specifically obtain the value Color of the color parameter through the following formula (3):

[0109] float3 Color = lerp(DiffuseTex, DarkTex, hatchLine) (3)

[0110] Among them, DiffuseTex represents the first sampled color value sampled from a preset two-dimensional bright part texture map (i.e., Diffuse map), and DarkTex represents the second sampled color value sampled from a preset two-dimensional dark part texture map (i.e., Dark map). The implementation process of determining the above color adjustment value will be described in combination with specific embodiments below.

[0111] In addition, the above first sampled color value and second sampled color value can be determined respectively through the following formula (4) and formula (5), but not limited to this:

[0112] float3 DiffuseTex = Texture2DSample(Diffuse, DiffuseSampler, uv) (4)

[0113] float3 DarkTex = Texture2DSample(Dark, DarkSampler, uv) (5)

[0114] Among them, Texture2DSample is a function in Unity, which can be used to sample pixels from a texture image (Texture2D), and this function returns the color value of the sampled pixels. In a virtual engine, Sampler can, but not limited to, represent a texture sampler, which is used to define the filtering and sampling modes when sampling a texture (which can also be understood as a sampling map), for example, bilinear filtering, anisotropic filtering, etc.; UV is a parameter of the sampled map, which is used to control the density of the wire arrangement. Specifically, reference can be made to Figure 7 as shown.

[0115] And different types of texture maps correspond to different types of texture samplers. For example, the Diffuse map corresponds to DiffuseSampler, and the Dark map corresponds to DiffuseSampler.

[0116] As an optional implementation manner, the above determining the value of the color parameter as the target color value within the third value range according to the color adjustment value includes:

[0117] Perform a multiplication operation on the color adjustment value and the first color difference to obtain a third product value, where the first color difference is the difference obtained by subtracting the first sampled color value from the second sampled color value;

[0118] Perform an addition operation on the first sampled color value and the third product value to obtain the target color value.

[0119] Among them, the result of hatchLine is used to distinguish the bright side and the dark side of the model, and the bright part texture (Diffuse texture) and the dark part texture (Dark texture) are sampled respectively.

[0120] The first color difference is the difference between the second sampled color value DarkTex and the first sampled color value DiffuseTex. The third product value is hatchLine * (DarkTex - DiffuseTex), and the target color value is DiffuseTex + hatchLine * (DarkTex - DiffuseTex).

[0121] Obviously, the way to determine the value of the color parameter is the implementation process of performing interpolation operation on the first color value and the second color value using the color adjustment value. The processing process of the interpolation operation can be but is not limited to being understood as Lerp(a, b, w) = a + w * (b - a).

[0122] In a specific embodiment, assume that the preset two-dimensional bright part texture and the preset two-dimensional dark part texture are as shown in Figure 6 (a). According to the color adjustment value hatchLine, perform interpolation operation on the above first color value and second color value to obtain the target color value of the surface area, and obtain a three-dimensional virtual model displayed according to the target color value as shown in Figure 6 (b).

[0123] That is to say, in the embodiment of the present application, the initial illumination value obtained directly from the normal vector and the light source direction vector is not used as the display parameter in the process of processing the three-dimensional virtual model. Instead, the first illumination value is determined using the initial illumination value, and then the color adjustment value is determined using the first illumination value. Finally, the value of the color parameter is obtained, so as to determine the color parameter on the surface area of the three-dimensional virtual model.

[0124] Through the above method, the value of the color parameter on the surface area of the three-dimensional virtual model can be directly determined according to the first illumination value, avoiding the human resources and time costs consumed by the overall process of developing the color parameter determination, reducing the work of developers; at the same time, the visual effect after the fusion processing of the three-dimensional virtual character using the illumination value and the color parameter is better and more natural, and the transition at the light and dark junction is softer, improving the rendering quality of the three-dimensional virtual character.

[0125] As an optional example, determining the color adjustment value according to the first light value as described above includes:

[0126] Determining a target adjustment value according to the first light value and a preset first sampling value;

[0127] When the target adjustment value is less than the lower boundary value of a preset fourth difference range, determining the color adjustment value as a preset third value;

[0128] When the target adjustment value is greater than the upper boundary value of the fourth difference range, determining the color adjustment value as a preset fourth value, where the fourth value is greater than the third value;

[0129] When the target adjustment value is greater than or equal to the lower boundary value of the fourth difference range and less than or equal to the upper boundary value of the fourth difference range, determining the color adjustment value as a value within a fourth value range, where the lower boundary value of the fourth value range is the third value and the upper boundary value of the fourth value range is the fourth value.

[0130] The overall implementation process can be through the following formula (6):

[0131] float hatchLine = smoothstep(Line_hardness, (1 - Line_hardness),

[0132] celLight * 2 - (1 - LineTex.r)) (6)

[0133] where celLight is the first light value of the Lambert light used to adjust the softness / hardness; LineTex is the result of sampling a texture map (such as a hand-drawn hatching texture map) on a three-dimensional virtual model, as Figure 8 shown in (a) is the result of sampling the hand-drawn hatching texture map on the three-dimensional virtual model, and can also be understood as pasting the hand-drawn hatching texture map on the surface of the three-dimensional virtual model; Line_hardness is used to control the softness / hardness of the hatching, and hatchLine is the color adjustment value.

[0134] As an optional example, determining the target adjustment value according to the first light value and a preset first sampling value includes:

[0135] Sampling a preset hatching texture map on the surface area to obtain a first sampling value;

[0136] Performing a multiplication operation on the first light value and a preset first coefficient to obtain a second product value, where the first coefficient is greater than 1;

[0137] Subtracting the first sampling value from a preset second coefficient to obtain a third difference, where the second coefficient is greater than or equal to 1;

[0138] Subtract the third difference value from the second product value to obtain the target adjustment value.

[0139] Among them, the first sampling value can but is not limited to including the number of times the preset wiring map is tiled on the surface area of the three-dimensional virtual model (which can also be understood as the density of the lines) and the position (or area) on the three-dimensional virtual model, etc. This sampling value is determined by UV.

[0140] The target adjustment value is celLight * 2 - (1 - LineTex.r). This target adjustment value is used to make the bright area brighter and the dark area darker in the result after pasting the hand-drawn wiring map sticker on the surface of the three-dimensional virtual model, that is, to make the hand-drawn wiring on the bright area sparser and the hand-drawn wiring on the dark area denser, so as to Figure 8 transform the result shown in (a) in Figure 8 into the result shown in (b) in

[0141] To increase the three-dimensional sense of the wiring effect at the junction of the bright and dark parts, use the target adjustment value celLight * 2 - (1 - LineTex.r) to smooth the lower boundary value Line_hardness of the fourth difference range and the upper boundary value (1 - Line_hardness) of the fourth difference range, so as to obtain the hand-drawn wiring effect shown in (c) in Figure 8

[0142] In other words, by fusing the pre-drawn wiring map with the Lambert illumination (the first illumination value), the hand-drawn wiring effect shown in (c) in Figure 8 is simulated. As can be seen from (c) in Figure 8 , the simulated hand-drawn wiring effect makes the three-dimensional virtual model only retain the wiring corresponding to the hand-drawn wiring map (wiring map) at the light and dark junctions. Specifically, reference can be made to Figure 9 .

[0143] It should be noted that since only the illumination values on the bright and dark areas of the surface area are shown in the three-dimensional virtual model shown in Figure 5 obtained by only smoothing the initial illumination value, this processing result makes the three-dimensional virtual character lack a three-dimensional sense. Therefore, in the embodiments of the present application, sampling the hand-drawn wiring map of the three-dimensional virtual model with reference to the wiring characteristics of the American comic style is mainly reflected in aspects such as the change in line thickness, the degree of line bending, and the change in line density.

[0144] ​Among them, the hatching has obvious changes in line thickness, which can enhance the three-dimensional sense and dynamic sense of the picture; the hatching mainly appears at the boundary between light and dark. The lines on the dark side of the light will become thicker to emphasize the influence of light and shadow on the character; while in the area of the light side of the light, the lines will become thinner, making the picture look more natural and harmonious.

[0145] The density of the hatching in different areas is also different. In the area with stronger light, the lines will be sparser to highlight the illumination effect of the light; while in the area with weaker light, the lines will be denser to emphasize the existence of the shadow. This change in density helps to show the three-dimensional sense of the 3D virtual character under different lighting conditions. The hatching texture map uses a seamless hand-drawn line texture map. The longitudinal direction of each line is a gradient from the center to both sides, which is used to produce an effect of gradually thinning edges when calculating with the lighting model. Specifically, it can be referred to as Figure 10 shown in (a) and (b) in

[0146] In addition, the hatching in the American comic style usually has a certain degree of curvature, which can make the surface texture of the character more abundant and enhance the three-dimensional sense of the character. At the same time, the curved lines can also show the dynamic sense of the character, making the picture more vivid. The texture map is tiled on the model, and different tiling values can be used to simulate the thickness and distortion degree of the lines. Specifically, it can be referred to as Figure 7 shown in

[0147] By fusing the hatching texture map with the first lighting value in the above-mentioned embodiment, the hand-drawn hatching effect of the 3D virtual model is simulated, so that the 3D virtual model presents a three-dimensional sense effect through the hand-drawn hatching effect at the boundary between light and dark on the surface area of the model. Thus, while improving the rendering quality and artistic effect of the 3D virtual character, it has the advantages of simplified calculation, easy adjustment and optimization, etc.

[0148] Since only the hatching effect is presented at the boundary between light and dark of the 3D virtual model through the above-mentioned hand-drawn hatching texture map, but for the areas other than the boundary between light and dark, there is still a lack of dynamic sense and three-dimensional sense. Therefore, in the embodiment of the present application, a dynamic black line texture map is introduced, so that the 3D virtual model as a whole presents a dynamic sense.

[0149] As an optional example, determining the display parameters of the surface area according to the first lighting value includes:

[0150] Sampling a preset first black line texture map on the surface area to obtain a second sampling value, where the first black line texture map includes a first group of black lines arranged in parallel;

[0151] Sample the preset second black line map on the surface area to obtain a third sampling value. The second black line map includes a second group of black lines arranged in parallel. The number of black lines arranged in a unit area in the first black line map is less than the number of black lines arranged in a unit area in the second group of black lines;

[0152] Determine the value of the black line parameter of the surface area according to the first light value, the second sampling value, and the third sampling value. The value of the black line parameter is used to represent the black lines displayed in the surface area. The display parameter includes the black line parameter, and the value of the black line parameter is a value within the fifth value range. The lower boundary value of the fifth value range is the second sampling value, and the upper boundary value of the fifth value range is the third sampling value.

[0153] Among them, the second sampling value can include, but is not limited to, the number of times the preset first black line map is tiled on the surface area of the three-dimensional virtual model (which can also be understood as the density of the lines) and the position (or area) on the three-dimensional virtual model, etc. And the second sampling value is determined by UV.

[0154] Similarly, the third sampling value can include, but is not limited to, the number of times the preset second black line map is tiled on the surface area of the three-dimensional virtual model (which can also be understood as the density of the lines) and the position (or area) on the three-dimensional virtual model, etc. And the third sampling value is determined by UV.

[0155] In the Figure 10 shown first black line map and second black line map, they respectively represent hand-drawn black line maps with different densities, and store them in the R channel and G channel of the same texture map (texture) respectively. Then, through the Lambert light value (celLight) calculated in the above embodiment, the dynamic mixing of the two hand-drawn black line maps is realized.

[0156] Sample the preset first black line map and second black line map on the surface area respectively to obtain the second sampling value and the third sampling value, and then determine the value of the black line parameter of the surface area according to the first light value, the second sampling value, and the third sampling value.

[0157] As an optional example, the above determination of the value of the black line parameter of the surface area according to the first light value, the second sampling value, and the third sampling value includes:

[0158] Perform a multiplication operation on the first light value and the first sampling difference to obtain a fourth product value, where the first sampling difference is the difference obtained by subtracting the second sampling value from the third sampling value;

[0159] Perform an addition operation on the second sampling value and the fourth product value to obtain the value of the black line parameter.

[0160] It is specifically implemented through the following formula (7):

[0161] float handDrawLine = lerp(handDrawTex.r, handDrawTex.g, celLight) (7)

[0162] Among them, handDrawTex.r represents a sparser version of the hand-drawn black line texture map, that is, the second sampling value obtained by sampling the first black line texture map; handDrawTex.g represents a denser version of the hand-drawn black line texture map, that is, the third sampling value obtained by sampling the second black line texture map.

[0163] Determine (handDrawTex.g - handDrawTex.r) as the first sampling difference, and then determine the product of the first light value celLight and the first sampling difference as the fourth product value; perform an addition operation on the second sampling value handDrawTex.r and the fourth product value to obtain the value of the black line parameter.

[0164] In a specific embodiment, for example, if the second sampling value represents that the number of black lines is 5 and the third sampling value represents that the number of black lines is 20, then the value of the black line parameter of the surface area obtained through the above interpolation operation is 10. In this way, the white surface of the three-dimensional virtual model can present a more three-dimensional effect.

[0165] The following gives the specific steps of dynamic hand-drawn black lines:

[0166] (1) Prepare the hand-drawn black line texture map;

[0167] First of all, we need to prepare two hand-drawn black line texture maps with different densities. These two texture maps respectively represent the black line effects on the character's surface when illuminated by light in the bright part and the dark part. Store these two texture maps in the R channel (sparser version) and G channel (denser version) of the same texture map respectively.

[0168] (2) Calculate the Lambert light value;

[0169] Here, the first light value celLight calculated in the above embodiment is used, that is, the Lambert light adjusted for softness and hardness.

[0170] (3) Dynamically mix the hand-drawn black line texture map;

[0171] According to the calculated celLight value, use the linear interpolation (lerp) function to achieve the dynamic mixing of the hand-drawn black line texture maps in the R channel and G channel.

[0172] When the celLight value is high, the hand-drawn black line texture (R channel) in the bright area will occupy a larger weight; when the celLight value is low, the hand-drawn black line texture (G channel) in the dark area will occupy a larger weight. In this way, the hand-drawn black line texture can be dynamically adjusted according to the light and shadow changes.

[0173] (4) Apply the dynamic hand-drawn black line effect.

[0174] Apply the dynamically blended hand-drawn black line texture to the character's surface, so that the character shows different densities of hand-drawn black line effects under different lighting conditions. This will enhance the three-dimensional sense, dynamic sense and hierarchical sense of the character, and improve the visual experience and artistic value of the game.

[0175] In summary, since the hand-drawn black lines can change according to the light and shadow changes, when the lighting conditions change, the black line texture on the character's surface will also be adjusted accordingly, making the lines more vivid and realistic in the visual effect; at the same time, when the lighting conditions change, only the first light value under different conditions needs to be calculated, and the value of the black line parameter under different conditions can be automatically calculated according to the relationship between the first light value and the value of the black line parameter, avoiding the problem of resource waste caused by repeated calculation of the value of the black line parameter, and reducing the calculation time and the input of hardware resources, etc.

[0176] In addition, through the above-mentioned dynamic hand-drawn black line method, the rendering effect of the three-dimensional virtual character can also maintain a consistent hand-drawn style under different lighting environments, enhancing the dynamic sense and three-dimensional sense of the character.

[0177] As an optional example, the above-mentioned determining the display parameters of the surface area according to the first light value includes:

[0178] Perform an addition operation on the initial light value and the preset offset value to obtain an offset light value;

[0179] In the case where the offset light value is less than the lower boundary value of the preset first difference range, determine the second light value as the preset first value; in the case where the offset light value is greater than the upper boundary value of the first difference range, determine the second light value as the preset second value, where the second value is greater than the first value; in the case where the offset light value is greater than or equal to the lower boundary value of the first difference range and less than or equal to the upper boundary value of the first difference range, determine the second light value as a value within the second value range, where the lower boundary value of the second value range is the first value and the upper boundary value of the second value range is the second value;

[0180] Determine the value of the scattering parameter according to the first light value and the second light value, where the display parameter includes the scattering parameter, and the value of the scattering parameter is used to represent the transparency when the light passes through the surface area.

[0181] The 3S color bleeding effect of the skin (Subsurface Scattering, abbreviated as SSS) is a phenomenon that simulates the scattering of light inside a translucent object, and is used to enhance the realism and three-dimensionality of the skin of virtual characters. By simulating the 3S effect, the scattering of light can be increased at the boundary between light and dark, making the skin of virtual characters present a richer sense of hierarchy and three-dimensionality. This will help to improve the visual impact and attractiveness of game characters. For specific reference, please refer to Figure 12 。

[0182] Compared with the traditional physically-based SSS algorithm, in the embodiments of the present application, a custom method is adopted to implement a simplified version of the SSS effect. While improving the rendering quality and artistic value of game characters, it has the advantages of simplified calculation, easy adjustment and optimization. The specific implementation process is as follows:

[0183] (1) Calculate the Lambert lighting value with offset;

[0184] First of all, it is necessary to offset the adjusted soft-hardness Lambert lighting value (celLight) according to a preset offset value _celLightOffset (which can also be understood as an offset parameter and is used to represent the size of the 3S area).

[0185] Specifically, as shown in the following formula (8):

[0186] celLight1 = smoothstep(_hardness, (1 - _hardness), halfLambert + _celLightOffset)(8)

[0187] Among them, the lower boundary value of the preset first difference range is _hardness, and the upper boundary value of the preset first difference range is (1 - _hardness). Through formula (8), a Lambert lighting value with offset can be obtained to simulate the 3S area.

[0188] (2) Calculate the value of the scattering parameter in the 3S area;

[0189] As an optional example, determining the value of the scattering parameter according to the first lighting value and the second lighting value includes:

[0190] Perform a multiplication operation on the second lighting value and the fourth difference to obtain the value of the scattering parameter, where the fourth difference is the difference obtained by subtracting the first lighting value from the preset third coefficient, and the third coefficient is greater than or equal to 1.

[0191] Specifically, it can be achieved by multiplying the offset Lambert illumination value (celLight1) and the original Lambert illumination value (celLight) in reverse.

[0192] Specifically, it is achieved through the following formula (9):

[0193] sssRange = celLight1 * (1 - celLight) (9)

[0194] In this way, a value representing the 3S region can be obtained, which is used to simulate the scattering phenomenon of light inside the skin. sssRange can be, but is not limited to, understood as the scattering value (the value of the scattering parameter) of each triangular patch when light passes through the skin.

[0195] Among them, the schematic process diagram of the three-dimensional virtual model corresponding to the value of the scattering parameter of the 3S region calculated through celLight and celLight1 is as Figure 13 shown.

[0196] It should be noted that in terms of visual effects, the above 3S region can be, but is not limited to, a reddish color appearing at the light and dark boundary of the three-dimensional virtual model. In this embodiment, the scattering effect of light passing through the skin in the three-dimensional virtual model is approximately simulated in a simplified manner, rather than real skin scattering.

[0197] As an optional example, after determining the display parameters of the surface region according to the first illumination value, the above method further includes:

[0198] Displaying the surface region according to the display parameters of the surface region.

[0199] Combined with the description of the above embodiments, the specific implementation process of displaying the surface region according to the display parameters of the surface region of the three-dimensional virtual model includes the following steps. Among them, the display parameters of the surface region include the first illumination value, the value of the color parameter, the value of the black line parameter, the value of the scattering parameter, etc.:

[0200] S11, calculating the first illumination value of the surface region;

[0201] The calculation process is as follows:

[0202] S11-1, obtaining the normal vector of the surface region of the three-dimensional virtual model and the light source direction vector of the virtual light source;

[0203] S11-2, performing a dot product operation on the normal vector and the light source direction vector to obtain a dot product value;

[0204] S11-3, performing a mapping process on the dot product value to obtain an initial illumination value;

[0205] Specifically, the initial light value is obtained through the above formula (1).

[0206] S11-4, Smooth the initial light value to obtain the first light value;

[0207] Specifically, reference can be made to the description of part of the above formula (2), which will not be elaborated here.

[0208] S12, Add hand-drawn hatching to the three-dimensional virtual model at the light and dark boundaries according to the pre-drawn hatching texture map;

[0209] Specifically, the pre-drawn hatching texture map can be used to fuse with the first light value to simulate the hand-drawn hatching effect. For the detailed process, reference can be made to the description of part of the formula (6) in the above embodiment.

[0210] S13, Determine the value Color of the color parameter of the surface area according to the first light value;

[0211] The specific steps to determine the value Color of the color parameter are as follows:

[0212] S13-1, Determine the color adjustment value hatcLine according to the first light value;

[0213] Specifically, reference can be made to the description of part of the formula (6) in the above embodiment, which will not be elaborated here.

[0214] S13-2, Sample the first sampled color value from the preset two-dimensional highlight texture map;

[0215] S13-3, The second sampled color value sampled from the preset two-dimensional shadow texture map;

[0216] S13-4, Perform interpolation operations on the first sampled color value and the second sampled color value according to the color adjustment value to obtain the value Color of the color parameter.

[0217] Specifically, it can be known from referring to the description of formula (3) in the above embodiment, which will not be elaborated here.

[0218] Through the above method, the initial light value is smoothed to obtain the first light value of the surface area, making the light transition on the surface of the three-dimensional virtual model more uniform; then, according to the first light value, the color adjustment value is determined, and then interpolation operations are performed on the first sampled value and the second sampled value to obtain the value of the color parameter of the surface area, making the surface area of the three-dimensional virtual model present a visual effect of multi-layer color level transition, increasing the dynamic sense of the three-dimensional virtual character.

[0219] S14. Determine the value of the black line parameter for the surface area according to the first light value. For example, sample the preset first black line texture map on the surface area to obtain the second sample value handDrawTex.r; and sample the preset second black line texture map on the surface area to obtain the third sample value handDrawTex.g; then determine the value of the black line parameter for the surface area according to the first light value, the second sample value, and the third sample value. For specific reference, please refer to the description in part (7) of the above formula.

[0220] By adding hand-drawn black line texture maps with different densities on the basis of the Diffuse texture map, the black line texture map will also change when the light and shadow change, making the lines on the surface area of the 3D virtual model more vivid, and at the same time making the 3D virtual character more visually inclined to the hand-drawn effect.

[0221] S15. Determine the value of the scattering parameter according to the second light value with offset and the first light value.

[0222] Among them, the second light value celLight1 is obtained through the above formula (8), and then the second light value and the first light value are multiplied in reverse through formula (9) to obtain the value of the scattering parameter sssRange for the 3S area.

[0223] In the embodiments of the present application, a custom method is used to implement a simplified version of the SSS effect. Compared with the traditional physically based SSS algorithm, this method reduces the computational complexity and performance consumption while ensuring the rendering effect of the skin. It also helps to reduce the burden on the GPU and reduce the performance occupancy.

[0224] From the descriptions of the above embodiments, it can be seen that the technical solution of the present application has the advantages of simplified calculation, easy adjustment and optimization while improving the rendering quality and artistic effect of the character, and can be widely applied to various second-generation game products.

[0225] Through the above method, by smoothing the initial light value, the light information on the surface area of the 3D virtual model becomes more real; and by using the correlation between the smoothed first light value and the display parameters in other dimensions, the values of the display parameters in other dimensions can be quickly determined, reducing the time cost, reducing the input of computing resources, and at the same time avoiding occupying a large amount of storage space, improving the processing efficiency of the 3D virtual model and enhancing the artistic effect of the 3D virtual character.

[0226] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0227] According to another aspect of the embodiments of the present application, there is also provided a Figure 14 processing device for a three-dimensional virtual model as shown in

[0228] The first acquisition unit 1402 is used to acquire the normal vector of the surface area of the three-dimensional virtual model and the light source direction vector of the virtual light source. Among them, the normal vector is a unit vector perpendicular to the surface area, and the light source direction vector is a unit vector pointing from the surface area to the virtual light source;

[0229] The first processing unit 1404 is used to perform a dot product operation on the normal vector and the light source direction vector to obtain a dot product value, and determine an initial illumination value according to the dot product value;

[0230] The second processing unit 1406 is used to perform a smoothing process on the initial illumination value to obtain a first illumination value;

[0231] The third processing unit 1408 is used to determine the display parameters of the surface area according to the first illumination value.

[0232] Optionally, the above-mentioned first processing unit 1404 includes:

[0233] The first processing module is used to map the dot product value to a preset first value range to obtain a mapped value of the dot product value in the first value range. Among them, the initial illumination value is the mapped value, and the first value range is a value range greater than 0.

[0234] Optionally, the above-mentioned first processing module includes:

[0235] The first processing sub-module is used to perform a multiplication operation on the dot product value and the target mean value to obtain a first product value, where the target mean value is the mean value of the lower boundary value and the upper boundary value of the first value range;

[0236] The second processing sub-module is used to perform an addition operation on the first product value and the target mean value to obtain a mapped value.

[0237] Optionally, the above-mentioned second processing unit 1406 includes:

[0238] A second processing module, configured to determine the first light value as a preset first value when the initial light value is less than the lower boundary value of a preset first difference range;

[0239] A third processing module, configured to determine the first light value as a preset second value when the initial light value is greater than the upper boundary value of the first difference range, where the second value is greater than the first value;

[0240] A fourth processing module, configured to determine the first light value as a value within a second value range when the initial light value is greater than or equal to the lower boundary value of the first difference range and less than or equal to the upper boundary value of the first difference range, where the lower boundary value of the second value range is the first value and the upper boundary value of the second value range is the second value.

[0241] Optionally, the above-mentioned fourth processing module includes:

[0242] A third processing sub-module, configured to divide the first difference by the second difference to obtain a linear mapping value, where the first difference is the difference obtained by subtracting the lower boundary value of the first difference range from the initial light value, and the second difference is the difference obtained by subtracting the lower boundary value of the first difference range from the upper boundary value of the first difference range;

[0243] A fourth processing sub-module, configured to use the linear mapping value as an input parameter of a target curve function to obtain the value of the target curve function, where the first light value is the value of the target curve function, and the value range of the value of the target curve function is the second value range.

[0244] Optionally, the above-mentioned three processing units 1408 include:

[0245] A fifth processing module, configured to determine the value of the color parameter of the surface area according to the first light value, where the display parameter includes the color parameter.

[0246] Optionally, the above-mentioned fifth processing module includes:

[0247] A fifth processing sub-module, configured to determine a color adjustment value according to the first light value, where the color adjustment value is used to determine a target color value within a third value range, the lower boundary value of the third value range is a first sampled color value sampled from a preset two-dimensional highlight texture map, and the upper boundary value of the third value range is a second sampled color value sampled from a preset two-dimensional shadow texture map;

[0248] A sixth processing sub-module, configured to determine the value of the color parameter as the target color value within the third value range according to the color adjustment value.

[0249] Optionally, the above-mentioned fifth processing module includes:

[0250] The seventh processing sub-module is used to determine a target adjustment value according to the first light value and a preset first sampling value;

[0251] The eighth processing sub-module is used to determine the color adjustment value as a preset third value when the target adjustment value is less than the lower boundary value of a preset fourth difference range;

[0252] The ninth processing sub-module is used to determine the color adjustment value as a preset fourth value when the target adjustment value is greater than the upper boundary value of the fourth difference range, where the fourth value is greater than the third value;

[0253] The tenth processing sub-module is used to determine the color adjustment value as a value within a fourth value range when the target adjustment value is greater than or equal to the lower boundary value of the fourth difference range and less than or equal to the upper boundary value of the fourth difference range, where the lower boundary value of the fourth value range is the third value and the upper boundary value of the fourth value range is the fourth value.

[0254] Optionally, the above-mentioned fifth processing module further includes:

[0255] The first sampling sub-module is used to sample a preset wiring pattern map on the surface area to obtain a first sampling value;

[0256] The eleventh processing sub-module is used to perform a multiplication operation on the first light value and a preset first coefficient to obtain a second product value, where the first coefficient is greater than 1;

[0257] The twelfth processing sub-module is used to subtract the first sampling value from a preset second coefficient to obtain a third difference, where the second coefficient is greater than or equal to 1;

[0258] The thirteenth processing sub-module is used to subtract the third difference from the second product value to obtain the target adjustment value.

[0259] Optionally, the above-mentioned fifth processing module includes:

[0260] The fourteenth processing sub-module is used to perform a multiplication operation on the color adjustment value and a first color difference, where the first color difference is the difference obtained by subtracting the first sampled color value from the second sampled color value, to obtain a third product value;

[0261] The fifteenth processing sub-module is used to perform an addition operation on the first sampled color value and the third product value to obtain the target color value.

[0262] Optionally, the above-mentioned third processing unit 1408 includes:

[0263] The first sampling module is used to sample a preset first black line map on the surface area to obtain a second sampling value, where the first black line map includes a first group of black lines arranged in parallel;

[0264] A second sampling module for sampling a preset second black line map on the surface area to obtain a third sampling value, where the second black line map includes a second group of black lines arranged in parallel, and the number of black lines arranged in a unit area in the first black line map is less than the number of black lines arranged in a unit area in the second group of black lines;

[0265] A sixth processing module for determining a value of a black line parameter of the surface area according to the first light value, the second sampling value, and the third sampling value, where the value of the black line parameter is used to represent the black lines displayed in the surface area, the display parameter includes the black line parameter, and the value of the black line parameter is a value within a fifth value range, the lower boundary value of the fifth value range is the second sampling value, and the upper boundary value of the fifth value range is the third sampling value.

[0266] Optionally, the above-mentioned sixth processing module includes:

[0267] A sixteenth processing sub-module for performing a multiplication operation on the first light value and the first sampling difference to obtain a fourth product value, where the first sampling difference is the difference obtained by subtracting the second sampling value from the third sampling value;

[0268] A seventeenth processing sub-module for performing an addition operation on the second sampling value and the fourth product value to obtain the value of the black line parameter.

[0269] Optionally, the above-mentioned third processing unit 1408 includes:

[0270] A seventh processing module for performing an addition operation on the initial light value and a preset offset value to obtain an offset light value;

[0271] An eighth processing module for, in the case where the offset light value is less than the lower boundary value of a preset first difference range, determining the second light value as a preset first value; in the case where the offset light value is greater than the upper boundary value of the first difference range, determining the second light value as a preset second value, where the second value is greater than the first value; in the case where the offset light value is greater than or equal to the lower boundary value of the first difference range and less than or equal to the upper boundary value of the first difference range, determining the second light value as a value within a second value range, where the lower boundary value of the second value range is the first value and the upper boundary value of the second value range is the second value;

[0272] A ninth processing module for determining a value of a scattering parameter according to the first light value and the second light value, where the display parameter includes the scattering parameter, and the value of the scattering parameter is used to represent the transparency when light passes through the surface area.

[0273] Optionally, the above-mentioned ninth processing module includes:

[0274] The eighteenth processing sub-module is used to perform a multiplication operation on the second light value and the fourth difference to obtain the value of the scattering parameter, where the fourth difference is the difference obtained by subtracting the first light value from the preset third coefficient, and the third coefficient is greater than or equal to 1.

[0275] Optionally, the above device further includes:

[0276] A display unit for displaying the surface area according to the display parameters of the surface area.

[0277] By applying the above device to smooth the initial light value, the light information on the surface area of the three-dimensional virtual model becomes more realistic; and by using the correlation between the smoothed first light value and the display parameters in other dimensions, the values of the display parameters in other dimensions can be quickly determined, reducing the time cost, reducing the input of computing resources, and at the same time avoiding occupying a large amount of storage space, improving the processing efficiency of the three-dimensional virtual model and enhancing the artistic effect of the three-dimensional virtual character.

[0278] It should be noted that the embodiments of the processing device of the three-dimensional virtual model here can refer to the embodiments of the processing method of the three-dimensional virtual model above, and will not be elaborated here.

[0279] According to another aspect of the embodiments of the present application, an electronic device for implementing the above-mentioned processing method of the three-dimensional virtual model is further provided. The electronic device can be Figure 15 The terminal device shown. This embodiment will be described by taking this electronic device as the background device. As Figure 15 shown, the electronic device includes a memory 1502 and a processor 1504. The memory 1502 stores a computer program, and the processor 1504 is configured to execute the steps in any one of the above method embodiments through the computer program.

[0280] Optionally, in this embodiment, the above electronic device can be at least one network device among multiple network devices in a computer network.

[0281] Optionally, in this embodiment, the above processor can be configured to execute the following steps through a computer program:

[0282] S1, obtaining the normal vector of the surface area of the three-dimensional virtual model and the light source direction vector of the virtual light source, where the normal vector is a unit vector perpendicular to the surface area, and the light source direction vector is a unit vector pointing from the surface area to the virtual light source;

[0283] S2, performing a dot product operation on the normal vector and the light source direction vector to obtain a dot product value, and determining the initial light value according to the dot product value;

[0284] S3. Smooth the initial light value to obtain a first light value;

[0285] S4. Determine the display parameters of the surface area according to the first light value.

[0286] Optionally, those of ordinary skill in the art can understand that Figure 15 The structure shown is only schematic, and the electronic device or electronic equipment can also be a target terminal such as a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, and a Mobile Internet Device (MID), a PAD, etc. Figure 15 It does not limit the structure of the above-mentioned electronic device or electronic equipment. For example, the electronic device or electronic equipment may further include more or fewer components (such as a network interface, etc.) than those shown Figure 15 in the figure, or have a different configuration from that shown Figure 15 in the figure.

[0287] Among them, the memory 1502 can be used to store software programs and modules, such as the program instructions / modules corresponding to the processing method and device of the three-dimensional virtual model in the embodiments of the present application. The processor 1504 executes various functional applications and data processing by running the software programs and modules stored in the memory 1502, that is, implements the above-mentioned processing method of the three-dimensional virtual model. The memory 1502 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 1502 may further include a memory remotely set relative to the processor 1504, and these remote memories can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and their combinations. Among them, the memory 1502 can specifically but not limitedly be used to store the set of pictures to be recognized, the set of prompt texts, and the values of N sets of learning parameters, etc. As an example, as Figure 15 shown, the above-mentioned memory 1502 may include, but not limited to, the first acquisition unit 1402, the first processing unit 1404, the second processing unit 1406, and the third processing unit 1408 in the above-mentioned processing device of the three-dimensional virtual model. In addition, it may further include, but not limited to, other module units in the above-mentioned processing device of the three-dimensional virtual model, which will not be elaborated in this example.

[0288] Optionally, the above-mentioned transmission device 1506 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 1506 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable, so as to communicate with the Internet or a local area network. In one example, the transmission device 1506 is a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0289] In addition, the above-mentioned electronic device further includes: a display 1508, which is used to display the surface area of the above-mentioned three-dimensional virtual model and the virtual light source; and a connection bus 1510, which is used to connect each module component in the above-mentioned electronic device.

[0290] In other embodiments, the above-mentioned terminal device or server may be a node in a distributed system. Among them, the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes can form a point-to-point network, and any form of computing device, such as electronic devices such as servers and terminals, can become a node in the blockchain system by joining the point-to-point network.

[0291] According to another aspect of the present application, there is provided a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the processing method of the three-dimensional virtual model provided in various optional implementation manners in the above-mentioned server verification processing and other aspects. Among them, the computer program is set to execute the steps in any one of the above-mentioned method embodiments when running.

[0292] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may be set to store a computer program for executing the following steps:

[0293] S1, obtain the normal vector of the surface area of the three-dimensional virtual model and the light source direction vector of the virtual light source, where the normal vector is a unit vector perpendicular to the surface area, and the light source direction vector is a unit vector pointing from the surface area to the virtual light source;

[0294] S2, perform a dot product operation on the normal vector and the light source direction vector to obtain a dot product value, and determine an initial illumination value according to the dot product value;

[0295] S3. Smooth the initial light value to obtain a first light value;

[0296] S4. Determine the display parameters of the surface area according to the first light value.

[0297] Optionally, in the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other relevant parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.

[0298] Optionally, in this embodiment, those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a program instructing the relevant hardware of the target terminal. The program can be stored in a computer-readable storage medium, and the storage medium can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.

[0299] The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages or disadvantages of the embodiments.

[0300] If the integrated unit in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in the storage medium and includes several instructions for causing one or more computer devices (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present application.

[0301] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0302] In several embodiments provided by the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. 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 displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of units or modules can be in electrical or other forms.

[0303] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0304] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0305] The above is only the preferred embodiment of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and retouches can be made, and these improvements and retouches should also be regarded as the protection scope of the present application.

Claims

1. A method for processing a three-dimensional virtual model, characterized in that, Including: Obtain a normal vector of a surface area of a three-dimensional virtual model and a light source direction vector of a virtual light source, where the normal vector is a unit vector perpendicular to the surface area, and the light source direction vector is a unit vector pointing from the surface area to the virtual light source; Perform a dot product operation on the normal vector and the light source direction vector to obtain a dot product value, and determine an initial illumination value according to the dot product value; Perform smoothing processing on the initial illumination value to obtain a first illumination value; Determine a display parameter of the surface area according to the first illumination value.

2. The method according to claim 1, wherein The determining the initial illumination value according to the dot product value includes: Map the dot product value to a preset first value range to obtain a mapped value of the dot product value within the first value range, where the initial illumination value is the mapped value, and the first value range is a value range greater than 0.

3. The method according to claim 2, wherein The mapping the dot product value to a preset first value range to obtain a mapped value of the dot product value within the first value range includes: Perform a multiplication operation on the dot product value and a target mean value to obtain a first product value, where the target mean value is the mean value of a lower boundary value and an upper boundary value of the first value range; And perform an addition operation on the first product value and the target mean value to obtain the mapped value.

4. The method according to claim 1, characterized in that, The performing smoothing processing on the initial illumination value to obtain a first illumination value includes: When the initial illumination value is less than a lower boundary value of a preset first difference range, determine the first illumination value as a preset first value; When the initial illumination value is greater than an upper boundary value of the first difference range, determine the first illumination value as a preset second value, where the second value is greater than the first value; When the initial illumination value is greater than or equal to the lower boundary value of the first difference range and less than or equal to the upper boundary value of the first difference range, determine the first illumination value as a value within a second value range, where a lower boundary value of the second value range is the first value, and an upper boundary value of the second value range is the second value.

5. The method according to claim 4, wherein The determining the first illumination value as a value within a second value range includes: Divide a first difference by a second difference to obtain a linear mapping value, where the first difference is a difference obtained by subtracting the lower boundary value of the first difference range from the initial illumination value, and the second difference is a difference obtained by subtracting the lower boundary value of the first difference range from the upper boundary value of the first difference range; Use the linear mapping value as an input parameter of a target curve function to obtain a value of the target curve function, where the first illumination value is the value of the target curve function, and a value range of the value of the target curve function is the second value range.

6. The method according to claim 1, wherein The determining the display parameter of the surface area according to the first illumination value includes: Determine a value of a color parameter of the surface area according to the first illumination value, where the display parameter includes the color parameter.

7. The method according to claim 6, wherein The determining the value of the color parameter of the surface area according to the first illumination value includes: Determine a color adjustment value according to the first light value, where the color adjustment value is used to determine a target color value within a third value range, the lower boundary value of the third value range is a first sampled color value sampled from a preset two-dimensional highlight texture map, and the upper boundary value of the third value range is a second sampled color value sampled from a preset two-dimensional shadow texture map; Determine the value of the color parameter as the target color value within the third value range according to the color adjustment value.

8. The method according to claim 7, wherein The determining the color adjustment value according to the first light value includes: Determine a target adjustment value according to the first light value and a preset first sampled value; When the target adjustment value is less than the lower boundary value of a preset fourth difference range, determine the color adjustment value as a preset third value; When the target adjustment value is greater than the upper boundary value of the fourth difference range, determine the color adjustment value as a preset fourth value, where the fourth value is greater than the third value; When the target adjustment value is greater than or equal to the lower boundary value of the fourth difference range and less than or equal to the upper boundary value of the fourth difference range, determine the color adjustment value as a value within a fourth value range, where the lower boundary value of the fourth value range is the third value and the upper boundary value of the fourth value range is the fourth value.

9. The method according to claim 8, wherein The determining the target adjustment value according to the first light value and the preset first sampled value includes: Sample a preset wire texture map on the surface area to obtain the first sampled value; Perform a multiplication operation on the first light value and a preset first coefficient to obtain a second product value, where the first coefficient is greater than 1; Subtract the first sampled value from a preset second coefficient to obtain a third difference, where the second coefficient is greater than or equal to 1; Subtract the third difference from the second product value to obtain the target adjustment value.

10. The method according to claim 7, wherein The determining the value of the color parameter as the target color value within the third value range according to the color adjustment value includes: Perform a multiplication operation on the color adjustment value and a first color difference to obtain a third product value, where the first color difference is the difference obtained by subtracting the first sampled color value from the second sampled color value; Perform an addition operation on the first sampled color value and the third product value to obtain the target color value.

11. The method according to claim 1, characterized in that, The determining the display parameter of the surface area according to the first light value includes: Sample a preset first black line texture map on the surface area to obtain a second sampled value, where the first black line texture map includes a first group of black lines arranged in parallel; Sample a preset second black line texture map on the surface area to obtain a third sampled value, where the second black line texture map includes a second group of black lines arranged in parallel, and the number of black lines arranged in a unit area in the first black line texture map is less than the number of black lines arranged in the unit area in the second group of black lines; Determine the value of the black line parameter of the surface area according to the first light value, the second sampling value, and the third sampling value, where the value of the black line parameter is used to represent the black line displayed in the surface area, the display parameter includes the black line parameter, the value of the black line parameter is a value within a fifth value range, the lower boundary value of the fifth value range is the second sampling value, and the upper boundary value of the fifth value range is the third sampling value.

12. The method according to claim 11, wherein The determining the value of the black line parameter of the surface area according to the first light value, the second sampling value, and the third sampling value includes: Perform a multiplication operation on the first light value and the first sampling difference to obtain a fourth product value, where the first sampling difference is the difference obtained by subtracting the second sampling value from the third sampling value; Perform an addition operation on the second sampling value and the fourth product value to obtain the value of the black line parameter.

13. The method according to claim 1, wherein The determining the display parameter of the surface area according to the first light value includes: Perform an addition operation on the initial light value and a preset offset value to obtain an offset light value; When the offset light value is less than the lower boundary value of a preset first difference range, determine the second light value as a preset first value; when the offset light value is greater than the upper boundary value of the first difference range, determine the second light value as a preset second value, where the second value is greater than the first value; when the offset light value is greater than or equal to the lower boundary value of the first difference range and less than or equal to the upper boundary value of the first difference range, determine the second light value as a value within a second value range, where the lower boundary value of the second value range is the first value and the upper boundary value of the second value range is the second value; Determine the value of the scattering parameter according to the first light value and the second light value, where the display parameter includes the scattering parameter, and the value of the scattering parameter is used to represent the transparency when light passes through the surface area.

14. The method according to claim 13, characterized in that, The determining the value of the scattering parameter according to the first light value and the second light value includes: Perform a multiplication operation on the second light value and a fourth difference to obtain the value of the scattering parameter, where the fourth difference is the difference obtained by subtracting the first light value from a preset third coefficient, and the third coefficient is greater than or equal to 1.

15. The method according to any one of claims 1 to 14, characterized in that, After determining the display parameter of the surface area according to the first light value, the method further includes: Display the surface area according to the display parameter of the surface area.

16. A processing device for a three-dimensional virtual model, characterized in that, Including: A first acquisition unit, configured to acquire a normal vector of a surface area of a three-dimensional virtual model and a light source direction vector of a virtual light source, where the normal vector is a unit vector perpendicular to the surface area, and the light source direction vector is a unit vector pointing from the surface area to the virtual light source; A first processing unit, configured to perform a dot product operation on the normal vector and the light source direction vector to obtain a dot product value, and determine an initial light value according to the dot product value; A second processing unit for smoothing the initial light value to obtain a first light value; A third processing unit for determining display parameters of the surface area according to the first light value.

17. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when run by a terminal device or a computer, executes the method described in any one of claims 1 to 15.

18. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 15 are implemented.

19. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to execute the method described in any one of claims 1 to 15 through the computer program.