Model rendering method, device, electronic device and storage medium

By obtaining the skin range map on the mobile terminal, generating subsurface scattering range information, and combining it with the reference color information to generate rendering data, the problem of low skin rendering efficiency on the mobile terminal is solved, and efficient and effective skin rendering is achieved.

CN114882165BActive Publication Date: 2025-09-12BEIJING SWEET SUGARSOFT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210608353.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-31
Publication Date
2025-09-12
Estimated Expiration
2042-05-31

AI Technical Summary

Technical Problem

In the development of hyper-realistic characters on mobile devices, the skin rendering effect has solid color areas with low smoothness, resulting in poor rendering effect. The existing algorithm collection has a large amount of computation and cannot be effectively applied to mobile devices.

Method used

By obtaining the skin range map, determining the first range information and the second range information of the model to be rendered, generating subsurface scattering range information, and combining it with the reference color information to generate rendering data, it avoids the use of complex projection and refraction algorithms and improves rendering efficiency.

Benefits of technology

It achieves efficient rendering of subsurface scattering effects on mobile platforms, improves rendering efficiency, and ensures that the rendering effect is consistent with real skin effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114882165B_ABST
    Figure CN114882165B_ABST
Patent Text Reader

Abstract

The present disclosure provides a model rendering method, device, electronic device and storage medium, the method comprising: obtaining a skin range map corresponding to a model to be rendered; wherein the skin range map is used to characterize relative thickness information and / or relative curvature information between different positions on the model to be rendered; generating subsurface scattering range information corresponding to the model to be rendered based on the skin range map, determined first range information and second range information corresponding to the model to be rendered; wherein the first range information is used to characterize range information of a subsurface scattering effect produced by the skin of the model to be rendered under illumination; and the second range information is used to characterize the edge light range of the model to be rendered at any viewing angle; and generating rendering data characterizing the subsurface scattering effect corresponding to the skin of the model to be rendered based on the subsurface scattering range information and color information of a determined reference color.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of three-dimensional modeling, and in particular to a model rendering method, device, electronic device, and storage medium. Background Art

[0002] With the rapid development of industries such as film and television animation, 3D gaming, and virtual reality, 3D model rendering technology is also constantly improving and developing. Within mobile hyper-realistic character development and rendering solutions, skin rendering presents significant technical barriers. For example, when the understanding of skin rendering is relatively simple, the rendered skin effect will appear as a solid color area with low smoothness, resulting in poor rendering quality.

[0003] Analysis of the skin effects revealed that the application of subsurface scattering technology plays an important role in improving skin rendering effects. Summary of the Invention

[0004] In view of this, the present disclosure at least provides a model rendering method, device, electronic device and storage medium.

[0005] In a first aspect, the present disclosure provides a model rendering method, comprising:

[0006] Obtaining a skin range map corresponding to the model to be rendered; wherein the skin range map is used to represent relative thickness information and / or relative curvature information between different positions on the model to be rendered;

[0007] Generate subsurface scattering range information corresponding to the model to be rendered based on the skin range map and the determined first range information and second range information corresponding to the model to be rendered; wherein the first range information is used to represent range information of a subsurface scattering effect produced by the skin of the model to be rendered under illumination; and the second range information is used to represent a rim light range of the model to be rendered at any viewing angle;

[0008] Based on the subsurface scattering range information and the color information of the determined reference color, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is generated.

[0009] In the above method, subsurface scattering range information corresponding to the model to be rendered is generated based on the skin range map, the first range information and the second range information corresponding to the determined model to be rendered. The first range information represents the range information of the subsurface scattering effect produced by the skin of the model to be rendered under illumination, the second range information represents the edge light range of the model to be rendered at any viewing angle, and the skin range map represents the relative thickness information and / or relative curvature information between different positions on the model to be rendered. Since the first range information and the second range information can represent the subsurface scattering effect of the skin, the first range information and the second range information are mixed with the skin range map of the model to be rendered to more accurately generate the subsurface scattering range information corresponding to the model to be rendered. Furthermore, based on the subsurface scattering range information and the color information of the determined reference color, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is more accurately generated.

[0010] At the same time, based on the first range information, the second range information and the skin range map, the sub-surface scattering effect range of the model to be rendered is obtained. The skin range map can be data generated in advance, and does not use complex projection and refraction algorithms to determine the sub-surface scattering (3S) effect, which alleviates the problem of large amount of calculation caused by calculating the sub-surface scattering effect in the offline rendering process and improves the efficiency of model rendering; while ensuring the 3S rendering effect of the model skin, the model rendering method can be effectively and better applied to mobile platforms.

[0011] In a possible implementation, generating subsurface scattering range information corresponding to the to-be-rendered model based on the skin range map, the determined first range information, and the second range information includes:

[0012] Superimposing the first range information and the second range information to obtain intermediate range information;

[0013] The intermediate range information is masked using the skin range map to generate the subsurface scattering range information corresponding to the model to be rendered.

[0014] In the above embodiment, the first range information and the second range information are superimposed to obtain the intermediate range information; and the intermediate range information is masked using the skin range map to generate the subsurface scattering range information corresponding to the model to be rendered. This realizes the determination of the subsurface scattering range information corresponding to the rendering model based on the empirical performance of the effect, thereby improving the rendering efficiency while ensuring the 3S effect of the model to be rendered.

[0015] In a possible implementation, the first range information is generated according to the following steps:

[0016] generating first intermediate range information corresponding to the model to be rendered based on the illumination direction information and the normal direction information corresponding to the model to be rendered;

[0017] Performing inversion processing on each element included in the first intermediate range information to generate processed first intermediate range information; wherein the processed first intermediate range information is used to represent the range of backlighting corresponding to the model to be rendered;

[0018] Based on the determined first target number, a power operation is performed on each element included in the processed first intermediate range information to generate the first range information.

[0019] In the above implementation, based on the illumination direction information and the normal direction information corresponding to the model to be rendered, the first range information is generated more simply and efficiently, which alleviates the computational pressure of using the algorithm process to determine the subsurface scattering effect, improves the efficiency of determining the 3S effect range, and the obtained first range information is closer to the physical facts of the 3S effect range, thereby ensuring the 3S rendering effect of the skin of the model to be rendered.

[0020] In a possible implementation, the second range information is generated according to the following steps:

[0021] generating second intermediate range information corresponding to the model to be rendered based on the viewing direction information corresponding to any viewing angle and the normal direction information corresponding to the model to be rendered;

[0022] performing inversion processing on each element included in the second intermediate range information to generate processed second intermediate range information; wherein the processed second intermediate range information is used to represent the reverse range of the to-be-rendered model at any viewing angle;

[0023] Based on the determined second target number, a power operation is performed on each element included in the processed second intermediate range information to generate the second range information.

[0024] In the above embodiment, by determining the second range information, the second range information is used to simulate the edge light phenomenon corresponding to the 3S effect, that is, the second range information is used to simulate the area with brighter edges in the 3S variation range, enriching the level of the subsurface scattering effect, and then using the second range information to more accurately determine the subsurface scattering range information of the model to be rendered, so that the subsurface scattering range information can be used to better render the 3S effect on the model to be rendered.

[0025] In one possible implementation, generating rendering data representing a subsurface scattering effect corresponding to the skin of the model to be rendered based on the subsurface scattering range information and the color information of the determined reference color includes:

[0026] Adjusting the color information of the reference color using at least one of scene light color information, ambient light color information, and color information indicated by a texture map to generate subsurface scattering color information corresponding to the skin of the model to be rendered;

[0027] Based on the subsurface scattering color information and the subsurface scattering range information corresponding to the model to be rendered, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is generated.

[0028] In the above embodiment, the color information of the reference color is adjusted by using at least one of the scene light color information, the ambient light color information, and the color information indicated by the texture map, and the subsurface scattering color information corresponding to the model to be rendered is generated, so that the subsurface scattering color information is more consistent with the color information of the skin 3S effect, thereby enabling the obtained rendering data to better render the 3S effect of the model to be rendered.

[0029] In a possible implementation, after generating subsurface scattering color information corresponding to the skin of the model to be rendered, the method further includes:

[0030] Based on the determined color transition map, pixel adjustment is performed on the skin range map to generate an adjusted skin range map;

[0031] Adjusting the subsurface scattering color information based on color information indicated by pixel information of each pixel point in the adjusted skin range map to generate adjusted subsurface scattering color information;

[0032] The generating, based on the subsurface scattering color information and the subsurface scattering range information corresponding to the model to be rendered, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered includes:

[0033] Based on the adjusted subsurface scattering color information and the subsurface scattering range information corresponding to the model to be rendered, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is generated.

[0034] In the above embodiment, the skin range map is remapped by using a color transition map prepared in advance to obtain an adjusted skin range map, that is, the color transition corresponding to the skin of the model to be rendered is obtained, and then the subsurface scattering color information is adjusted based on the color information indicated by the pixel information of each pixel point in the adjusted skin range map to generate adjusted subsurface scattering color information. The adjusted subsurface scattering color information is consistent with the 3S effect of the skin in the real scene.

[0035] In one possible implementation, the color information of each pixel having the same horizontal coordinate value in the color transition map is consistent; and the pixel adjustment of the skin range map based on the determined color transition map to generate the adjusted skin range map includes:

[0036] For each pixel point in the skin range map, based on the pixel information corresponding to the pixel point, determine from the color transition map any target pixel point whose abscissa value matches the pixel information; and determine the pixel information corresponding to the target pixel point as the adjusted pixel information corresponding to the pixel point;

[0037] Based on the adjusted pixel information corresponding to each pixel point, an adjusted skin range map is generated.

[0038] In one possible implementation, after generating rendering data representing a subsurface scattering effect corresponding to the skin of the model to be rendered, the method further includes:

[0039] The skin of the model to be rendered is rendered using at least one of the determined highlight information, model color information, and basic lighting information corresponding to the model to be rendered, and the rendering data to obtain a target model.

[0040] Here, since the rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered can be generated more accurately, that is, the subsurface scattering effect corresponding to the rendering data is consistent with the actual 3S effect of the skin, the skin of the model to be rendered is rendered using at least one of the highlight information, model color information and basic lighting information and the rendering data to obtain the target model, so that the target model has a better 3S effect.

[0041] The description of the effects of the following devices, electronic equipment, etc. can be found in the description of the above method and will not be repeated here.

[0042] In a second aspect, the present disclosure provides a model rendering device, comprising:

[0043] An acquisition module, configured to acquire a skin range map corresponding to the model to be rendered; wherein the skin range map is used to represent relative thickness information and / or relative curvature information between different positions on the model to be rendered;

[0044] A first generation module is configured to generate subsurface scattering range information corresponding to the model to be rendered based on the skin range map and the determined first range information and second range information corresponding to the model to be rendered; wherein the first range information is used to represent range information of a subsurface scattering effect produced by the skin of the model to be rendered under illumination; and the second range information is used to represent a rim light range of the model to be rendered at any viewing angle;

[0045] The second generating module is configured to generate rendering data representing a subsurface scattering effect corresponding to the skin of the model to be rendered based on the subsurface scattering range information and the color information of the determined reference color.

[0046] In a third aspect, the present disclosure provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the model rendering method described in the first aspect or any embodiment are performed.

[0047] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the model rendering method described in the first aspect or any one of the embodiments are executed.

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

[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without inventive effort.

[0050] Figure 1 A schematic diagram showing a flow chart of a model rendering method provided by an embodiment of the present disclosure is shown;

[0051] Figure 2 A schematic diagram of generating subsurface scattering range information in a model rendering method provided by an embodiment of the present disclosure is shown;

[0052] Figure 3A schematic diagram of processing a skin range map in a model rendering method provided by an embodiment of the present disclosure is shown;

[0053] Figure 4 A schematic diagram of the architecture of a model rendering device provided by an embodiment of the present disclosure is shown;

[0054] Figure 5 A structural schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure.

[0056] Skin rendering is an area with significant technical barriers in mobile hyper-realistic character development and rendering solutions. For example, when understanding skin rendering is relatively simple, the rendered skin effect will appear as a solid color area with low smoothness, resulting in poor rendering quality.

[0057] Sub-surface-scattering (3S) is a term used to describe the lighting phenomenon in which light is scattered when passing through transparent or translucent surfaces. It refers to the process by which light enters an object from a surface, is scattered internally, and then exits through other vertices on the object's surface. It has been found that light creates a more pronounced sub-surface scattering effect on the skin surface. This shows that the application of sub-surface scattering technology plays an important role in improving skin rendering effects.

[0058] Generally, during skin rendering, a collection of algorithms related to internal scattering, surface refraction, and internal transmission can be used to determine the subsurface scattering effect of the skin. However, in this method, the algorithm collection requires a large amount of calculation to determine the subsurface scattering effect. This large amount of calculation results in low skin rendering efficiency. Moreover, due to the limited computing resources of mobile devices, this method cannot be applied to mobile devices.

[0059] In order to alleviate the above problems, embodiments of the present disclosure provide a model rendering method, device, electronic device, and storage medium.

[0060] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.

[0061] To facilitate understanding of the embodiments of the present disclosure, a model rendering method disclosed in the embodiments of the present disclosure is first introduced in detail. The execution subject of the model rendering method provided in the embodiments of the present disclosure is generally a computer device with certain computing capabilities. The computer device includes, for example: a terminal device or other processing device. The terminal device can be a smartphone, tablet, laptop computer, mobile internet device (MID), etc. In some possible implementations, the model rendering method can be implemented by a processor calling computer-readable instructions stored in a memory.

[0062] In the present disclosure, it has been found through research that in the model skin rendering process, the skin has a specific subsurface scattering effect. Taking the skin of a human face as an example, when the front of the face faces the direction of the light source, the face is observed from the front direction (that is, when the direction of the light source is consistent with the viewing angle direction), and it is found that the skin is an opaque object; and when the face is observed from the back direction, it is found that part of the light penetrates the facial skin and illuminates part of the skin on the front of the face. At the same time, the color mapped by the penetrating light is a reddish color composed of the capillaries, red blood cells, etc. of the skin. The skin effect discovered above is determined to be the subsurface scattering effect of the skin.

[0063] In order to reflect the subsurface scattering effect of the skin in the skin rendering effect, the present disclosure proposes a model rendering method, which uses the method to determine the subsurface scattering range information corresponding to the model to be rendered based on the skin range map and the first range information and second range information corresponding to the determined model to be rendered, and then determines the rendering data of the subsurface scattering effect of the skin, replacing the method of determining the subsurface scattering using various algorithms to improve the efficiency of determining the subsurface scattering effect.

[0064] See also Figure 1 FIG. 1 is a flow chart of a model rendering method provided by an embodiment of the present disclosure, including S101 to S103, wherein:

[0065] S101, obtaining a skin range map corresponding to the model to be rendered; wherein the skin range map is used to represent relative thickness information and / or relative curvature information between different positions on the model to be rendered.

[0066] S102, based on the skin range map, the determined first range information and the second range information corresponding to the model to be rendered, generate subsurface scattering range information corresponding to the model to be rendered; wherein the first range information is used to represent the range information of the subsurface scattering effect produced by the skin of the model to be rendered under light; and the second range information is used to represent the edge light range of the model to be rendered at any viewing angle.

[0067] S103 : Generate rendering data representing a subsurface scattering effect corresponding to the skin of the model to be rendered based on the subsurface scattering range information and the color information of the determined reference color.

[0068] In the above method, subsurface scattering range information corresponding to the model to be rendered is generated based on the skin range map, the first range information and the second range information corresponding to the determined model to be rendered. The first range information represents the range information of the subsurface scattering effect produced by the skin of the model to be rendered under illumination, the second range information represents the edge light range of the model to be rendered at any viewing angle, and the skin range map represents the relative thickness information and / or relative curvature information between different positions on the model to be rendered. Since the first range information and the second range information can represent the subsurface scattering effect of the skin, the first range information and the second range information are mixed with the skin range map of the model to be rendered to more accurately generate the subsurface scattering range information corresponding to the model to be rendered. Furthermore, based on the subsurface scattering range information and the color information of the determined reference color, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is more accurately generated.

[0069] At the same time, based on the first range information, the second range information and the skin range map, the subsurface scattering effect range of the model to be rendered is obtained. The skin range map can be data generated in advance, and does not use complex projection and refraction algorithms to determine the 3S effect, which alleviates the problem of large computational complexity caused by calculating the subsurface scattering effect during offline rendering and improves the efficiency of model rendering. While ensuring the 3S rendering effect of the model skin, the model rendering method can be effectively and better applied to mobile platforms.

[0070] S101 to S103 are described in detail below.

[0071] For S101:

[0072] During implementation, the skin range map corresponding to the model to be rendered can be extracted and generated offline so that the execution entity (such as the model rendering platform) can obtain the skin range map data. The skin range map is used to represent the relative thickness information and / or relative curvature information between different positions on the model to be rendered. The skin range map can be map data with pixel information between 0 and 1; the pixel information in the skin range map is negatively correlated with the thickness information, and / or the pixel information is positively correlated with the curvature information.

[0073] Exemplarily, for pixel position 1 and pixel position 2 on the skin range map, based on the comparison result between pixel value 1 corresponding to pixel position 1 and pixel value 2 corresponding to pixel position 2, the thickness and / or curvature between model position 1 corresponding to pixel position 1 and model position 2 corresponding to pixel position 2 on the to-be-rendered model are determined. For example, if pixel value 1 is greater than pixel value 2, this indicates that the model thickness at model position 1 on the to-be-rendered model is less than the model thickness at model position 1, and / or the curvature corresponding to model position 1 is greater than the curvature corresponding to model position 2.

[0074] For S102:

[0075] The first range information, the second range information, and the skin range map corresponding to the model to be rendered may be mixed to generate subsurface scattering range information corresponding to the model to be rendered.

[0076] Exemplarily, the first range information includes element values ​​corresponding to the vertices of the model to be rendered, and the element values ​​represent the difficulty of generating a 3S effect at the position of the vertex, and / or the intensity of the 3S effect generated at the position of the vertex. After obtaining the first range information, a first range map representing the first range information corresponding to the model to be rendered can be obtained. Among them, the pixel values ​​of each pixel point in the first range map match the element values ​​corresponding to each vertex on the model to be rendered. Similarly, a second range map representing the second range information corresponding to the model to be rendered can be obtained. Then, the first range map, the second range map and the skin range map corresponding to the model to be rendered can be superimposed to generate a subsurface scattering range map representing the subsurface scattering range information corresponding to the model to be rendered.

[0077] Since subsurface scattering is the effect observed on the skin surface after light penetrates the model's skin, the skin facing the light will not show a significant subsurface scattering effect, while the skin facing away from the light will show a significant subsurface scattering effect. To simulate this phenomenon, we can first determine the base illumination range corresponding to the illumination direction, then invert this base illumination range to obtain a processed base illumination range, and then determine the first range information based on this processed base illumination range.

[0078] The first range information is used to represent the range of the subsurface scattering effect generated by the skin of the model to be rendered under illumination. This range information can be used to indicate the difficulty and / or intensity of the subsurface scattering effect generated at any skin position of the model to be rendered.

[0079] For example, for position A and position B on the skin of the model to be rendered, if the pixel value A of the pixel point corresponding to position A on the first range map is greater than the pixel value B of the pixel point corresponding to position B on the first range map, it indicates that compared with position B, position A is more likely to produce a subsurface scattering effect, and / or the intensity of the subsurface scattering effect generated by position A is greater than the intensity of the subsurface scattering effect generated by position B.

[0080] In an optional implementation, the first range information is generated according to the following steps:

[0081] Step A1: Generate first intermediate range information corresponding to the model to be rendered based on the illumination direction information and the normal direction information corresponding to the model to be rendered.

[0082] Step A2: performing inversion processing on each element included in the first intermediate range information to generate processed first intermediate range information; wherein the processed first intermediate range information is used to represent the range of backlighting corresponding to the model to be rendered.

[0083] Step A3: Based on the determined first target number, perform a power operation on each element included in the processed first intermediate range information to generate first range information.

[0084] Based on the illumination direction information and the normal direction information corresponding to the model to be rendered, the first intermediate range information corresponding to the model to be rendered is generated. For example, the normal direction information of each vertex on the model to be rendered can be subjected to a dot product operation with the illumination direction information to obtain the calculation value corresponding to each vertex; the calculation value corresponding to each vertex constitutes the first intermediate range information. Then, each element included in the first intermediate range information is inverted to generate the processed first intermediate range information; wherein, the processed first intermediate range information is used to characterize the range of backlighting corresponding to the model to be rendered. For example, a target value (such as 1) can be used to subtract each element to generate the processed first intermediate range information.

[0085] For another example, a first intermediate range map representing the first intermediate range information can be obtained. A pixel value of each pixel in the first intermediate range map representing the first intermediate range information is inverted to obtain a processed pixel value, i.e., processed pixel value = 1 - pixel value. A processed first intermediate range map can then be generated based on the processed pixel values. The processed first intermediate range map can represent the processed first intermediate range information.

[0086] Based on the determined first target number, a power operation is performed on each element of the processed first intermediate range information to generate first range information. The first target number can be set as needed and is positively correlated with the backlight range of the skin model under illumination; that is, a larger first target number indicates a larger backlight range.

[0087] For example, for each pixel position in the processed first intermediate range map, the pixel value of the pixel position is calculated by raising the power of the first target number to obtain the pixel value after the power calculation corresponding to the pixel position; based on the pixel values ​​after the power calculation corresponding to each pixel position on the first intermediate range map, a first range map representing the first range information is generated, that is, the element values ​​included in the first range information match the pixel values ​​after the power calculation of each first target number.

[0088] Because the pixel value at each pixel position in the first intermediate range map is less than 1, after the power operation, the corresponding pixel value at each pixel position will gradually decrease, the corresponding color of the pixel position will become darker, and the backlight range will increase. Therefore, by controlling the first target degree, the value of each element in the first range information can be controlled, thereby controlling the range of the subsurface scattering effect produced by the skin of the rendered model under lighting.

[0089] In the above implementation, based on the illumination direction information and the normal direction information corresponding to the model to be rendered, the first range information is generated more simply and efficiently, which alleviates the computational pressure of using the algorithm process to determine the subsurface scattering effect, improves the efficiency of determining the 3S effect range, and the obtained first range information is closer to the physical facts of the 3S effect range, thereby ensuring the 3S rendering effect of the skin of the model to be rendered.

[0090] The study also found that because the surface of the human body is an irregular arc rather than a completely flat surface, the skin becomes thinner towards the boundary when viewed from the perspective, and the penetration of light has energy attenuation. The thicker the object that needs to be penetrated, the less energy is scattered after penetration. And when light encounters other tissues such as bones, it will affect the effect of light penetration. Comprehensive analysis shows that subsurface scattering will present an effect with the boundary as the strongest point and gradually attenuating towards the center. That is, subsurface scattering is mainly distributed at the edge of the model, and the less light penetrates towards the center. In order to simulate the above phenomenon, the present disclosure determines the second range information.

[0091] The second range information is used to represent the edge light range of the model to be rendered at any viewing angle. The edge light range is related to the viewing angle, with different viewing angles corresponding to different edge light ranges. Furthermore, at different viewing angles, the subsurface scattering effect of the model to be rendered is stronger at the edges than at the center.

[0092] In an optional implementation, the second range information is generated according to the following steps:

[0093] Step B1: Generate second intermediate range information corresponding to the model to be rendered based on the viewing direction information corresponding to any viewing angle and the normal direction information corresponding to the model to be rendered.

[0094] Step B2: performing inversion processing on each element included in the second intermediate range information to generate processed second intermediate range information; wherein the processed second intermediate range information is used to represent the reverse range of the model to be rendered at any viewing angle.

[0095] Step B3: Based on the determined second target number, perform a power operation on each element included in the processed second intermediate range information to generate second range information.

[0096] Based on the viewing direction information corresponding to any viewing angle and the normal direction information corresponding to the model to be rendered, the second intermediate range information corresponding to the model to be rendered is generated. For example, the normal direction information of each vertex on the model to be rendered can be subjected to a dot product operation with the viewing direction information to obtain the operation value corresponding to each vertex; the operation value corresponding to each vertex constitutes the second intermediate range information. Then, each element included in the second intermediate range information is inverted to generate the processed second intermediate range information; wherein the processed second intermediate range information is used to characterize the reverse range of the model to be rendered at any viewing angle. For example, a target value (such as 1) can be used to subtract each element to generate the processed second intermediate range information.

[0097] For another example, a second intermediate range map representing the second intermediate range information can be obtained. A pixel value of each pixel in the second intermediate range map representing the second intermediate range information is inverted to obtain a processed pixel value, i.e., processed pixel value = 1 - pixel value. A processed second intermediate range map representing the processed second intermediate range information can then be generated based on each processed pixel value.

[0098] Based on the determined second target order, a power operation is performed on each element of the processed second intermediate range information to generate second range information. The second target order can be set as needed, and is negatively correlated with the edge light range corresponding to the skin model under the viewing angle. That is, a larger second target order indicates a smaller edge light range.

[0099] For example, for each pixel position in the processed second intermediate range map, the pixel value of the pixel position is calculated to the power of the second target number to obtain the pixel value after the power calculation corresponding to the pixel position; based on the pixel values ​​after the power calculation corresponding to each pixel position on the second intermediate range map, a second range map representing the second range information is generated, that is, the element values ​​included in the second range information match the pixel values ​​after the power calculation of each second target number.

[0100] Since the pixel value of each pixel position in the second intermediate range map is less than 1, after the power operation, the pixel value corresponding to each pixel position will gradually become smaller, and the color corresponding to the pixel position will become darker. The darkening of the color indicates that it is more difficult to generate edge light at this position or the edge light intensity is smaller. It can be seen that the larger the second target number, the smaller the edge light range, thereby achieving control of the edge light range.

[0101] In the above embodiment, by determining the second range information, the second range information is used to simulate the edge light phenomenon corresponding to the 3S effect, that is, the second range information is used to simulate the area with brighter edges in the 3S variation range, enriching the level of the subsurface scattering effect, and then using the second range information to more accurately determine the subsurface scattering range information of the model to be rendered, so that the subsurface scattering range information can be used to better render the 3S effect on the model to be rendered.

[0102] In one possible implementation, generating subsurface scattering range information corresponding to the to-be-rendered model based on the skin range map, the determined first range information, and the second range information includes:

[0103] S1021: Superimpose the first range information and the second range information to obtain intermediate range information.

[0104] S1022: Using the skin range map, mask the intermediate range information to generate subsurface scattering range information corresponding to the model to be rendered.

[0105] The first range information and the second range information are superimposed to obtain intermediate range information. For example, the pixel values ​​of each pixel in the first range map representing the first range information can be added to the pixel values ​​of the corresponding pixels in the second range map representing the second range information to generate an intermediate range map representing the intermediate range information corresponding to the model to be rendered.

[0106] This intermediate range information can express the basic range of the subsurface scattering range, but this basic range still lacks details. If no details are added, and the intermediate range information is directly used to perform 3S effect rendering on the model to be rendered, after obtaining the rendered model, when observing the rendered model from the front, it is found that the subsurface scattering effect is completely invisible on the front of the rendered model, but when observing from the front of the real skin, it can be seen that thinner parts such as the nose wings, earlobes, etc. can produce some subsurface scattering effects. At the same time, when observing the rendered model from the back, it is found that the entire skin of the rendered model is penetrated by light, but when observing from the back of the real skin, it can be seen that the subsurface scattering effect is more obvious in the thinner parts of the skin, while the light cannot penetrate the thicker parts of the skin such as the nose, cheeks, etc., and no subsurface scattering effect can be produced. It can be seen that the subsurface scattering effect of the above-mentioned rendered model is inconsistent with the real subsurface scattering effect.

[0107] To describe this detail phenomenon, a skin range map representing relative thickness information and / or relative curvature information between different locations on the model to be rendered can be used to mask the mid-range information to generate subsurface scattering range information corresponding to the model to be rendered. For example, the skin range map can be used to perform layer masking on a mid-range map representing mid-range information to generate a subsurface scattering range map representing subsurface scattering range information corresponding to the model to be rendered.

[0108] See also Figure 2 As shown, based on the illumination direction information and the normal direction information corresponding to the model to be rendered, the first range information corresponding to the model to be rendered is generated. Based on the viewing direction information and the normal direction information corresponding to the model to be rendered, the second range information corresponding to the model to be rendered is generated, wherein, Figure 2 The first range map representing the first range information is included in Figure 2 201 in , and the second range map representing the second range information, that is, Figure 2 202 in. The pixel value of each pixel point in the first range map is added to the pixel value of the corresponding pixel point in the second range map to generate an intermediate range map representing the intermediate range information, that is, Figure 2203 in. Then use the skin range map Figure 2 In step 204, a layer mask is performed on step 203 to generate a subsurface scattering range map representing subsurface scattering range information of the model to be rendered at the viewing angle, that is, Figure 2 205 of them.

[0109] In the above embodiment, the first range information and the second range information are superimposed to obtain the intermediate range information; and the intermediate range information is masked using the skin range map to generate the subsurface scattering range information corresponding to the model to be rendered. This realizes the determination of the subsurface scattering range information corresponding to the rendering model based on the empirical performance of the effect, thereby improving the rendering efficiency while ensuring the 3S effect of the model to be rendered.

[0110] For S103:

[0111] Based on the subsurface scattering range information and the color information of the determined reference color, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is generated. The reference color can be set as needed. For example, the pixel values ​​of each pixel in the subsurface scattering range map representing the subsurface scattering range information are merged with the RGB values ​​of the reference color to generate rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered.

[0112] In one possible implementation, generating rendering data representing a subsurface scattering effect corresponding to the skin of a model to be rendered based on the subsurface scattering range information and the color information of the determined reference color includes:

[0113] S1031, using at least one color information of scene light color information, ambient light color information, and color information indicated by a texture map, adjust the color information of the reference color to generate subsurface scattering color information corresponding to the skin of the model to be rendered.

[0114] S1032 : Generate rendering data representing a subsurface scattering effect corresponding to the skin of the model to be rendered based on the subsurface scattering color information and the subsurface scattering range information corresponding to the model to be rendered.

[0115] Considering that after light penetrates the skin, the light can be seen on the back of the model, but the light that passes through is not the color of the original light. For example, if the light source is yellow, and after penetrating the skin, the thinner the skin is, the closer it is to the color of the light source itself, followed by the red formed by the hemoglobin tissue in the capillaries or muscles, and the further inward, the closer it is to the original color of the skin, and there are multiple transitions to form color changes. In order to simulate the above phenomenon, the present disclosure can use at least one color information of the scene light color information, the ambient light color information, and the color information indicated by the texture map to adjust the color information of the reference color, and generate subsurface scattering color information corresponding to the skin of the model to be rendered.

[0116] For example, the color information of the reference color can be adjusted using the scene light color information. Specifically, the color information of the adjusted reference color can be determined according to the following formula (1):

[0117] C1=LightColor.rgb*MainColor.rgb (1)

[0118] Among them, C1 represents the color information of the adjusted reference color, LightColor.rgb represents the scene light color information, and MainColor.rgb represents the color information of the reference color.

[0119] If the RGB value of the scene light color information may be (R1, G1, B1), and the RGB value of the reference color may be (R2, G2, B2), then (R1×R2, G1×G2, B1×B2) is used as the RGB value of the adjusted reference color (ie, color information).

[0120] For another example, the color information of the reference color can be adjusted using the scene light color information and the ambient light color information. Specifically, the color information of the adjusted reference color can be determined according to the following formula (2):

[0121] C1= LightColor.rgb*AmbientColor.rgb*MainColor.rgb (2)

[0122] Among them, AmbientColor.rgb represents the color information of the ambient light color.

[0123] The RGB value of the scene light color information can be (R1, G1, B1), the RGB value of the color information representing the reference color can be (R2, G2, B2), and the RGB value representing the ambient light color information can be (R3, G3, B3). (R1×R2×R3, G1×G2×G3, B1×B2×B3) is used as the RGB value of the adjusted reference color.

[0124] In order to obtain a better rendering effect, the color information of the reference color can also be adjusted using the scene light color information, the ambient light color information, and the color information indicated by the texture map. Specifically, the color information of the adjusted reference color can be determined according to the following formula (3):

[0125] C1=LightColor.rgb*AmbientColor.rgb*MainTexture.rgb*MainColor.rgb(3)

[0126] Among them, MainTexture.rgb is the color information indicated by the texture map.

[0127] After adjusting the reference color, color information of the adjusted reference color can be obtained. This color information can then be determined as the subsurface scattering color information corresponding to the skin of the model to be rendered. Based on the subsurface scattering color information and the subsurface scattering range information corresponding to the skin of the model to be rendered, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is generated. For example, the subsurface scattering color information and the subsurface scattering range information can be blended to generate rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered.

[0128] In the above embodiment, the color information of the reference color is adjusted by using at least one of the scene light color information, the ambient light color information, and the color information indicated by the texture map, and the subsurface scattering color information corresponding to the model to be rendered is generated, so that the subsurface scattering color information is more consistent with the color information of the skin 3S effect, thereby enabling the obtained rendering data to better render the 3S effect of the model to be rendered.

[0129] In one possible implementation, after generating subsurface scattering color information corresponding to the skin of the model to be rendered, the method further includes:

[0130] Step 1: Based on the determined color transition map, pixel adjustment is performed on the skin range map to generate an adjusted skin range map.

[0131] Step 2: Based on the color information indicated by the pixel information of each pixel point in the adjusted skin range map, the subsurface scattering color information is adjusted to generate adjusted subsurface scattering color information.

[0132] Based on the subsurface scattering color information and subsurface scattering range information corresponding to the model to be rendered, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is generated, including: based on the adjusted subsurface scattering color information and subsurface scattering range information corresponding to the model to be rendered, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is generated.

[0133] Here, the color transition map represents a color transition. Figure 3 As shown in 302 in FIG, the color transition map gradually deepens from left to right. For example, a color transition map with a red tint can be used to adjust the skin of a model to be rendered.

[0134] As shown in FIG3 , based on the determined color transition map 302, the skin range map 301 can be pixel-adjusted to generate an adjusted skin range map 303. Furthermore, based on the color information indicated by the pixel information of each pixel in the adjusted skin range map, the subsurface scattering color information can be adjusted to generate adjusted subsurface scattering color information. Furthermore, based on the adjusted subsurface scattering color information and the subsurface scattering range information corresponding to the model to be rendered, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered can be generated.

[0135] In a specific implementation, the color information of the base color can be adjusted using scene light color information and ambient light color information to obtain adjusted color information. This adjusted color information is then blended with the color information indicated by the texture map to obtain subsurface scattering color information. Furthermore, based on the color transition map, the skin range map is pixel-adjusted to generate an adjusted skin range map. The color information indicated by the pixel information of each pixel in the adjusted skin range map is blended with the subsurface scattering color information to generate adjusted subsurface scattering color information. Finally, each element in the adjusted subsurface scattering color information is multiplied with each element corresponding to the subsurface scattering range information to generate rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered.

[0136] In the above embodiment, the skin range map is remapped by using a color transition map prepared in advance to obtain an adjusted skin range map, that is, the color transition corresponding to the skin of the model to be rendered is obtained, and then the subsurface scattering color information is adjusted based on the color information indicated by the pixel information of each pixel point in the adjusted skin range map to generate adjusted subsurface scattering color information. The adjusted subsurface scattering color information is consistent with the 3S effect of the skin in the real scene.

[0137] In one possible implementation, the color information of each pixel with the same horizontal coordinate value in the color transition map is consistent; based on the determined color transition map, pixel adjustment is performed on the skin range map to generate an adjusted skin range map, including: for each pixel in the skin range map, based on the pixel information corresponding to the pixel point, determining from the color transition map any target pixel whose horizontal coordinate value matches the pixel information; and determining the pixel information corresponding to the target pixel point as the adjusted pixel information corresponding to the pixel point. The adjusted skin range map is generated based on the adjusted pixel information corresponding to each pixel point.

[0138] For each pixel point in the skin range map, based on the pixel information corresponding to the pixel point, determine any target pixel point (the coordinate value of the target pixel point is random) whose horizontal coordinate value matches the pixel information from the color transition map; and determine the pixel information corresponding to the target pixel point as the adjusted pixel information corresponding to the pixel point. For example, for pixel point A in the skin range map, the pixel information of pixel point A is 0.3. Since the color information of each pixel point with the same horizontal coordinate value and different vertical coordinate values ​​in the color transition map is consistent, the pixel information of the target pixel point with a horizontal coordinate value of 0.3 and any vertical coordinate value can be determined as the adjusted pixel information corresponding to pixel point A in the color transition map. Then, based on the adjusted pixel information corresponding to each pixel point, generate the adjusted skin range map.

[0139] After generating rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered, the method also includes: using at least one of the highlight information, model color information and basic lighting information corresponding to the determined model to be rendered, and the rendering data, to render the skin of the model to be rendered to obtain a target model.

[0140] Here, the skin of the model to be rendered is rendered using at least one of the highlight information, model color information, and basic lighting information determined for the model to be rendered, and the rendering data, to obtain a target model. For example, the skin of the model to be rendered can be rendered using the highlight information determined for the model to be rendered and rendering data representing a subsurface scattering effect corresponding to the skin of the model to be rendered, to obtain a target model.

[0141] For another example, in order to obtain a more realistic model skin effect, the skin of the model to be rendered can be rendered using the highlight information, model color information, basic lighting information and rendering data corresponding to the determined model to be rendered to obtain the target model.

[0142] Here, since the rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered can be generated more accurately, that is, the subsurface scattering effect corresponding to the rendering data is consistent with the actual 3S effect of the skin, the skin of the model to be rendered is rendered using at least one of the highlight information, model color information and basic lighting information and the rendering data to obtain the target model, so that the target model has a better 3S effect.

[0143] Those skilled in the art will understand that in the above-mentioned method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0144] Based on the same concept, the present disclosure also provides a model rendering device, see Figure 4 FIG. 4 is a schematic diagram of the architecture of the model rendering device provided by an embodiment of the present disclosure, including an acquisition module 401, a first generation module 402, and a second generation module 403. Specifically:

[0145] An acquisition module 401 is configured to acquire a skin range map corresponding to a model to be rendered; wherein the skin range map is configured to represent relative thickness information and / or relative curvature information between different positions on the model to be rendered;

[0146] A first generating module 402 is configured to generate subsurface scattering range information corresponding to the model to be rendered based on the skin range map and the determined first range information and second range information corresponding to the model to be rendered; wherein the first range information is used to represent range information of the subsurface scattering effect produced by the skin of the model to be rendered under illumination; and the second range information is used to represent the rim light range of the model to be rendered at any viewing angle;

[0147] The second generating module 403 is configured to generate rendering data representing a subsurface scattering effect corresponding to the skin of the model to be rendered based on the subsurface scattering range information and the color information of the determined reference color.

[0148] In one possible implementation, the first generating module 402, when generating the subsurface scattering range information corresponding to the to-be-rendered model based on the skin range map, the determined first range information, and the second range information, is configured to:

[0149] Superimposing the first range information and the second range information to obtain intermediate range information;

[0150] The intermediate range information is masked using the skin range map to generate the subsurface scattering range information corresponding to the model to be rendered.

[0151] In a possible implementation, the apparatus further includes a first determining module 404 configured to generate the first range information according to the following steps:

[0152] generating first intermediate range information corresponding to the model to be rendered based on the illumination direction information and the normal direction information corresponding to the model to be rendered;

[0153] Performing inversion processing on each element included in the first intermediate range information to generate processed first intermediate range information; wherein the processed first intermediate range information is used to represent the range of backlighting corresponding to the model to be rendered;

[0154] Based on the determined first target number, a power operation is performed on each element included in the processed first intermediate range information to generate the first range information.

[0155] In a possible implementation, the apparatus further includes a second determining module 405 configured to generate the second range information according to the following steps:

[0156] generating second intermediate range information corresponding to the model to be rendered based on the viewing direction information corresponding to any viewing angle and the normal direction information corresponding to the model to be rendered;

[0157] performing inversion processing on each element included in the second intermediate range information to generate processed second intermediate range information; wherein the processed second intermediate range information is used to represent the reverse range of the to-be-rendered model at any viewing angle;

[0158] Based on the determined second target number, a power operation is performed on each element included in the processed second intermediate range information to generate the second range information.

[0159] In one possible implementation, the second generation module 403, when generating rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered based on the subsurface scattering range information and the color information of the determined reference color, is configured to:

[0160] Adjusting the color information of the reference color using at least one of scene light color information, ambient light color information, and color information indicated by a texture map to generate subsurface scattering color information corresponding to the skin of the model to be rendered;

[0161] Based on the subsurface scattering color information and the subsurface scattering range information corresponding to the model to be rendered, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is generated.

[0162] In a possible implementation, the apparatus further includes an adjustment module 406, which, after generating subsurface scattering color information corresponding to the skin of the model to be rendered, is configured to:

[0163] Based on the determined color transition map, pixel adjustment is performed on the skin range map to generate an adjusted skin range map;

[0164] Adjusting the subsurface scattering color information based on color information indicated by pixel information of each pixel point in the adjusted skin range map to generate adjusted subsurface scattering color information;

[0165] The second generating module 403, when generating rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered based on the subsurface scattering color information and the subsurface scattering range information corresponding to the model to be rendered, is configured to:

[0166] Based on the adjusted subsurface scattering color information and the subsurface scattering range information corresponding to the model to be rendered, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is generated.

[0167] In one possible implementation, the color information of each pixel having the same horizontal coordinate value in the color transition map is consistent; and the adjustment module 406, when performing pixel adjustment on the skin range map based on the determined color transition map to generate the adjusted skin range map, is configured to:

[0168] For each pixel point in the skin range map, based on the pixel information corresponding to the pixel point, determine from the color transition map any target pixel point whose abscissa value matches the pixel information; and determine the pixel information corresponding to the target pixel point as the adjusted pixel information corresponding to the pixel point;

[0169] Based on the adjusted pixel information corresponding to each pixel point, an adjusted skin range map is generated.

[0170] In one possible implementation, the apparatus further includes a rendering module 407. After generating rendering data representing a subsurface scattering effect corresponding to the skin of the model to be rendered, the rendering module 407 is configured to:

[0171] The skin of the model to be rendered is rendered using at least one of the determined highlight information, model color information, and basic lighting information corresponding to the model to be rendered, and the rendering data to obtain a target model.

[0172] In some embodiments, the functions or templates contained in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiment. Its specific implementation can refer to the description of the above method embodiment. For the sake of brevity, it will not be repeated here.

[0173] Based on the same technical concept, the embodiment of the present disclosure also provides an electronic device. Figure 5 5 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure, including a processor 501, a memory 502, and a bus 503. Among them, the memory 502 is used to store execution instructions, including a memory 5021 and an external memory 5022; the memory 5021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 701 and the data exchanged with the external memory 5022 such as a hard disk. The processor 501 exchanges data with the external memory 5022 through the memory 5021. When the electronic device 500 is running, the processor 501 communicates with the memory 502 via the bus 503, so that the processor 501 executes the following instructions:

[0174] Obtaining a skin range map corresponding to the model to be rendered; wherein the skin range map is used to represent relative thickness information and / or relative curvature information between different positions on the model to be rendered;

[0175] Generate subsurface scattering range information corresponding to the model to be rendered based on the skin range map and the determined first range information and second range information corresponding to the model to be rendered; wherein the first range information is used to represent range information of a subsurface scattering effect produced by the skin of the model to be rendered under illumination; and the second range information is used to represent a rim light range of the model to be rendered at any viewing angle;

[0176] Based on the subsurface scattering range information and the color information of the determined reference color, rendering data representing the subsurface scattering effect corresponding to the skin of the model to be rendered is generated.

[0177] In addition, embodiments of the present disclosure further provide a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program executes the steps of the model rendering method described in the above method embodiment. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0178] The embodiments of the present disclosure also provide a computer program product, which carries program code. The instructions included in the program code can be used to execute the steps of the model rendering method described in the above method embodiment. For details, please refer to the above method embodiment and will not be repeated here.

[0179] The computer program product may be implemented in hardware, software, or a combination thereof. In one embodiment, the computer program product is implemented as a computer storage medium. In another embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0180] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0181] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0182] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0183] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0184] The above are only specific embodiments of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by any person skilled in the art within the technical scope disclosed in this disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.

Claims

1. A model rendering method, characterized in that: include: Obtaining a skin range map corresponding to the model to be rendered; wherein the skin range map is used to represent relative thickness information and / or relative curvature information between different positions on the model to be rendered; Generate subsurface scattering range information corresponding to the model to be rendered based on the skin range map and the determined first range information and second range information corresponding to the model to be rendered; wherein the first range information is used to represent range information of a subsurface scattering effect produced by the skin of the model to be rendered under illumination; and the second range information is used to represent a rim light range of the model to be rendered at any viewing angle; Adjusting the color information of the determined reference color using at least one of scene light color information, ambient light color information, and color information indicated by a texture map to generate subsurface scattering color information corresponding to the skin of the model to be rendered; Based on the determined color transition map, pixel adjustment is performed on the skin range map to generate an adjusted skin range map; Adjusting the subsurface scattering color information based on color information indicated by pixel information of each pixel point in the adjusted skin range map to generate adjusted subsurface scattering color information; generating rendering data representing a subsurface scattering effect corresponding to the skin of the model to be rendered based on the adjusted subsurface scattering color information and the subsurface scattering range information corresponding to the model to be rendered; The step of generating subsurface scattering range information corresponding to the model to be rendered based on the skin range map, the determined first range information, and the second range information includes: Superimposing the first range information and the second range information to obtain intermediate range information; The intermediate range information is masked using the skin range map to generate the subsurface scattering range information corresponding to the model to be rendered.

2. The method according to claim 1, characterized in that The first range information is generated according to the following steps: generating first intermediate range information corresponding to the model to be rendered based on the illumination direction information and the normal direction information corresponding to the model to be rendered; Performing inversion processing on each element included in the first intermediate range information to generate processed first intermediate range information; wherein the processed first intermediate range information is used to represent the range of backlighting corresponding to the model to be rendered; Based on the determined first target number, a power operation is performed on each element included in the processed first intermediate range information to generate the first range information.

3. The method according to claim 1, characterized in that The second range information is generated according to the following steps: generating second intermediate range information corresponding to the model to be rendered based on the viewing direction information corresponding to any viewing angle and the normal direction information corresponding to the model to be rendered; performing inversion processing on each element included in the second intermediate range information to generate processed second intermediate range information; wherein the processed second intermediate range information is used to represent the reverse range of the to-be-rendered model at any viewing angle; Based on the determined second target number, a power operation is performed on each element included in the processed second intermediate range information to generate the second range information.

4. The method according to claim 1, wherein The color information of each pixel point with the same horizontal coordinate value in the color transition map is consistent; and the pixel adjustment of the skin range map based on the determined color transition map to generate the adjusted skin range map includes: For each pixel point in the skin range map, based on the pixel information corresponding to the pixel point, determine from the color transition map any target pixel point whose abscissa value matches the pixel information; and determine the pixel information corresponding to the target pixel point as the adjusted pixel information corresponding to the pixel point; Based on the adjusted pixel information corresponding to each pixel point, an adjusted skin range map is generated.

5. The method according to claim 1, characterized in that After generating rendering data representing a subsurface scattering effect corresponding to the skin of the model to be rendered, the method further includes: The skin of the model to be rendered is rendered using at least one of the determined highlight information, model color information, and basic lighting information corresponding to the model to be rendered, and the rendering data to obtain a target model.

6. A model rendering device, characterized in that: include: An acquisition module, configured to acquire a skin range map corresponding to the model to be rendered; wherein the skin range map is used to represent relative thickness information and / or relative curvature information between different positions on the model to be rendered; A first generation module is configured to generate subsurface scattering range information corresponding to the model to be rendered based on the skin range map and the determined first range information and second range information corresponding to the model to be rendered; wherein the first range information is used to represent range information of a subsurface scattering effect produced by the skin of the model to be rendered under illumination; and the second range information is used to represent a rim light range of the model to be rendered at any viewing angle; A second generation module is configured to adjust the color information of a determined reference color using at least one of scene light color information, ambient light color information, and color information indicated by a texture map, to generate subsurface scattering color information corresponding to the skin of the model to be rendered; perform pixel adjustment on the skin range map based on a determined color transition map to generate an adjusted skin range map; adjust the subsurface scattering color information based on color information indicated by pixel information of each pixel point in the adjusted skin range map to generate adjusted subsurface scattering color information; and generate rendering data representing a subsurface scattering effect corresponding to the skin of the model to be rendered based on the adjusted subsurface scattering color information and the subsurface scattering range information corresponding to the model to be rendered; The first generating module, when used to generate subsurface scattering range information corresponding to the to-be-rendered model based on the skin range map, the determined first range information, and the second range information, is used to: Superimposing the first range information and the second range information to obtain intermediate range information; The intermediate range information is masked using the skin range map to generate the subsurface scattering range information corresponding to the model to be rendered.

7. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus. When the machine-readable instructions are executed by the processor, the steps of the model rendering method according to any one of claims 1 to 5 are performed.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the model rendering method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Character skin rendering method and device, storage medium and electronic device

    CN111862285A

  • Edge light rendering method and device, computer equipment and storage medium

    CN114529655A