Virtual object rendering method and device, computer equipment and storage medium

By obtaining the lighting parameters of the virtual object, calculating the diffuse reflection, specular reflection and shadow parameters, and integrating and rendering the skin of the virtual object, it solves the problems of large rendering calculations and narrow application range in the existing technology, and achieves high-quality virtual object rendering effects. .

CN118593983APending Publication Date: 2024-09-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310245920.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-06
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

The existing virtual object rendering method samples the texture in the virtual object, which requires a large amount of calculation, high equipment performance requirements, and a narrow scope of application, making it difficult to achieve high-quality virtual object rendering.

Method used

By obtaining the lighting parameters of the virtual object, calculating the diffuse reflection, specular reflection and shadow parameters, and fusing these parameters to render the skin of the target part, reducing texture sampling in the virtual object and reducing the amount of rendering calculations.

Benefits of technology

It improves the display effect of virtual object rendering, reduces the requirements for device performance, expands the scope of application, and achieves more realistic lighting display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118593983A
    Figure CN118593983A
Patent Text Reader

Abstract

The embodiment of the invention discloses a virtual object rendering method and device, computer equipment and a storage medium, and belongs to the technical field of computers. The method comprises the steps that illumination parameters of a virtual object are obtained, diffuse reflection parameters, highlight reflection parameters and shadow parameters of a target part are obtained based on the illumination parameters of the virtual object, the diffuse reflection parameters indicate the diffuse reflection condition of the target part, and the highlight reflection parameters indicate the highlight reflection condition of the target part; the shadow parameter indicates the color of a shadow area of the target part; fusing the diffuse reflection parameter, the highlight reflection parameter and the shadow parameter to obtain a rendering parameter of the target part; and rendering the skin of the target part of the virtual object based on the rendering parameters. According to the scheme provided by the embodiment of the invention, the chartlet in the virtual object does not need to be sampled for multiple times, the calculation amount in the rendering process is reduced, the requirement for the performance of equipment is reduced, and the application range is widened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a virtual object rendering method, apparatus, computer equipment and storage medium. Background Art

[0002] With the development of computer technology, games are becoming more and more popular among users. In order to improve the picture quality of games, when rendering virtual objects in games, the facial area or other skin areas of the virtual objects are emphasized to improve the display effect of the virtual objects. However, the current rendering method is to render by sampling the textures in the virtual objects. This rendering method has a large amount of calculation, high requirements on the performance of the device, and a narrow scope of application. Summary of the invention

[0003] The embodiments of the present application provide a virtual object rendering method, apparatus, computer equipment and storage medium, which can reduce the performance requirements of the equipment and improve the scope of application. The technical solution is as follows:

[0004] In one aspect, a virtual object rendering method is provided, the method comprising:

[0005] Acquire illumination parameters of the virtual object, where the illumination parameters are used to represent the skin of a target part of the virtual object under illumination of light;

[0006] Based on the illumination parameters of the virtual object, a diffuse reflection parameter, a highlight reflection parameter and a shadow parameter of the target part are obtained, wherein the diffuse reflection parameter indicates the diffuse reflection condition of the target part, the highlight reflection parameter indicates the highlight reflection condition of the target part, and the shadow parameter indicates the color of the shadow area of ​​the target part;

[0007] The diffuse reflection parameter, the highlight reflection parameter and the shadow parameter are integrated to obtain the rendering parameter of the target part;

[0008] Based on the rendering parameters, the skin of the target part of the virtual object is rendered.

[0009] In another aspect, a virtual object rendering device is provided, the device comprising:

[0010] An acquisition module, used for acquiring illumination parameters of a virtual object, wherein the illumination parameters are used for representing the skin of a target part of the virtual object under illumination of light;

[0011] The acquisition module is further used to acquire diffuse reflection parameters, highlight reflection parameters and shadow parameters of the target part based on the illumination parameters of the virtual object, wherein the diffuse reflection parameters indicate the diffuse reflection conditions of the target part, the highlight reflection parameters indicate the highlight reflection conditions of the target part, and the shadow parameters indicate the color of the shadow area of ​​the target part;

[0012] A fusion module, used for fusing the diffuse reflection parameters, highlight reflection parameters and shadow parameters to obtain rendering parameters of the target part;

[0013] A rendering module is used to render the skin of the target part of the virtual object based on the rendering parameters.

[0014] In one possible implementation, the acquisition module is used to acquire the curvature of the target part based on the illumination parameters of the virtual object, and the curvature of the target part is used to adjust the color change transition of different positions in the target part; acquire the color of the target part from the attribute information of the virtual object; process the model structure of the virtual object to obtain a scattering distribution map of the target part, and the scattering distribution map indicates the diffuse reflection intensity of each position point in the target part; and fuse the color of the target part, the curvature of the target part and the scattering distribution map to obtain the diffuse reflection parameter.

[0015] In another possible implementation, the lighting parameters include the sub-surface color and blurred normal of the target part, the blurred normal being the normal of the target part; the acquisition module is used to adjust the saturation of the color of the target part; the adjusted color is merged with the sub-surface color to obtain a scatter value of the target part, the scatter value indicates the diffusion intensity of the target part to light; the blurred normal, the lighting direction parameter and the scatter value are merged to obtain the curvature of the target part, the lighting direction parameter indicates the irradiation direction of light in the virtual environment where the virtual object is located.

[0016] In another possible implementation, the highlight reflection parameters include normal distribution parameters, shadow shielding parameters and edge light parameters; the acquisition module is used to generate normal distribution parameters of the target part based on the roughness and tangent space normal in the illumination parameters, the roughness indicates the roughness of the skin of the target part, the tangent space normal is the normal of each position point in the target part, and the normal distribution parameter indicates the distribution of the normal of each position point in the target part; based on the tangent space normal, the illumination direction parameter and the line of sight direction parameter of the virtual camera in the virtual scene, the shadow shielding parameters of the target part are generated, the shadow shielding parameters indicate the distribution of the shadow area in the target part, and the illumination direction parameter indicates the direction of light irradiation in the virtual environment where the virtual object is located; based on the line of sight direction parameter, the edge light parameters of the target part are generated, and the edge light parameters indicate the distribution position of the edge light in the target part.

[0017] In another possible implementation, the illumination parameters include a first roughness, a second roughness, a roughness intensity corresponding to the first roughness, and a roughness intensity corresponding to the second roughness; the acquisition module is used to process the illumination direction parameter, the tangent space normal, and the first roughness to obtain a first distribution parameter; process the illumination direction parameter, the tangent space normal, and the second roughness to obtain a second distribution parameter; based on the roughness intensity corresponding to the first roughness and the roughness intensity corresponding to the second roughness, the first distribution parameter and the second distribution parameter are fused to obtain the normal distribution parameter of the target part.

[0018] In another possible implementation, the acquisition module is used to fuse the tangent space normal with the line of sight direction parameter to obtain a first parameter; fuse the tangent space normal with the lighting direction parameter to obtain a second parameter; process the first parameter, the second parameter and a reflection parameter of the line of sight direction parameter to obtain the shadow shading parameter, wherein the reflection parameter indicates the opposite direction of the line of sight direction.

[0019] In another possible implementation, the lighting parameters include shadow colors; the acquisition module is used to identify the model structure of the virtual object to obtain an occlusion parameter set of the target part, the occlusion parameter set includes hiding parameters of multiple position points in the target part, and the occlusion parameters indicate whether the position point is obscured; based on the shadow color contained in the lighting parameters, the hiding parameters of the obscured position points in the occlusion parameter set are updated to obtain the shadow parameters of the target part.

[0020] In another possible implementation, the fusion module is used to fuse the diffuse reflection parameters with the shadow parameters to obtain first fusion parameters; fuse the highlight reflection parameters with the shadow parameters to obtain second fusion parameters; and fuse the first fusion parameters with the second fusion parameters to obtain the rendering parameters.

[0021] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the virtual object rendering method as described in the above aspects.

[0022] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed by the virtual object rendering method as described in the above aspects.

[0023] On the other hand, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the operations performed by the virtual object rendering method as described in the above aspects are implemented.

[0024] In the solution provided in the embodiment of the present application, based on the illumination parameters of the skin of the target part of the virtual object, the rendering parameters of the target part are obtained by adopting diffuse reflection, highlight reflection and determining the color of the shadow area, and the skin of the target part is rendered based on the rendering parameters, so that the rendered skin of the target part is more consistent with the illumination display in a real situation, thereby improving the display effect of the target part. This rendering method does not require multiple sampling of the texture in the virtual object, reduces the amount of calculation in the rendering process, thereby reducing the performance requirements of the device and improving the scope of application. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 It is a structural diagram of an implementation environment provided by an embodiment of the present application;

[0027] Figure 2 is a flow chart of a virtual object rendering method provided in an embodiment of the present application;

[0028] Figure 3is a flowchart of another virtual object rendering method provided by an embodiment of the present application;

[0029] Figure 4 is a schematic diagram of the distribution of a red contour line, a green contour line, and a blue contour line provided in an embodiment of the present application;

[0030] Figure 5 is a schematic diagram of a scattering distribution diagram provided in an embodiment of the present application;

[0031] Figure 6 is a schematic diagram of a high light reflection effect provided by an embodiment of the present application;

[0032] Figure 7 is a schematic diagram of a target part of a virtual object provided in an embodiment of the present application;

[0033] Figure 8 is a schematic diagram of another target part of a virtual object provided in an embodiment of the present application;

[0034] Fig. 9 is a schematic diagram of another target part of a virtual object provided in an embodiment of the present application;

[0035] Fig.10 is a flow chart of configuring lighting parameters of a virtual object provided by an embodiment of the present application;

[0036] Fig.11 is a schematic diagram of a tool selection interface provided in an embodiment of the present application;

[0037] Fig.12 is a schematic diagram of another target part of a virtual object provided in an embodiment of the present application;

[0038] Fig.13 It is a schematic diagram of the use of a lighting parameter provided in an embodiment of the present application;

[0039] Fig.14 is a structural schematic diagram of a virtual object rendering device provided in an embodiment of the present application;

[0040] Fig.15 is a schematic diagram of the structure of a terminal provided in an embodiment of the present application;

[0041] Fig.16 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0043] The terms "first", "second", "third", "fourth", "fifth", "sixth", etc. used in this application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, a first roughness may be referred to as a second roughness, and similarly, a second roughness may be referred to as a first roughness without departing from the scope of this application.

[0044] The terms "at least one", "a plurality", "each", and "any" used in this application include one, two, or more than two, and a plurality includes two or more than two. Each refers to each of the corresponding plurality, and any refers to any one of the plurality. For example, the plurality of position points include three position points, and each refers to each of the three position points. Any refers to any one of the three position points, which can be the first position point, or the second position point, or the third position point.

[0045] It should be noted that the information (including but not limited to lighting parameters, attribute information, etc.) and data (including but not limited to model structure, etc.) involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions. For example, the lighting parameters and attribute information involved in this application are obtained with full authorization.

[0046] The virtual object rendering method provided in the embodiment of the present application is executed by a computer device, and optionally, the computer device is a terminal or a server. Optionally, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, an intelligent voice interaction device, a smart home appliance, and a car terminal, etc., but is not limited to this.

[0047] In some embodiments, the computer program involved in the embodiments of the present application may be deployed and executed on one computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected by a communication network. Multiple computer devices distributed at multiple locations and interconnected by a communication network can constitute a blockchain system.

[0048] In some embodiments, the computer device is provided as a terminal. Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Figure 1 , the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network.

[0049] The server 102 is used to provide the terminal 101 with data of the virtual scene. After the terminal 101 obtains the data of the virtual scene from the server 102, it renders the virtual scene based on the obtained data. In addition, when rendering the virtual object in the virtual scene, the skin of the target part of the virtual object is rendered based on the lighting parameters obtained from the server 102 to improve the display effect of the target part of the virtual object.

[0050] In a possible implementation, the terminal 101 installs a target application provided by the server 102, and the terminal 101 can implement functions such as games and message interaction through the target application. Optionally, the target application is a target application in the operating system of the terminal 101, or a target application provided by a third party. For example, the target application is a game application, and the game application has a game function. Of course, the game application can also have other functions, such as a shopping function, a navigation function, etc.

[0051] Terminal 101 is used to log in to the target application based on the user identification, obtain the lighting parameters of the virtual object in the virtual scene from the server 102 through the target application, and render the skin of the target part of the virtual object based on the lighting parameters, so that terminal 101 can display the display effect of the virtual object in the virtual scene through the target application.

[0052] Figure 2 is a flowchart of a virtual object rendering method provided in an embodiment of the present application, the method is executed by a computer device, such as Figure 2 As shown, the method includes:

[0053] 201. A computer device obtains lighting parameters of a virtual object, where the lighting parameters are used to represent the skin of a target part of the virtual object under light irradiation.

[0054] In the embodiment of the present application, each virtual object corresponds to a lighting parameter, and different virtual objects may have different lighting parameters. The lighting parameters of the virtual object are the parameters required to render the skin of the target part of the virtual object under the condition of light irradiation. Different lighting parameters will affect the display effect of the skin of the target part under the condition of light irradiation.

[0055] The virtual object is any object in the virtual scene, and the virtual object can be represented in any form, for example, the virtual object is a virtual person or a virtual animal. The target part is any part of the virtual object, for example, the target part is the face of the virtual object, or other parts of the virtual object that include skin.

[0056] 202. The computer device obtains diffuse reflection parameters, highlight reflection parameters and shadow parameters of the target part based on the lighting parameters of the virtual object, wherein the diffuse reflection parameters indicate the diffuse reflection conditions of the target part, the highlight reflection parameters indicate the highlight reflection conditions of the target part, and the shadow parameters indicate the color of the shadow area of ​​the target part.

[0057] In an embodiment of the present application, when light is irradiated in a virtual scene, the light will cause highlight reflection, diffuse reflection or cause a certain position to present a shadow on the skin of the target part of the virtual object, thereby causing each position point in the target part to present a different display effect. For example, the first position point in the target part is located in the shadow area and presents a dark display effect, the second position point presents a highlight effect due to the highlight reflection effect, and the third position point presents a red light effect due to the diffuse reflection effect, wherein the first position point, the second position point and the third position point are any position points in the target part. Since the illumination parameters can represent the skin of the target part of the virtual object under the illumination of light, therefore, in combination with the illumination parameters of the virtual object, the diffuse reflection condition, highlight reflection condition and color of the shadow area of ​​the skin of the target part of the virtual object under the illumination of light in the virtual scene can be determined, so that the target part of the virtual object can be rendered according to the diffuse reflection condition, highlight reflection condition and color of the shadow area of ​​the target part in the subsequent rendering according to the diffuse reflection condition, highlight reflection condition and color of the shadow area of ​​the target part, so as to simulate the diffuse reflection, highlight reflection and shadow area display effect of the target part of the virtual object in the virtual scene under the illumination of light in the virtual scene.

[0058] 203. The computer device fuses the diffuse reflection parameters, the highlight reflection parameters and the shadow parameters to obtain the rendering parameters of the target part.

[0059] In an embodiment of the present application, the diffuse reflection parameters, highlight reflection parameters and shadow parameters respectively describe the different effects of the skin of the target part of the virtual object under the illumination of light in the virtual scene at different angles. The diffuse reflection parameters, highlight reflection parameters and shadow parameters are fused so as to superimpose the three different display effects, so that the rendering parameters of the target part can reflect the superposition effect of the three different display effects, so as to facilitate the subsequent rendering effect of the skin of the target part.

[0060] 204. The computer device renders the skin of the target part of the virtual object based on the rendering parameters.

[0061] In an embodiment of the present application, the skin of a target part of a virtual object is rendered based on rendering parameters, so that the rendered target part presents a superposition effect of diffuse reflection effect, highlight reflection effect and shadow effect, so that the skin of the target part of the displayed virtual object is more realistic, thereby ensuring the display effect of the target part.

[0062] In the solution provided in the embodiment of the present application, based on the illumination parameters of the skin of the target part of the virtual object, the rendering parameters of the target part are obtained by adopting diffuse reflection, highlight reflection and determining the color of the shadow area, and the skin of the target part is rendered based on the rendering parameters, so that the rendered skin of the target part is more consistent with the illumination display in a real situation, thereby improving the display effect of the target part. This rendering method does not require multiple sampling of the texture in the virtual object, reduces the amount of calculation in the rendering process, thereby reducing the performance requirements of the device and improving the scope of application.

[0063] In the above Figure 2 On the basis of the illustrated embodiment, the embodiment of the present application can also determine the rendering parameters of the target part based on the model structure of the virtual object and the parameters of the environment in which the virtual object is located in the virtual scene. The specific process is detailed in the following embodiment.

[0064] Figure 3 is a flowchart of a virtual object rendering method provided in an embodiment of the present application. The method is executed by a computer device. For example, the computer device is provided as a terminal. Figure 3 As shown, the method includes:

[0065] 301. The terminal obtains illumination parameters of the virtual object, where the illumination parameters are used to represent the skin of a target part of the virtual object under illumination.

[0066] In a possible implementation, the lighting parameters include subsurface color, roughness, shadow color, tangent space normal, blur normal, etc.

[0067] Among them, the subsurface color is used to describe the subsurface of the skin of the target part of the virtual object to simulate the color presented under the skin after the light passes through the skin surface. For example, after the light passes through the skin of the virtual character, a red subsurface color will appear on the skin of the virtual character to simulate the blood flow under the skin of the virtual character. The roughness indicates the roughness of the skin of the target part of the virtual object. For example, the virtual object is a virtual character, and the target part is the face of the virtual character. When the virtual character is an old man, the roughness of the face of the virtual character is large, and when the virtual character is a child, the roughness of the face of the virtual character is small. The shadow color indicates the color of the skin in the shadow area of ​​the target part of the virtual object. The tangent space normal (tangent normal) is the normal of each position point in the target part, and the blur normal (blur normal) is the normal of the target part. In the embodiment of the present application, the fuzzy normal and the tangent space normal are normals determined for different targets. The fuzzy normal is for the entire target part to indicate the normal of the entire target part; while the tangent space normal is for each position point in the target part to indicate the normal of each position point in the target part. The fuzzy normal is equivalent to the brief information of the normal of the target part, while the tangent space normal is equivalent to the detailed information of the normal of the target part. The tangent space normal and the fuzzy normal can be expressed in any form. For example, the tangent space normal and the fuzzy normal are both expressed in the form of vectors.

[0068] Optionally, the roughness in the illumination parameter includes a first roughness and a second roughness, and the illumination parameter further includes a roughness intensity corresponding to the first roughness and a roughness intensity corresponding to the second roughness.

[0069] In an embodiment of the present application, the roughness of the skin of the target part of the virtual object affects the effect of the target part under the action of highlight reflection. The greater the roughness, the finer the skin of the target part appears under the action of highlight reflection, and the more obvious the highlight reflection effect is; the smaller the roughness, the rougher the skin of the target part appears under the action of highlight reflection, and the less obvious the highlight reflection effect is. In order to enhance the highlight reflection effect of the target part of the virtual object, two different roughnesses are set for the virtual object, and a roughness intensity is set for each roughness, which is equivalent to the weight of the corresponding roughness, so that the highlight reflection effects under the first roughness and the second roughness can be merged according to the roughness intensity corresponding to the first roughness and the second roughness. Among them, the first roughness is greater than the second roughness, or the second roughness is greater than the first roughness.

[0070] In one possible implementation, step 301 includes: the terminal sends a parameter acquisition request to the server based on the object identifier of the virtual object currently displayed in the virtual scene, and the parameter acquisition request carries the object identifier. The server queries the lighting parameters corresponding to the object identifier based on the parameter acquisition request, sends the lighting parameters corresponding to the object identifier to the terminal, and the terminal receives the lighting parameters corresponding to the object identifier.

[0071] In an embodiment of the present application, the object identifier indicates the virtual object, and the object identifier can be represented in any form. The server stores lighting parameters corresponding to the object identifier, and different lighting parameters corresponding to different object identifiers may be different. The terminal obtains the lighting parameters of the virtual object from the server based on the object identifier of the virtual object currently displayed in the virtual scene, so as to render the virtual object according to the lighting parameters later.

[0072] 302. The terminal obtains the curvature of the target part based on the illumination parameters of the virtual object, and the curvature of the target part is used to adjust the color change transition at different positions in the target part.

[0073] In an embodiment of the present application, when light in a virtual scene illuminates a target part, different positions in the target part may present different colors. For example, when light in a virtual scene illuminates a first position point of a target part, the first position point will be highlighted, and the greater the distance between a second position point and the first position point in the target area, the darker the color displayed by the second position point, that is, different positions in the target part may present different colors, wherein the first position point is any position point in the target part, and the second position point is a position point in the target part other than the first position point. By obtaining the curvature of the target part based on the lighting parameters of the virtual object, so that the color change transition of different positions in the target part can be adjusted based on the curvature, the color change of different positions in a certain part of a person in a real environment can be simulated, so that the color presented in the target part is more realistic.

[0074] In one possible implementation, the lighting parameters include the subsurface color and the blurred normal of the target part, and the blurred normal is the normal of the target part; then step 302 includes: adjusting the saturation of the color of the target part; fusing the adjusted color with the subsurface color to obtain the scatter value of the target part, and the scatter value indicates the diffusion intensity of the target part to light; fusing the blurred normal, the lighting direction parameter and the scatter value to obtain the curvature of the target part, and the lighting direction parameter indicates the direction of light irradiation in the virtual environment where the virtual object is located.

[0075] The color of the target part is the color of the skin of the target part of the virtual object, that is, the color set for the skin of the target part of the virtual object. The scatter value of the target part is the scatter value of the skin of the target part, and the curvature of the target part is the curvature of the skin of the target part. The illumination direction parameter is the parameter of the environment in which the virtual object is located in the virtual scene. The illumination direction parameter can be expressed in any form. Optionally, the illumination direction parameter is expressed in the form of a vector.

[0076] In the embodiment of the present application, the color saturation of the target part is adjusted to optimize the color of the target part and enhance the display effect of the color of the target part, and then the adjusted color is merged with the subsurface color to reflect the diffusion intensity of the target part to the light, that is, to reflect the diffusion intensity of the light at each position point of the target part. The fuzzy normal, illumination direction parameter and scatter value are merged to simulate the color change of each position point of the target part, and the transition between the bright area and the dark area in the target part can also be pointed out to ensure the accuracy of the curvature of the target part.

[0077] Optionally, the process of acquiring the illumination direction parameter includes: determining the illumination direction parameter based on the position of the virtual object in the virtual scene and the current time point.

[0078] In the embodiment of the present application, different illumination direction parameters correspond to different time points to simulate the effect of illumination direction changing over time in a real environment, and different illumination directions are obtained when the positions of virtual objects in the virtual scene are different. The illumination direction parameters are determined by the positions of virtual objects in the virtual scene and the current time point to ensure the accuracy of the determined illumination direction parameters.

[0079] Optionally, the curvature of the target site can be determined using the following relationship data:

[0080] Among them, it is used to represent the curvature of the target part, used to represent the blurred normal, used to represent the lighting direction parameter, used to represent the scattering value, and used to represent a Gaussian function for determining the subsurface scattering effect.

[0081] In the embodiment of the present application, the red contour line, the green contour line and the blue contour line generated by the Gaussian function can form a heat core effect. The distribution of the red contour line, the green contour line and the blue contour line is as follows: Figure 4 As shown, therefore, the Gaussian function is suitable for simulating the subsurface color. By using the Gaussian function, the subsurface scattering effect of the skin of the target part can be simulated to ensure the accuracy of the determined scattering effect.

[0082] 303. The terminal obtains the color of the target part from the attribute information of the virtual object.

[0083] In an embodiment of the present application, the attribute information of the virtual object is used to describe the virtual object. The attribute information includes the color of each part of the virtual object. Therefore, based on the attribute information, the color of the target part can be determined, that is, the skin color of the target part can be determined.

[0084] 304. The terminal processes the model structure of the virtual object to obtain a scattering distribution map of the target part, where the scattering distribution map indicates the diffuse reflection intensity of each position point in the target part.

[0085] The model structure of the virtual object is used to render the structure of the virtual object. For example, if the virtual object is a three-dimensional virtual object, the model structure is the three-dimensional model structure of the three-dimensional virtual object.

[0086] Since the model structure of the virtual object includes the structure of the target part of the virtual object, the model structure of the virtual object is processed so as to analyze the distribution of each position point in the target part based on the model structure of the target part of the virtual object, and then determine the diffuse reflection intensity of each position point in the target part.

[0087] In one possible implementation, step 304 includes: processing the target part in the model structure of the virtual object to obtain the thickness value of each position point in the target part, and processing the thickness value of each position point in the target part to obtain a scattering distribution map of the target part.

[0088] The thickness value indicates the thickness of the model structure at the position point in the target part. In the embodiment of the present application, the thickness value of the target part includes the thickness value of each point in the target part, and the scattering distribution value of each position point is obtained by processing the thickness value of each position point in the target part, and the scattering distribution values ​​of multiple position points in the target part constitute the scattering distribution map of the target part.

[0089] Optionally, a target part in the model structure of the virtual object is processed by a graphics rendering tool to obtain a scattering distribution map of the target part.

[0090] The image rendering tool is any tool with a graphics rendering function, for example, the image rendering tool is Houdini (a three-dimensional computer graphics tool). For example, by using Houdini, the contour and structure of the target part in the model structure of the virtual object are extracted, and the extracted model structure is fuzzy processed to obtain the scattering distribution map, which is as shown in FIG. Figure 5 As shown, in Figure 5In the face shown, the diffuse reflection intensity of the white position points is large, and the diffuse reflection intensity of the black position points is small. The scattering distribution map obtained by Houdini can ensure the light transmittance of the target part's skin when rendering the target part later, thereby improving the display effect of the target part.

[0091] 305. The terminal fuses the color of the target part, the curvature of the target part and the scattering distribution map to obtain the diffuse reflection parameters of the target part.

[0092] The diffuse reflection parameter indicates the diffuse reflection condition of the target part of the virtual object, that is, the diffuse reflection condition of each position point of the target part of the virtual object. The diffuse reflection parameter can be expressed in any form, and optionally, the diffuse reflection parameter is expressed in the form of a matrix, and the multiple values ​​contained in the matrix indicate the diffuse reflection condition of each position point of the target part of the virtual object.

[0093] In the embodiment of the present application, the color of the target part, the curvature of the target part and the scattering distribution map can all reflect the diffuse reflection condition of the target part. The color of the target part, the curvature of the target part and the scattering distribution map are fused so that the fused diffuse reflection parameters can accurately indicate the diffuse reflection condition of the target part, thereby ensuring the accuracy of the obtained diffuse reflection parameters.

[0094] In a possible implementation, the diffuse reflection parameters of the target part can be determined using the following relationship data:

[0095] Among them, the diffuse reflection parameter used to represent the target part is used to represent the basic color of the virtual object, including the color of the target part, and optionally, also includes the metal parameter of the target part of the virtual object, which indicates whether the target part is metal; used to represent the curvature of the target part; used to represent the scattering distribution map of the target part.

[0096] 306. The terminal generates a normal distribution parameter of the target part based on the roughness and tangent space normal in the illumination parameters, wherein the roughness indicates the roughness of the target part, the tangent space normal is the normal of each position point in the target part, and the normal distribution parameter indicates the distribution of the normal of each position point in the target part.

[0097] In an embodiment of the present application, the roughness of the target part will affect the direction of the normal of the target part. The normal in the tangent space is the normal of each position point in the target part. Based on the roughness in the illumination parameters and the tangent space normal, it is possible to determine how the normals of each position point in the target part are specifically distributed under the influence of the roughness of the skin of the target part, that is, to determine the distribution of the normals of each position point in the target part.

[0098] In one possible implementation, the illumination parameters include a first roughness, a second roughness, a roughness intensity corresponding to the first roughness, and a roughness intensity corresponding to the second roughness; the step 306 includes: processing the illumination direction parameter, the tangent space normal, and the first roughness to obtain a first distribution parameter; processing the illumination direction parameter, the tangent space normal, and the second roughness to obtain a second distribution parameter; based on the roughness intensity corresponding to the first roughness and the roughness intensity corresponding to the second roughness, fusing the first distribution parameter and the second distribution parameter to obtain the normal distribution parameter of the target part.

[0099] In the embodiment of the present application, the first roughness is different from the second roughness. The first distribution parameter indicates the normal distribution of each position point in the target part when the roughness of the target part is the first roughness; the second distribution parameter indicates the normal distribution of each position point in the target part when the roughness of the target part is the second roughness. Since the roughness of the skin of the target part of the virtual object affects the effect of the target part under the action of high light reflection, the normal distribution of the target part of the virtual object under the two roughness conditions is determined respectively, and the roughness intensity is used as the weight of the roughness. According to the roughness intensity corresponding to the first roughness and the second roughness, the first distribution parameter and the second distribution parameter are fused to make the obtained normal distribution parameter more realistic, so as to ensure the rendering effect of the subsequent target part.

[0100] like Figure 6 As shown, taking the face as an example when the first roughness is less than the second roughness and the target part of the virtual object is the face, when the roughness is the first roughness, the skin of the face is more delicate and the face presents a more uniform highlight reflection effect; when the roughness is the second roughness, the skin of the face is rougher and local areas of the face will present bright spots of highlight reflection. Therefore, the first distribution parameter and the second distribution parameter are fused as described above to make the highlight reflection effect of the face more realistic and improve the display effect of the target part.

[0101] In an embodiment of the present application, the lighting parameters include a first roughness and a second roughness of the target part, and the first roughness and the second roughness are different, so that the developer can adjust the rendering effect of the target part through the two roughnesses, which is more convenient for flexible control and improves the control convenience.

[0102] Optionally, the following relationship data can be used to determine the normal distribution parameters of the target part:

[0103] Among them, is used to represent the first roughness, is used to represent the tangent space normal, is used for the half-angle vector, the half-angle vector is the sum of the tangent space normal and the illumination direction parameter, is used to represent the dot product of the tangent space normal and the half-angle vector, is used to represent a function for determining the normal distribution parameters; is used to represent the roughness intensity corresponding to the first roughness, is used to represent the second roughness, and is used to represent the roughness intensity corresponding to the second roughness.

[0104] 307. The terminal generates a shadow shielding parameter of the target part based on the tangent space normal, the illumination direction parameter and the sight direction parameter of the virtual camera in the virtual scene. The shadow shielding parameter indicates the distribution of the shadow area in the target part, and the illumination direction parameter indicates the light irradiation direction in the virtual environment where the virtual object is located.

[0105] The sight line direction parameter of the virtual camera in the virtual scene indicates the shooting angle of the virtual scene, which is equivalent to the viewing angle of the target part of the virtual object photographed by the virtual camera.

[0106] In the embodiment of the present application, the tangent space normal and lighting direction parameters of the target part will affect the skin reflection effect on the skin of the target part, and different shooting angles will result in different display effects, so as to simulate the different reflection effects seen by people at different angles. Therefore, based on the tangent space normal, lighting direction parameters and the line of sight direction parameters of the virtual camera in the virtual scene, the distribution of the shadow area in the target part is determined, that is, the shadow shielding parameters of the target part are obtained.

[0107] Optionally, the shadow masking parameter can be represented in the form of a matrix, and the matrix includes multiple values ​​indicating that each position point in the target part belongs to the shadow area.

[0108] In one possible implementation, step 307 includes: fusing the tangent space normal with the sight direction parameter to obtain a first parameter; fusing the tangent space normal with the illumination direction parameter to obtain a second parameter; processing the reflection parameter of the first parameter, the second parameter and the sight direction parameter to obtain a shadow shading parameter, wherein the reflection parameter indicates the opposite direction of the sight direction.

[0109] In an embodiment of the present application, the normal of the skin of the target part of the virtual object, the illumination direction of the light illuminating the virtual object, and the viewing direction of the virtual object will all affect the distribution of the shadow area of ​​the target part of the virtual object. Therefore, the tangent space normal is fused with the line of sight direction parameter and the illumination direction parameter respectively to determine the display effect and illumination effect of the target part under the influence of the normal of the skin of the target part of the virtual object, and then the two effects are fused to obtain the shadow area of ​​the target part, thereby ensuring the accuracy of the obtained shadow area, that is, ensuring the accuracy of the shadow shielding parameters.

[0110] Optionally, the shadowing parameters of the target part can be determined by taking the following relationship:

[0111] Among them, it is used to represent the shadow shielding parameter of the target part, to represent the tangent space normal, to represent the sight direction parameter, to represent the reflection parameter of the sight direction parameter, to represent the lighting direction parameter, to represent the dot product of the tangent space normal and the sight direction parameter, to represent the dot product of the tangent space normal and the lighting direction parameter, and to represent a reflection function.

[0112] 308. The terminal generates an edge light parameter of the target part based on the line of sight direction parameter, where the edge light parameter indicates a distribution position of edge light in the target part.

[0113] In the embodiment of the present application, the sight direction parameter indicates the shooting direction of the virtual camera in the virtual scene. Based on the shooting direction, it is possible to determine which position points in the target part of the virtual object can be photographed and which position points cannot be photographed, and then determine the boundary position between the area that can be photographed and the area that cannot be photographed. The boundary position between the area that can be photographed and the area that cannot be photographed will present an edge light effect, and the distribution position of the edge light in the target part is determined. Optionally, the edge light parameter is a Fresnel parameter.

[0114] In a possible implementation, the following relationship data can be used to determine the edge light parameters of the target part:

[0115] Among them, is used to represent the edge light parameter of the target part, is used to represent the reflection adjustment parameter, is a constant, is used to represent the sight direction parameter, is used for the half-angle vector, is the sum of the tangent space normal and the illumination direction parameter, is used to represent the dot product of the sight direction parameter and the half-angle vector, and is used to represent a reflection function.

[0116] In an embodiment of the present application, the highlight reflection parameters include normal distribution parameters, shadow shading parameters and edge light parameters. The highlight reflection parameters are determined from multiple angles such as normal distribution, shadow distribution and edge light distribution based on the lighting parameters of the virtual object and in combination with the parameters of the environment in which the virtual object is located in the virtual scene, thereby enriching the information contained in the highlight reflection parameters to ensure the accuracy of the highlight reflection parameters.

[0117] It should be noted that the embodiment of the present application is described by taking the highlight reflection parameters including normal distribution parameters, shadow shielding parameters and edge light parameters as an example. In another embodiment, there is no need to execute the above steps 306-308, but other methods are adopted to obtain the highlight reflection parameters of the target part based on the lighting parameters.

[0118] 309. The terminal identifies the model structure of the virtual object and obtains an occlusion parameter set of the target part, where the occlusion parameter set includes hiding parameters of multiple position points in the target part, and the occlusion parameters indicate whether the position point is occluded.

[0119] In the embodiment of the present application, the model structure of the virtual object is used to render the structure of the virtual object, which can reflect the image of the virtual object, and further reflect whether the target part of the virtual object is blocked by the model structure of other parts. Therefore, by identifying the model structure of the virtual object, an occlusion parameter set of the target part is obtained to determine whether each position point in the target part is blocked. For example, taking the face of the virtual object as the target part, by identifying the model structure of the virtual object, it is determined that the forehead area in the face of the virtual object is blocked by hair, while other areas are not blocked. In the obtained occlusion parameter set, only the occlusion parameters of the position points in the forehead area of ​​the target part indicate that they are blocked.

[0120] 310. The terminal updates the hiding parameters of the obscured position points in the occlusion parameter set based on the shadow color included in the illumination parameter to obtain the shadow parameters of the target part.

[0121] In an embodiment of the present application, the shadow color included in the illumination parameters is the color set for the obscured position points in the target part. Therefore, based on the shadow color, the occlusion parameters of the obscured position points in the occlusion parameter set are updated to ensure the accuracy of the shadow parameters of the target part, to lock the color of the shadow area, and to avoid the problem of the shadow area being too bright, so that when the target part is subsequently rendered according to the shadow parameters of the target part, the display effect of the target part can be guaranteed.

[0122] In a possible implementation, step 310 includes: updating the occlusion parameters of the occluded position points in the occlusion parameter set to the shadow colors included in the illumination parameters, and using the updated occlusion parameter set as the shadow parameters of the target part.

[0123] For example, the occlusion parameter set is represented in the form of a matrix, each value in the matrix is ​​the occlusion parameter of a position point, the occlusion parameter of the occluded position point in the matrix is ​​replaced with the value of the shadow color, and the updated matrix is ​​used as the shadow parameter of the target part.

[0124] It should be noted that the embodiment of the present application determines the diffuse reflection parameters, highlight reflection parameters and shadow parameters of the target part based on the multiple parameters included in the illumination parameters, while in another embodiment, there is no need to execute the above steps 302-310, but other methods are adopted to obtain the diffuse reflection parameters, highlight reflection parameters and shadow parameters of the target part based on the illumination parameters of the virtual object, the diffuse reflection parameters indicate the diffuse reflection situation of the target part, the highlight reflection parameters indicate the highlight reflection situation of the target part, and the shadow parameters indicate the color of the shadow area of ​​the target part.

[0125] 311. The terminal combines the diffuse reflection parameters, the highlight reflection parameters and the shadow parameters to obtain the rendering parameters of the target part.

[0126] In one possible implementation, step 311 includes: fusing diffuse reflection parameters with shadow parameters to obtain first fused parameters; fusing highlight reflection parameters with shadow parameters to obtain second fused parameters; and fusing the first fused parameters with the second fused parameters to obtain rendering parameters.

[0127] In an embodiment of the present application, the shadow parameters are fused with the diffuse reflection parameters and the highlight reflection parameters respectively to ensure the reflection effects under the diffuse reflection and the highlight reflection, and then the first fusion parameters are fused with the second fusion parameters to ensure the accuracy of the final rendering parameters to ensure the subsequent rendering effects.

[0128] 312. The terminal renders the skin of the target part of the virtual object based on the rendering parameters.

[0129] In one possible implementation, step 312 includes rendering the skin of the target part based on the rendering parameters and the color of the target part.

[0130] In an embodiment of the present application, the skin of the target part of the virtual object is rendered based on the rendering parameters and the color of the skin of the target part, so that the skin of the target part is not only presented in this color, but also can present reflection effects and shadow effects, so as to ensure that the skin of the target part is displayed more realistically, thereby improving the display effect of the skin of the target part, that is, improving the display effect of the virtual object.

[0131] In the solution provided in the embodiment of the present application, based on the illumination parameters of the skin of the target part of the virtual object, the rendering parameters of the target part are obtained by adopting diffuse reflection, highlight reflection and determining the color of the shadow area, and the skin of the target part is rendered based on the rendering parameters, so that the rendered skin of the target part is more consistent with the illumination display in a real situation, thereby improving the display effect of the target part. This rendering method does not require multiple sampling of the texture in the virtual object, reduces the amount of calculation in the rendering process, thereby reducing the performance requirements of the device and improving the scope of application.

[0132] In an embodiment of the present application, the tangent space normal indicates the normal of each position point in the target part, while the fuzzy normal is only used to indicate the normal of the target part. Compared with the fuzzy normal, the tangent space normal is more detailed. The highlight reflection parameters are determined by the tangent space normal, and the diffuse reflection parameters are determined by the fuzzy normal, so as to distinguish the diffuse reflection and highlight reflection acting on the target part, so as to subsequently render the target part based on the diffuse reflection parameters and the highlight reflection parameters to enhance the texture of the skin of the target part, thereby improving the display effect of the target part.

[0133] Based on the method of determining highlight reflection parameters provided in the embodiment of the present application, it is possible to ensure that the highlight reflection effect of the skin of the rendered target part remains consistent, thereby ensuring the display effect of the target part.

[0134] Based on the virtual object rendering solution provided in the embodiment of the present application, a single pass (rendering process) can be used to complete the calculation of rendering parameters, and there is only one drawcall (rendering batch). In the process of rendering the target object, there is no need to sample the texture on the virtual object, which occupies less memory and requires less shader calculation, thus reducing the performance requirements of the device, improving the scope of application, and supporting the terminal to execute the virtual object rendering solution.

[0135] In addition, the solution provided in the embodiment of the present application can support skin shadow color control and skin lighting projection performance, and limits the lighting angle calculation through an algorithm to avoid the effect of lighting ghost faces, so as to ensure the rendering effect.

[0136] Moreover, based on the virtual object rendering solution provided in the embodiment of the present application, the normal detail rendering problem of the mirror UV can also be fixed, without the need for computer shader calculations or post-processing calculations, thereby ensuring the rendering effect of the virtual object.

[0137] Based on the above Figures 2 to 3 In the embodiment shown, the present application embodiment also provides a schematic diagram of target parts of multiple virtual objects, such as Figures 7 to 9As shown, taking the target part as the face as an example, each virtual object face is rendered using the method provided in the embodiment of the present application. Figures 7 to 9 It can be seen that the skin of the virtual object's face is delicate and transparent, which ensures the display effect of the virtual object's face and can also ensure the local display effect of the virtual object's face.

[0138] It should be noted that the above Figures 2 to 3 The embodiment shown is based on the lighting parameters configured for the virtual object, and the virtual object is rendered by obtaining the lighting parameters of the virtual object. Figures 2 to 3 Based on the embodiment shown, the embodiment of the present application also provides a flowchart for configuring the lighting parameters of a virtual object, such as Fig.10 As shown, the method includes:

[0139] Step 1: Based on the macro naming rules and shading model id (number of lighting models) in the programming language, customize the subsurface skin lighting model (Surface shading model) and modify the programming language rendering pipeline code so that the skin rendering of the target part of the virtual object can be realized based on the subsurface skin lighting model.

[0140] In the application embodiment, the sub-surface skin illumination model can be any illumination model, for example, the sub-surface skin illumination model is a Preintegrated shading model. Fig.11 As shown, in the tool selection interface, select Preintegrated shading model.

[0141] In an embodiment of the present application, a sub-surface skin illumination model is defined through macro naming rules and restrictions on the number of illumination models, so that the sub-surface skin illumination model can be subsequently called to render the skin of a target part of a virtual object.

[0142] Step 2: In the base pass pixel rendering stage, customize the material data interface, which is used to store lighting parameters, and configure the initial lighting parameters for each data interface.

[0143] In an embodiment of the present application, taking the example of the lighting parameters including sub-surface color, first roughness, second roughness, roughness intensity corresponding to the first roughness, roughness intensity corresponding to the second roughness, shadow color, tangent space normal, and blurred normal, the defined material data interface includes an interface for each parameter in the lighting parameters.

[0144] Step 3: In the lighting calculation stage, declare the defined material data interface so that the material data interface can be called later to obtain the lighting parameters in the material data interface; Figure 3 In the embodiment shown, a Gaussian function is used to determine diffuse reflection parameters; a scattering distribution diagram is determined; shadow parameters are determined; based on the first roughness, the second roughness, the roughness intensity corresponding to the first roughness, and the roughness intensity corresponding to the second roughness in the illumination parameters, normal distribution parameters in the highlight reflection parameters are determined; rendering parameters are determined, and based on the rendering parameters, the skin of the target part of the virtual object is rendered.

[0145] Step 4. When the rendering effect of the target part of the virtual object does not meet the display requirements, the developer can adjust the lighting parameters in the material data interface through the device, and render the skin of the target part according to the above step 3 based on the adjusted lighting parameters until the lighting parameters that meet the display requirements are obtained and stored in the material data interface.

[0146] In the embodiment of the present application, according to the above steps 1 to 4, the lighting parameters can be configured for each virtual object, so that the above Figures 2 to 3 In the illustrated embodiment, lighting parameters configured for a virtual object are obtained, and then the virtual object is rendered.

[0147] After step 4 above, the mirror UV (skin of the virtual object) can be processed to fix the calculation errors, and other display effects can be added to the virtual object, such as the effect of being attacked, the dominance effect, the dissolution effect, etc., to enhance the display effect of the virtual object. Fig.12 As shown, in Fig.12 Based on the middle left picture, adding a highlight display effect can further enhance the display effect of the virtual object.

[0148] In the embodiments of the present application, Fig.13 As shown, the lighting parameters can be used as data stored in the material data interface, and can also be used as material data for rendering the target part of the virtual object.

[0149] Fig.14 is a structural diagram of a virtual object rendering device provided in an embodiment of the present application, such as Fig.14 As shown, the device comprises:

[0150] An acquisition module 1401 is used to acquire illumination parameters of a virtual object, where the illumination parameters are used to represent the skin of a target part of the virtual object under illumination;

[0151] The acquisition module 1401 is further used to acquire diffuse reflection parameters, highlight reflection parameters and shadow parameters of the target part based on the illumination parameters of the virtual object, wherein the diffuse reflection parameters indicate the diffuse reflection conditions of the target part, the highlight reflection parameters indicate the highlight reflection conditions of the target part, and the shadow parameters indicate the color of the shadow area of ​​the target part;

[0152] A fusion module 1402 is used to fuse diffuse reflection parameters, highlight reflection parameters and shadow parameters to obtain rendering parameters of the target part;

[0153] The rendering module 1403 is used to render the skin of the target part of the virtual object based on the rendering parameters.

[0154] In one possible implementation, the acquisition module 1401 is used to obtain the curvature of the target part based on the lighting parameters of the virtual object, and the curvature of the target part is used to adjust the color change transition at different positions in the target part; the color of the target part is obtained from the attribute information of the virtual object; the model structure of the virtual object is processed to obtain a scattering distribution map of the target part, and the scattering distribution map indicates the diffuse reflection intensity of each position point in the target part; the color of the target part, the curvature of the target part and the scattering distribution map are merged to obtain the diffuse reflection parameters.

[0155] In another possible implementation, the lighting parameters include the sub-surface color and blurred normal of the target part, where the blurred normal is the normal of the target part; an acquisition module 1401 is used to adjust the saturation of the color of the target part; the adjusted color is merged with the sub-surface color to obtain a scatter value of the target part, where the scatter value indicates the diffusion intensity of light at the target part; the blurred normal, the lighting direction parameter and the scatter value are merged to obtain the curvature of the target part, where the lighting direction parameter indicates the direction of light in the virtual environment where the virtual object is located.

[0156] In another possible implementation, the highlight reflection parameters include normal distribution parameters, shadow shielding parameters and edge light parameters; an acquisition module 1401 is used to generate normal distribution parameters of the target part based on the roughness and tangent space normal in the illumination parameters, the roughness indicates the roughness of the skin of the target part, the tangent space normal is the normal of each position point in the target part, and the normal distribution parameter indicates the distribution of the normal of each position point in the target part; based on the tangent space normal, the illumination direction parameter and the line of sight direction parameter of the virtual camera in the virtual scene, the shadow shielding parameters of the target part are generated, the shadow shielding parameters indicate the distribution of the shadow area in the target part, and the illumination direction parameter indicates the direction of light in the virtual environment where the virtual object is located; based on the line of sight direction parameter, the edge light parameters of the target part are generated, and the edge light parameters indicate the distribution position of the edge light in the target part.

[0157] In another possible implementation, the illumination parameters include a first roughness, a second roughness, a roughness intensity corresponding to the first roughness, and a roughness intensity corresponding to the second roughness; an acquisition module 1401 is used to process the illumination direction parameter, the tangent space normal, and the first roughness to obtain a first distribution parameter; the illumination direction parameter, the tangent space normal, and the second roughness are processed to obtain a second distribution parameter; based on the roughness intensity corresponding to the first roughness and the roughness intensity corresponding to the second roughness, the first distribution parameter and the second distribution parameter are fused to obtain the normal distribution parameter of the target part.

[0158] In another possible implementation, the acquisition module 1401 is used to fuse the tangent space normal with the line of sight direction parameter to obtain a first parameter; fuse the tangent space normal with the illumination direction parameter to obtain a second parameter; process the reflection parameter of the first parameter, the second parameter and the line of sight direction parameter to obtain a shadow shading parameter, and the reflection parameter indicates the opposite direction of the line of sight direction.

[0159] In another possible implementation, the lighting parameters include shadow colors; an acquisition module 1401 is used to identify the model structure of the virtual object and obtain an occlusion parameter set of the target part, the occlusion parameter set includes hiding parameters of multiple position points in the target part, and the occlusion parameters indicate whether the position point is occluded; based on the shadow color included in the lighting parameters, the hiding parameters of the occluded position points in the occlusion parameter set are updated to obtain the shadow parameters of the target part.

[0160] In another possible implementation, the fusion module 1402 is used to fuse the diffuse reflection parameter with the shadow parameter to obtain the first fusion parameter; fuse the highlight reflection parameter with the shadow parameter to obtain the second fusion parameter; and fuse the first fusion parameter with the second fusion parameter to obtain the rendering parameter.

[0161] In another possible implementation, the rendering module 1403 is used to render the skin of the target part based on the rendering parameters and the color configured for the target part.

[0162] It should be noted that the virtual object rendering device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the virtual object rendering device provided in the above embodiment and the virtual object rendering method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0163] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the virtual object rendering method of the above embodiment.

[0164] Optionally, the computer device is provided as a terminal. Fig.15 The structure block diagram of a terminal 1500 provided by an exemplary embodiment of the present application is shown. The terminal 1500 includes: a processor 1501 and a memory 1502 .

[0165] The processor 1501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1501 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1501 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1501 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1501 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0166] The memory 1502 may include one or more computer-readable storage media, which may be non-transitory. The memory 1502 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1502 is used to store at least one computer program, which is executed by the processor 1501 to implement the virtual object rendering method provided in the method embodiment of the present application.

[0167] In some embodiments, the terminal 1500 may also optionally include: a peripheral device interface 1503 and at least one peripheral device. The processor 1501, the memory 1502 and the peripheral device interface 1503 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1503 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1504, a display screen 1505, a camera assembly 1506, an audio circuit 1507 and a power supply 1508.

[0168] The peripheral device interface 1503 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1501 and the memory 1502. In some embodiments, the processor 1501, the memory 1502, and the peripheral device interface 1503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1501, the memory 1502, and the peripheral device interface 1503 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0169] The radio frequency circuit 1504 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1504 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1504 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1504 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 1504 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1504 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0170] The display screen 1505 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1505 is a touch display screen, the display screen 1505 also has the ability to collect touch signals on the surface or above the surface of the display screen 1505. The touch signal can be input to the processor 1501 as a control signal for processing. At this time, the display screen 1505 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 1505 can be one, set on the front panel of the terminal 1500; in other embodiments, the display screen 1505 can be at least two, respectively set on different surfaces of the terminal 1500 or in a folding design; in other embodiments, the display screen 1505 can be a flexible display screen, set on a curved surface or a folding surface of the terminal 1500. Even, the display screen 1505 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1505 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0171] The camera assembly 1506 is used to capture images or videos. Optionally, the camera assembly 1506 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1506 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. The dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0172] The audio circuit 1507 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1501 for processing, or input them into the radio frequency circuit 1504 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 1500. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 1501 or the radio frequency circuit 1504 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 1507 may also include a headphone jack.

[0173] The power supply 1508 is used to power various components in the terminal 1500. The power supply 1508 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1508 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0174] Those skilled in the art will understand that Fig.15 The structure shown in the figure does not constitute a limitation on the terminal 1500, and the terminal 1500 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.

[0175] Optionally, the computer device is provided as a server. Fig.16 This is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1600 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1601 and one or more memories 1602, wherein at least one computer program is stored in the memory 1602, and at least one computer program is loaded and executed by the processor 1601 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.

[0176] An embodiment of the present application further provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed by the virtual object rendering method of the above embodiment.

[0177] An embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the operations performed by the virtual object rendering method in the above embodiment.

[0178] A person of ordinary skill in the art will appreciate that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk, or an optical disk, etc.

[0179] The above description is only an optional embodiment of the embodiments of the present application and is not intended to limit the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.

Claims

1. A virtual object rendering method, characterized in that: The method comprises: Acquire illumination parameters of the virtual object, where the illumination parameters are used to represent the skin of a target part of the virtual object under illumination of light; Based on the illumination parameters of the virtual object, a diffuse reflection parameter, a highlight reflection parameter and a shadow parameter of the target part are obtained, wherein the diffuse reflection parameter indicates the diffuse reflection condition of the target part, the highlight reflection parameter indicates the highlight reflection condition of the target part, and the shadow parameter indicates the color of the shadow area of ​​the target part; The diffuse reflection parameter, the highlight reflection parameter and the shadow parameter are integrated to obtain the rendering parameter of the target part; Based on the rendering parameters, the skin of the target part of the virtual object is rendered.

2. The method according to claim 1, characterized in that Acquiring diffuse reflection parameters of the target part based on the illumination parameters of the virtual object includes: Based on the illumination parameters of the virtual object, the curvature of the target part is obtained, and the curvature of the target part is used to adjust the color change transition of different positions in the target part; Acquire the color of the target part from the attribute information of the virtual object; Processing the model structure of the virtual object to obtain a scattering distribution map of the target part, wherein the scattering distribution map indicates the diffuse reflection intensity of each position point in the target part; The color of the target part, the curvature of the target part and the scattering distribution map are fused to obtain the diffuse reflection parameter.

3. The method according to claim 2, characterized in that The illumination parameters include the subsurface color and the fuzzy normal of the target part, and the fuzzy normal is the normal of the target part; and obtaining the curvature of the target part based on the illumination parameters of the virtual object includes: Adjusting the saturation of the color of the target part; The adjusted color is merged with the sub-surface color to obtain a scattering value of the target part, wherein the scattering value indicates the diffusion intensity of the target part to light; The fuzzy normal, the illumination direction parameter and the scatter value are fused to obtain the curvature of the target part, wherein the illumination direction parameter indicates the illumination direction of light in the virtual environment where the virtual object is located.

4. The method according to claim 1, characterized in that: The highlight reflection parameters include normal distribution parameters, shadow shielding parameters and edge light parameters; based on the illumination parameters of the virtual object, obtaining the highlight reflection parameters of the target part includes: Based on the roughness and tangent space normal in the illumination parameters, a normal distribution parameter of the target part is generated, wherein the roughness indicates the roughness of the target part, the tangent space normal is the normal of each position point in the target part, and the normal distribution parameter indicates the distribution of the normal of each position point in the target part; Generate a shadow shielding parameter of the target part based on the tangent space normal, the illumination direction parameter and the sight line direction parameter of the virtual camera in the virtual scene, wherein the shadow shielding parameter indicates the distribution of the shadow area in the target part, and the illumination direction parameter indicates the illumination direction of the light in the virtual environment where the virtual object is located; Based on the sight line direction parameter, an edge light parameter of the target part is generated, where the edge light parameter indicates a distribution position of edge light in the target part.

5. The method according to claim 4, characterized in that The illumination parameters include a first roughness, a second roughness, a roughness intensity corresponding to the first roughness, and a roughness intensity corresponding to the second roughness; the generating the normal distribution parameters of the target part based on the roughness and the tangent space normal in the illumination parameters includes: Processing the illumination direction parameter, the tangent space normal and the first roughness to obtain a first distribution parameter; Processing the illumination direction parameter, the tangent space normal and the second roughness to obtain a second distribution parameter; Based on the roughness intensity corresponding to the first roughness and the roughness intensity corresponding to the second roughness, the first distribution parameter and the second distribution parameter are fused to obtain the normal distribution parameter of the target part.

6. The method according to claim 4, characterized in that The generating of the shadow shielding parameter of the target part based on the tangent space normal, the illumination direction parameter and the sight direction parameter of the virtual camera in the virtual scene comprises: Merging the tangent space normal with the sight direction parameter to obtain a first parameter; Merging the tangent space normal with the illumination direction parameter to obtain a second parameter; The first parameter, the second parameter and a reflection parameter of the sight line direction parameter are processed to obtain the shadow shielding parameter, wherein the reflection parameter indicates a direction opposite to the sight line direction.

7. The method according to any one of claims 1 to 6, characterized in that: The illumination parameter includes a shadow color; and obtaining the shadow parameter of the target part based on the illumination parameter of the virtual object includes: Identifying the model structure of the virtual object to obtain an occlusion parameter set of the target part, wherein the occlusion parameter set includes occlusion parameters of a plurality of position points in the target part, and the occlusion parameters indicate whether the position point is occluded; Based on the shadow color included in the illumination parameter, the hiding parameters of the obscured position points in the occlusion parameter set are updated to obtain the shadow parameters of the target part.

8. The method according to any one of claims 1 to 6, characterized in that: The step of fusing the diffuse reflection parameter, the highlight reflection parameter and the shadow parameter to obtain the rendering parameter of the target part includes: Fusing the diffuse reflection parameter with the shadow parameter to obtain a first fused parameter; Fusing the highlight reflection parameter with the shadow parameter to obtain a second fusion parameter; The first fusion parameter and the second fusion parameter are fused to obtain the rendering parameter.

9. A virtual object rendering device, characterized in that: The device comprises: An acquisition module, used for acquiring illumination parameters of a virtual object, wherein the illumination parameters are used for representing the skin of a target part of the virtual object under illumination of light; The acquisition module is further used to acquire diffuse reflection parameters, highlight reflection parameters and shadow parameters of the target part based on the illumination parameters of the virtual object, wherein the diffuse reflection parameters indicate the diffuse reflection conditions of the target part, the highlight reflection parameters indicate the highlight reflection conditions of the target part, and the shadow parameters indicate the color of the shadow area of ​​the target part; A fusion module, used for fusing the diffuse reflection parameters, highlight reflection parameters and shadow parameters to obtain rendering parameters of the target part; A rendering module is used to render the skin of the target part of the virtual object based on the rendering parameters.

10. A computer device, characterized in that: The computer device includes a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the virtual object rendering method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: At least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the virtual object rendering method according to any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the operations performed by the virtual object rendering method according to any one of claims 1 to 8 are implemented.