Illumination rendering method and apparatus, and device, medium and computer program product

By determining multiple light paths for each pixel point in the virtual scene, and selecting the candidate path according to the contribution value of the light, combined with the light path of the neighboring pixel point, calculate the comprehensive light contribution value for light rendering Poor problems, especially when light conditions are difficult to improve the rendering effect.

WO2025016038A1PCT designated stage expired Publication Date: 2025-01-23TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/093754
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-18
Filing Date
2024-05-16
Publication Date
2025-01-23

AI Technical Summary

Technical Problem

When the number of sampled lighting paths is small, traditional lighting rendering methods lead to poor rendering quality, and when lighting conditions are difficult, it is difficult to achieve high-quality rendering effects.

Method used

By determining multiple lighting paths for each pixel in the virtual scene, and selecting candidate lighting paths based on their lighting contribution values, combining the lighting paths of neighboring pixels, selecting the target lighting path, calculating the comprehensive lighting contribution value, and performing lighting render.

Benefits of technology

In the case of less light path samples, the rendering quality is improved, especially when the light conditions are difficult, it can significantly improve the light rendering effect of the virtual scene.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024093754_23012025_PF_FP_ABST
    Figure CN2024093754_23012025_PF_FP_ABST
Patent Text Reader

Abstract

An illumination rendering method, which is executed by a computer device. The method comprises: for each pixel point in a virtual scene, determining a plurality of first illumination paths obtained by means of performing illumination path sampling on the pixel point, and according to the probabilities of the plurality of first illumination paths being respectively selected, selecting a first candidate illumination path from the plurality of first illumination paths, wherein the probabilities of the plurality of first illumination paths being respectively selected are respectively positively correlated with respective illumination contribution values of the plurality of first illumination paths (202); determining a neighborhood pixel point of the pixel point, determining a plurality of second illumination paths obtained by means of performing illumination path sampling on the neighborhood pixel point, and according to the probabilities of the plurality of second illumination paths being respectively selected, selecting a second candidate illumination path from the plurality of second illumination paths, wherein the probabilities of the plurality of second illumination paths being respectively selected are respectively positively correlated with respective illumination contribution values of the plurality of second illumination paths (204); selecting a target illumination path from the first candidate illumination path and the second candidate illumination path (206); determining related illumination paths of the pixel point, and with reference to the illumination contribution value of the target illumination path, determining illumination contributions provided by the related illumination paths to the pixel point, so as to obtain a comprehensive illumination contribution value of the pixel point, wherein the related illumination paths comprise the first illumination paths and the second illumination paths (208); and performing illumination rendering on each pixel point in the virtual scene by using the comprehensive illumination contribution value of each pixel point in the virtual scene (210).
Need to check novelty before this filing date? Find Prior Art

Description

Lighting rendering method, device, equipment, medium and computer program product

[0001] Related applications

[0002] This application claims priority to Chinese patent application number 2023108802692, filed on July 18, 2023, entitled “Lighting Rendering Method, Device, Equipment and Medium,” the entire text of which is hereby incorporated by reference. Technical Field

[0003] The present application relates to rendering technology, and in particular to a lighting rendering method, apparatus, device, medium, and computer program product. Background Art

[0004] There are many virtual light sources in the virtual scene. These virtual light sources can provide lighting contribution values ​​for each pixel in the virtual scene directly or indirectly. The light contribution values ​​are used to perform lighting rendering on the virtual scene to obtain a virtual scene with lighting effects. For example, in a game scene, if there is a virtual desk lamp in the virtual room, this virtual desk lamp can illuminate the entire virtual room when turned on. To perform lighting rendering on the virtual scene, it is necessary to first obtain the lighting contribution values ​​corresponding to each pixel in the virtual scene through lighting path sampling, and then perform lighting rendering on the virtual scene based on the lighting contribution values ​​corresponding to each pixel.

[0005] Traditionally, uniform sampling is used to sample paths at each pixel to obtain illumination paths. The illumination contributions from each sampled illumination path are then directly integrated to render the virtual scene. Because uniform sampling emits light in all directions of a pixel with equal probability, a large number of illumination paths must be sampled for each pixel to converge. Few sampled illumination paths can result in poor rendering quality.

[0006] Summary of the Invention

[0007] The present application provides a lighting rendering method, apparatus, device, medium and computer program product.

[0008] In a first aspect, the present application provides a lighting rendering method, performed by a computer device, the method comprising:

[0009] For each pixel in the virtual scene, determine a plurality of first illumination paths obtained by performing illumination path sampling on the pixel, and select a first candidate illumination path from the plurality of first illumination paths according to a probability of each of the plurality of first illumination paths being selected; the probability of each of the plurality of first illumination paths being selected being positively correlated with an illumination contribution value of each of the plurality of first illumination paths;

[0010] determining neighboring pixels of the pixel point, and determining a plurality of second illumination paths obtained by performing illumination path sampling on the neighboring pixel point, and selecting a second candidate illumination path from the plurality of second illumination paths according to a probability of each of the plurality of second illumination paths being selected; the probability of each of the plurality of second illumination paths being selected being positively correlated with an illumination contribution value of each of the plurality of second illumination paths;

[0011] Selecting a target lighting path from the first candidate lighting paths and the second candidate lighting paths;

[0012] Determining a relevant illumination path for the pixel, and referring to the illumination contribution value of the target illumination path, determining an illumination contribution provided by the relevant illumination path to the pixel, to obtain a comprehensive illumination contribution value for the pixel; the relevant illumination path includes the first illumination path and the second illumination path; and

[0013] Lighting rendering is performed on each pixel in the virtual scene using the comprehensive lighting contribution value of each pixel in the virtual scene.

[0014] In a second aspect, the present application provides a lighting rendering device, the device comprising:

[0015] a selection module for determining, for each pixel point in a virtual scene, a plurality of first illumination paths obtained by sampling the illumination paths of the pixel point, and selecting a first candidate illumination path from the plurality of first illumination paths according to the probability of each of the plurality of first illumination paths being selected; the probability of each of the plurality of first illumination paths being selected being positively correlated with the illumination contribution values ​​of each of the plurality of first illumination paths; determining neighboring pixels of the pixel point, and determining a plurality of second illumination paths obtained by sampling the illumination paths of the neighboring pixels, and selecting a second candidate illumination path from the plurality of second illumination paths according to the probability of each of the plurality of second illumination paths being selected; the probability of each of the plurality of second illumination paths being selected being positively correlated with the illumination contribution values ​​of each of the plurality of second illumination paths; and selecting a target illumination path from the first candidate illumination paths and the second candidate illumination paths; and

[0016] A rendering module is used to determine the relevant lighting path of the pixel point, refer to the lighting contribution value of the target lighting path, determine the lighting contribution provided by the relevant lighting path to the pixel point, and obtain the comprehensive lighting contribution value of the pixel point; the relevant lighting path includes the first lighting path and the second lighting path; and use the comprehensive lighting contribution value of each pixel point in the virtual scene to perform lighting rendering on each pixel point in the virtual scene.

[0017] In a third aspect, the present application provides a computer device including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the method embodiments of the present application are implemented.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the various method embodiments of the present application.

[0019] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps in the various method embodiments of the present application when the computer program is executed by a processor.

[0020] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.

[0022] FIG1 is a diagram illustrating an application environment of a lighting rendering method according to an embodiment;

[0023] FIG2 is a schematic diagram of a flow chart of a lighting rendering method according to an embodiment;

[0024] FIG3 is a schematic diagram of the data structure of a path reservoir in one embodiment;

[0025] FIG4 is a schematic diagram of a light path shared between pixels in one embodiment;

[0026] FIG5 is a schematic diagram of the rendering effect of time accumulation and spatial multiplexing of a path reservoir in one embodiment;

[0027] FIG6 is a schematic diagram of a parameter configuration interface in one embodiment;

[0028] FIG7 is a schematic diagram comparing the effects of a traditional lighting rendering method and the lighting rendering method of the present application in one embodiment;

[0029] FIG8 is a schematic diagram showing a comparison of rendering effects of a traditional lighting rendering method and a lighting rendering method of the present application under good lighting conditions in one embodiment;

[0030] FIG9 is a schematic diagram showing a comparison of rendering effects of a traditional lighting rendering method and a lighting rendering method of the present application under difficult lighting conditions in one embodiment;

[0031] FIG10 is a schematic flow chart of a lighting rendering method in another embodiment;

[0032] FIG11 is a structural block diagram of a lighting rendering device according to an embodiment;

[0033] FIG12 is a diagram showing the internal structure of a computer device according to one embodiment;

[0034] FIG13 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0036] The lighting rendering method provided in this application can be applied to the application environment shown in Figure 1. Terminal 102 communicates with server 104 via a network. A data storage system can be separately provided to store data that server 104 needs to process. The data storage system can be integrated with server 104 or placed in the cloud or on another server. Terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart car devices, etc. Portable wearable devices can include smart watches, smart bracelets, head-mounted devices, etc. Server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security, and other network security services, CDN, and basic cloud computing services such as big data and artificial intelligence platforms. Terminal 102 and server 104 can be connected directly or indirectly via wired or wireless communication, which is not limited in this application.

[0037] For each pixel in the virtual scene, terminal 102 can determine multiple first illumination paths obtained by sampling the illumination paths of the pixel, and select a first candidate illumination path from the multiple first illumination paths based on the probability of each of the multiple first illumination paths being selected; the probability of each of the multiple first illumination paths being selected is positively correlated with the illumination contribution values ​​of each of the multiple first illumination paths. Terminal 102 can determine neighboring pixels of the pixel, and determine multiple second illumination paths obtained by sampling the illumination paths of the neighboring pixels, and select a second candidate illumination path from the multiple second illumination paths based on the probability of each of the multiple second illumination paths being selected; the probability of each of the multiple second illumination paths being selected is positively correlated with the illumination contribution values ​​of each of the multiple second illumination paths. Based on the probability of each of the first candidate illumination path and the second candidate illumination path being selected, a target illumination path is selected from the first candidate illumination path and the second candidate illumination path. Determine the relevant lighting path of the pixel point, refer to the lighting contribution value of the target lighting path, determine the lighting contribution provided by the relevant lighting path to the pixel point, and obtain the comprehensive lighting contribution value of the pixel point; the relevant lighting path includes a first lighting path and a second lighting path; use the comprehensive lighting contribution value of each pixel point in the virtual scene to perform lighting rendering on each pixel point in the virtual scene.

[0038] It is understood that after obtaining the integrated illumination contribution value corresponding to a pixel, terminal 102 may perform illumination rendering on the pixel based on the integrated illumination contribution value. It is also understood that after obtaining the integrated illumination contribution value corresponding to a pixel, terminal 102 may send the integrated illumination contribution value corresponding to the pixel to server 104 for storage. This embodiment is not limited to this. It is understood that the application scenario in FIG1 is merely illustrative and is not limited thereto.

[0039] In one embodiment, as shown in FIG2 , a lighting rendering method is provided. The method can be applied to a computer device, which can be a terminal or a server. The method can be executed independently by the terminal or server itself, or through interaction between the terminal and the server. This embodiment uses the method applied to a computer device as an example to illustrate the method, including the following steps:

[0040] In step 202, for each pixel point in the virtual scene, multiple first illumination paths obtained by sampling the illumination paths of the pixel point are determined, and a first candidate illumination path is selected from the multiple first illumination paths according to the probability of each of the multiple first illumination paths being selected; the probability of each of the multiple first illumination paths being selected is positively correlated with the illumination contribution value of each of the multiple first illumination paths.

[0041] The first illumination path is the illumination path obtained by performing illumination path sampling on a pixel. Illumination path sampling refers to a technique for obtaining the path of light rays by monitoring light rays interacting with the surfaces of virtual objects in a virtual scene. The first candidate illumination path is the illumination path selected from multiple first illumination paths obtained by performing illumination path sampling on a pixel. The probability of a first illumination path being selected as the first candidate illumination path is positively correlated with the illumination contribution value of the first illumination path. It is understood that, for each first illumination path, the greater the illumination contribution of the first illumination path to the pixel, that is, the more important the first illumination path is to the pixel, the greater the probability of the first illumination path being selected as the first candidate illumination path, and vice versa. The illumination contribution value is the illumination data contributed by the illumination path to the pixel. It is understood that the illumination contribution value can be the color value of the pixel, such as the RGB color value (i.e., the color value composed of the three primary colors of red, green, and blue). For example, white is RGB(255, 255, 255).

[0042] In one embodiment, the virtual scene includes at least one virtual object, and each virtual object is composed of multiple pixels. For each pixel in the virtual scene, the computer device can use the pixel as the starting point for illumination path sampling, randomly select multiple directions to emit rays, and continuously bounce them in the virtual scene to obtain multiple first illumination paths for the pixel. After obtaining the multiple first illumination paths for the pixel, the computer device can select a first candidate illumination path for the pixel from the multiple first illumination paths for the pixel based on the illumination contribution value of each first illumination path. The probability of each of the multiple first illumination paths being selected is positively correlated with the illumination contribution value of each of the multiple first illumination paths.

[0043] In one embodiment, for each first illumination path of a pixel, the computer device may determine a path importance parameter of the first illumination path based on the illumination contribution value of the first illumination path. Furthermore, the computer device may obtain a random number selected for the first illumination path, and select a first candidate illumination path from the multiple first illumination paths of the pixel based on the random number selected for the first illumination path and the path importance parameter of each first illumination path. The path importance parameter is positively correlated with the illumination contribution value. Thus, by referring to the random number selected for the first illumination path, determining multiple first illumination paths obtained by illumination path sampling for the pixel, and selecting a first candidate illumination path from the multiple first illumination paths based on the probability of each of the multiple first illumination paths being selected, it is possible to ensure the diversity of the candidate illumination paths selected for each pixel in the virtual scene when illumination rendering is performed on the pixel, thereby further improving the rendering quality of the virtual scene.

[0044] In one embodiment, the larger the path importance parameter, the larger the range of values ​​it maps to. The computer device can obtain a random number selected for the first illumination path. If the random number selected for the first illumination path is cast within the range of values ​​mapped to the path importance parameter, the probability that the random number falls within a larger range of values ​​increases. It is understood that the computer device can select the first illumination path corresponding to the path importance parameter mapped to the range of values ​​within which the random number falls as the first candidate illumination path.

[0045] In one embodiment, for each first illumination path of a pixel point, the computer device may convert the color intensity value in the illumination contribution value of the first illumination path into the color brightness value corresponding to the first illumination path. Furthermore, the computer device may determine the path importance parameter of the first illumination path based on the color brightness value corresponding to the first illumination path. For example, the computer device may directly use the color brightness value corresponding to the first illumination path, i.e., the color brightness value, as the path importance parameter of the first illumination path. For another example, the computer device may also perform weighted processing on the color brightness value corresponding to the first illumination path, i.e., the color brightness value, to obtain the path importance parameter of the first illumination path. The color intensity value is used to characterize the intensity of the color in the illumination contribution value. For example, if the illumination contribution value of the first illumination path is RGB (255, 255, 255), the color intensity value is the three values ​​of 255, 255, 255. The color brightness value is used to characterize the brightness of the color provided by the first illumination path to the pixel point.

[0046] In one embodiment, the computer device may perform weighted processing on the color intensity values ​​in the illumination contribution value of the first illumination path to obtain a color brightness value corresponding to the first illumination path. For example, the computer device may perform weighted processing on the three values ​​255, 255, and 255 to obtain a color brightness value corresponding to the first illumination path, i.e., a color brightness value.

[0047] In one embodiment, for each pixel in the virtual scene, the computer device may select a first lighting path with the greatest lighting contribution from multiple first lighting paths of the pixel as the first candidate lighting path for the pixel.

[0048] In step 204, the neighboring pixel points of the pixel point are determined, and multiple second illumination paths obtained by sampling the illumination paths of the neighboring pixel points are determined. A second candidate illumination path is selected from the multiple second illumination paths according to the probability of each of the multiple second illumination paths being selected; the probability of each of the multiple second illumination paths being selected is positively correlated with the illumination contribution value of each of the multiple second illumination paths.

[0049] Among them, for each pixel point in the virtual scene, the neighborhood pixel points of the pixel point are the pixel points adjacent to the position of the pixel point in the virtual scene. The second illumination path is the illumination path obtained by sampling the illumination path for the neighborhood pixel points. The second candidate illumination path is the illumination path selected from multiple second illumination paths obtained by sampling the illumination path for the neighborhood pixel points. The probability of the second illumination path being selected as the second candidate illumination path is positively correlated with the illumination contribution value of the second illumination path. It can be understood that for each second illumination path, the greater the illumination contribution of the second illumination path to the neighborhood pixel points, that is, the higher the importance of the second illumination path to the neighborhood pixel points, the greater the probability of the second illumination path being selected as the second candidate illumination path, and vice versa.

[0050] Specifically, for each pixel in the virtual scene, the number of neighboring pixel points of the pixel point can be at least one. For each neighboring pixel point of the pixel point in the virtual scene, the computer device can use the neighboring pixel point as the starting point for illumination path sampling, randomly select multiple directions to emit rays, and continuously bounce them in the virtual scene to obtain multiple second illumination paths of the neighboring pixel point. After obtaining the multiple second illumination paths of the neighboring pixel point, the computer device can select the second candidate illumination path of the neighboring pixel point from the multiple second illumination paths of the neighboring pixel point based on the illumination contribution value of each second illumination path. Among them, the probability of each of the multiple second illumination paths being selected is positively correlated with the illumination contribution value of each of the multiple second illumination paths.

[0051] In one embodiment, for each second illumination path of a neighborhood pixel point, the computer device may determine the path importance parameter of the second illumination path based on the illumination contribution value of the second illumination path. Furthermore, the computer device may obtain a random number selected for the second illumination path, and select a second candidate illumination path from the multiple second illumination paths of the neighborhood pixel point based on the random number selected for the second illumination path and the path importance parameter of each second illumination path. The path importance parameter is positively correlated with the illumination contribution value. In this way, by referring to the random number selected for the second illumination path and selecting the second candidate illumination path from the multiple second illumination paths of the neighborhood pixel point, it is possible to ensure that when each pixel point in the virtual scene is illuminated and rendered, the diversity of the candidate illumination paths corresponding to each of the neighborhood pixel points of the pixel point is ensured, thereby further improving the rendering quality of the virtual scene.

[0052] In one embodiment, the larger the path importance parameter, the larger the range of values ​​it maps to. The computer device can obtain a random number selected for the second illumination path. If the random number selected for the second illumination path is cast within the range of values ​​mapped to the path importance parameter, the probability that the random number falls within a larger range of values ​​increases. It is understood that the computer device can select the second illumination path corresponding to the path importance parameter mapped within the range of values ​​within which the random number falls as the second candidate illumination path.

[0053] In one embodiment, for each second illumination path of a neighboring pixel point, the computer device may convert the color intensity value in the illumination contribution value of the second illumination path into a color brightness value corresponding to the second illumination path. Furthermore, the computer device may determine the path importance parameter of the second illumination path based on the color brightness value corresponding to the second illumination path. For example, the computer device may directly use the color brightness value corresponding to the second illumination path, i.e., the color brightness value, as the path importance parameter of the second illumination path. For another example, the computer device may also perform weighted processing on the color brightness value corresponding to the second illumination path, i.e., the color brightness value, to obtain the path importance parameter of the second illumination path. Among them, the color intensity value is used to characterize the intensity of the color in the illumination contribution value.

[0054] In one embodiment, the computer device may perform weighted processing on the color intensity values ​​in the illumination contribution value of the second illumination path to obtain a color brightness value corresponding to the second illumination path. For example, if the illumination contribution value of the second illumination path is RGB(255, 255, 255), then the color intensity values ​​are 255, 255, 255. The computer device may perform weighted processing on the three values ​​255, 255, 255 to obtain a color brightness value corresponding to the second illumination path, i.e., a color brightness value.

[0055] In one embodiment, for each neighboring pixel point of a pixel point in a virtual scene, a computer device may select a second lighting path with the greatest lighting contribution from multiple second lighting paths of the neighboring pixel point as the second candidate lighting path of the neighboring pixel point.

[0056] Step 206: Select a target lighting path from the first candidate lighting path and the second candidate lighting path.

[0057] Specifically, for each pixel in the virtual scene, the computer device can select a target lighting path for the pixel from the first candidate lighting path for the pixel and the second candidate lighting paths corresponding to each of the neighboring pixels of the pixel.

[0058] In one embodiment, for each pixel in a virtual scene, the first candidate lighting path and each second candidate lighting path for that pixel may form a candidate path set corresponding to that pixel. The computer device may randomly select a candidate lighting path from the candidate path set corresponding to that pixel as the target lighting path for that pixel. It will be appreciated that each candidate lighting path in the candidate path set has the same probability of being selected as the target lighting path.

[0059] Step 208, determine the relevant lighting paths of the pixel point, refer to the lighting contribution value of the target lighting path, determine the lighting contribution provided by the relevant lighting paths to the pixel point, and obtain the comprehensive lighting contribution value of the pixel point; the relevant lighting paths include the first lighting path and the second lighting path.

[0060] Specifically, for each pixel in the virtual scene, the first and second lighting paths of the pixel may constitute the relevant lighting path for the pixel. The computer device may refer to the lighting contribution value provided by the target lighting path for the pixel to determine the lighting contribution provided by the relevant lighting path for the pixel, thereby obtaining the final comprehensive lighting contribution value received by the pixel.

[0061] In one embodiment, a computer device may convert the color intensity value in the illumination contribution value of a target illumination path into a color brightness value corresponding to the target illumination path, and determine a path importance parameter for the target illumination path based on the color brightness value corresponding to the target illumination path. The path importance parameter for the target illumination path is used to characterize the color intensity in the illumination contribution value of the target illumination path. Furthermore, based on the path importance parameter for the target illumination path, the computer device may eliminate the color intensity value in the illumination contribution value of the target illumination path to obtain a color type value for the target illumination path. For each illumination path associated with a pixel, the computer device may convert the color intensity value in the illumination contribution value of the associated illumination path into a color brightness value corresponding to the associated illumination path, and determine the path importance parameter for the associated illumination path based on the color brightness value corresponding to the associated illumination path. Furthermore, the computer device may select the path importance parameter with the largest path importance parameter from the path importance parameters of the associated illumination paths for the pixel, and assign the selected largest path importance parameter to the color type value of the target illumination path, thereby obtaining the final comprehensive illumination contribution value received by the pixel.

[0062] In one embodiment, a computer device may convert the color intensity value in the illumination contribution value of a target illumination path into a color saturation value corresponding to the target illumination path, and determine a path importance parameter for the target illumination path based on the color saturation value corresponding to the target illumination path. The path importance parameter for the target illumination path is used to characterize the color intensity in the illumination contribution value of the target illumination path. Furthermore, the computer device may eliminate the color intensity value in the illumination contribution value of the target illumination path based on the path importance parameter of the target illumination path to obtain a color type value for the target illumination path. For each illumination path associated with a pixel, the computer device may convert the color intensity value in the illumination contribution value of the associated illumination path into a color saturation value corresponding to the associated illumination path, and determine the path importance parameter for the associated illumination path based on the color saturation value corresponding to the associated illumination path. Furthermore, the computer device may select the path importance parameter with the largest path importance parameter from the path importance parameters of the associated illumination paths for the pixel, and assign the selected largest path importance parameter to the color type value of the target illumination path, thereby obtaining the final comprehensive illumination contribution value received by the pixel.

[0063] In one embodiment, a computer device may convert the color intensity value in the illumination contribution value of a target illumination path into a color chromaticity value corresponding to the target illumination path, and determine a path importance parameter for the target illumination path based on the color chromaticity value corresponding to the target illumination path. The path importance parameter for the target illumination path is used to characterize the color intensity in the illumination contribution value of the target illumination path. Furthermore, based on the path importance parameter for the target illumination path, the computer device may eliminate the color intensity value in the illumination contribution value of the target illumination path to obtain a color type value for the target illumination path. For each illumination path associated with a pixel, the computer device may convert the color intensity value in the illumination contribution value of the associated illumination path into a color chromaticity value corresponding to the associated illumination path, and determine the path importance parameter for the associated illumination path based on the color chromaticity value corresponding to the associated illumination path. Furthermore, the computer device may select the path importance parameter with the largest path importance parameter from the path importance parameters of the associated illumination paths for the pixel, and assign the selected largest path importance parameter to the color type value of the target illumination path, thereby obtaining the final comprehensive illumination contribution value received by the pixel.

[0064] Step 210 : Perform illumination rendering on each pixel in the virtual scene using the comprehensive illumination contribution value of each pixel in the virtual scene.

[0065] The computer device can perform lighting rendering on the pixel based on the comprehensive lighting contribution value ultimately received by the pixel. Lighting rendering on a pixel can be understood as the process of recording the comprehensive lighting contribution value of the pixel in the virtual scene before lighting rendering, so that the pixel presents a lighting effect. For example, the lighting contribution value of a pixel can be RGB (255, 255, 255). After lighting rendering on the pixel, the pixel can appear white.

[0066] In one embodiment, a computer device may pre-bake a lightmap corresponding to the virtual scene based on the comprehensive light contribution values ​​corresponding to each pixel in the virtual scene. It will be understood that a lightmap is used to record the comprehensive light contribution values ​​of each pixel in the virtual scene. Furthermore, upon receiving a rendering instruction, the computer device may perform lighting rendering for each pixel in the virtual scene based on the comprehensive light contribution values ​​of each pixel in the virtual scene recorded in the pre-baked lightmap, thereby improving the rendering efficiency of the virtual scene.

[0067] In the above-described illumination rendering method, for each pixel in the virtual scene, multiple first illumination paths are determined by sampling illumination paths for the pixel. A first candidate illumination path is selected from the multiple first illumination paths based on the probability of each of the multiple first illumination paths being selected. The probability of each of the multiple first illumination paths being selected is positively correlated with the illumination contribution values ​​of each of the multiple first illumination paths. It is understood that the greater the illumination contribution provided by a first illumination path to the pixel, the more important the first illumination path is to the pixel, and the greater the probability of its selection. Neighboring pixels of the pixel are determined, and multiple second illumination paths are determined by sampling illumination paths for the neighboring pixels. A second candidate illumination path is selected from the multiple second illumination paths based on the probability of each of the multiple second illumination paths being selected. The probability of each of the multiple second illumination paths being selected is positively correlated with the illumination contribution values ​​of each of the multiple second illumination paths. It is understood that the greater the illumination contribution provided by a second illumination path to the neighborhood pixel, the more important the second illumination path is to the neighborhood pixel, and the greater the probability of its selection. A target lighting path is selected from the first candidate lighting path and the second candidate lighting path, and the relevant lighting path of the pixel is determined. With reference to the lighting contribution value of the target lighting path, the lighting contribution provided by the relevant lighting path to the pixel is determined to obtain the comprehensive lighting contribution value of the pixel. The comprehensive lighting contribution value of each pixel in the virtual scene is used to perform lighting rendering on each pixel in the virtual scene. Since the relevant lighting path includes the first lighting path and the second lighting path, compared with the traditional method of integrating the lighting contribution values ​​provided by the lighting paths obtained by uniformly sampling the pixels to perform lighting rendering on the virtual scene, the present application calculates the comprehensive lighting contribution values ​​provided by each relevant lighting path corresponding to the pixel point and its neighboring pixels to perform lighting rendering on the pixel by referring to the lighting contribution values ​​of the selected lighting paths with higher importance, thereby improving the rendering quality when the number of lighting paths sampled for the pixel point is small.

[0068] In one embodiment, for each pixel point in the virtual scene, multiple first illumination paths obtained by sampling the illumination paths of the pixel point are determined, and a first candidate illumination path is selected from the multiple first illumination paths according to the probability of each of the multiple first illumination paths being selected, including: for each pixel point in the virtual scene, performing path sampling for the pixel point in this round to obtain the first illumination path sampled in this round; from the first illumination path sampled in this round and the first illumination path selected in the previous round, a new first illumination path is selected according to the probability of each of the first illumination path sampled in this round and the first illumination path selected in the previous round being selected, and the new first illumination path is used as the first illumination path selected in this round; the next round is used as the new round, and the step of performing path sampling for the pixel point in this round to obtain the first illumination path sampled in this round is returned to continue execution until the first sampling stop condition is met, and the first illumination path selected in the last round is used as the first candidate illumination path.

[0069] Specifically, for each pixel in the virtual scene, the computer device can perform path sampling for this round on the pixel to obtain the first illumination path of this round of sampling. The computer device can obtain the first illumination path selected after the previous round of sampling of this round of sampling, and from the first illumination path of this round of sampling and the first illumination path selected in the previous round, according to the probability of each of the first illumination path of this round of sampling and the first illumination path selected in the previous round being selected, select a new first illumination path, and use the new first illumination path as the first illumination path selected in this round. Furthermore, the computer device can use the next round of sampling of this round of sampling as the new round of sampling, return to each pixel in the virtual scene, and the computer device can perform path sampling for this round on the pixel to obtain the first illumination path of this round of sampling to continue executing the steps until the first sampling stop condition is met, and use the first illumination path selected in the last round as the first candidate illumination path for the pixel.

[0070] In one embodiment, the first sampling stop condition may be any one of the following: the number of illumination path sampling for a pixel reaches a preset number of sampling for the pixel, and the number of iterative sampling reaches a preset number of sampling for the pixel.

[0071] In one embodiment, the computer device may select the illumination path with the greatest illumination contribution from the first illumination path sampled in this round and the first illumination path selected in the previous round as the new first illumination path, and use the new first illumination path as the first illumination path selected in this round.

[0072] In the above embodiment, by iteratively sampling the first illumination path of a pixel, after each round of sampling, a new first illumination path is selected from the first illumination path sampled in the current round and the first illumination path selected in the previous round, based on the probability of selection of each of the first illumination path sampled in the current round and the first illumination path selected in the previous round. This new first illumination path is then used as the first illumination path selected in the current round, and the first illumination path selected in the last round is used as the first candidate illumination path. Since important paths are selected in each round, the first illumination path selected in the previous round that participates in the current selection can be guaranteed to be highly important. Therefore, the accuracy of the first candidate illumination path ultimately selected for the pixel can be improved, thereby further improving the quality of illumination rendering.

[0073] In one embodiment, a new first illumination path is selected from the first illumination path sampled in the current round and the first illumination path selected in the previous round according to the probability of each of the first illumination path sampled in the current round and the first illumination path selected in the previous round being selected, including: determining a path importance parameter of the first illumination path sampled in the current round according to the illumination contribution value of the first illumination path sampled in the current round; determining a path importance parameter of the first illumination path selected in the previous round according to the illumination contribution value of the first illumination path selected in the previous round; obtaining a first selected random number corresponding to the current round; determining a value range to which the first selected random number belongs according to a value range mapped to the path importance parameter of the first illumination path sampled in the current round and a value range mapped to the path importance parameter of the first illumination path selected in the previous round; and selecting a new first illumination path from the first illumination path sampled in the current round and the first illumination path selected in the previous round according to the value range to which the first selected random number belongs. Wherein, the path importance parameter is positively correlated with the size of the mapped value range.

[0074] In one embodiment, the computer device may determine the path importance parameter of the first illumination path sampled in the current round based on the illumination contribution value of the first illumination path sampled in the current round, and determine the path importance parameter of the first illumination path selected in the previous round based on the illumination contribution value of the first illumination path selected in the previous round. Furthermore, the computer device may obtain a first selected random number corresponding to the current round, and determine the value range to which the first selected random number belongs based on the value range mapped to the path importance parameter of the first illumination path sampled in the current round and the value range mapped to the path importance parameter of the first illumination path selected in the previous round. Based on the value range to which the first selected random number belongs, a new first illumination path is selected from the first illumination path sampled in the current round and the first illumination path selected in the previous round. The probability of the first illumination path being selected is positively correlated with the path importance parameter of the first illumination path. The path importance parameter is positively correlated with the size of the mapped value range. It is understood that the larger the path importance parameter, the larger the value range to which it is mapped. If the first selected random number is thrown into the value range mapped to the path importance parameter, the probability that the first selected random number falls into a larger value range increases. It is understood that the computer device can select the first illumination path corresponding to the path importance parameter mapped to the value range in which the first selected random number falls as the first candidate illumination path.

[0075] In one embodiment, the computer device may convert the color intensity value in the illumination contribution value of the first illumination path sampled in the current round into the color brightness value corresponding to the first illumination path sampled in the current round. Furthermore, the computer device may determine the path importance parameter of the first illumination path sampled in the current round based on the color brightness value corresponding to the first illumination path sampled in the current round. For example, the computer device may directly use the color brightness value corresponding to the first illumination path sampled in the current round, i.e., the color brightness value, as the path importance parameter of the first illumination path sampled in the current round. For another example, the computer device may also perform weighted processing on the color brightness value corresponding to the first illumination path sampled in the current round, i.e., the color brightness value, to obtain the path importance parameter of the first illumination path sampled in the current round.

[0076] In one embodiment, the computer device may convert the color intensity value in the illumination contribution value of the first illumination path selected in the previous round into the color brightness value corresponding to the first illumination path selected in the previous round. Furthermore, the computer device may determine the path importance parameter of the first illumination path selected in the previous round based on the color brightness value corresponding to the first illumination path selected in the previous round. For example, the computer device may directly use the color brightness value corresponding to the first illumination path selected in the previous round, i.e., the color brightness value, as the path importance parameter of the first illumination path selected in the previous round. For another example, the computer device may also perform weighted processing on the color brightness value corresponding to the first illumination path selected in the previous round, i.e., the color brightness value, to obtain the path importance parameter of the first illumination path selected in the previous round.

[0077] In the above embodiment, in each round of selection, a new first lighting path is selected from the first lighting path sampled in this round and the first lighting path selected in the previous round through the first selected random number of this round, the path importance parameter of the first lighting path sampled in this round, and the path importance parameter of the first lighting path selected in the previous round. This can improve the accuracy of the first lighting path selected in this round, and further ensure the diversity of the candidate lighting paths selected corresponding to each pixel point in the virtual scene when lighting rendering is performed on each pixel point, thereby further improving the rendering quality of the virtual scene.

[0078] In one embodiment, the first lighting path selected in the previous round is stored in the path storage container corresponding to the pixel point; using the new first lighting path as the first lighting path selected in this round includes: using the new first lighting path as the first lighting path selected in this round, and replacing the first lighting path selected in the previous round in the path storage container corresponding to the pixel point with the first lighting path selected in this round.

[0079] Specifically, the computer device may use the new first illumination path as the first illumination path selected in the current round, and replace the first illumination path selected in the previous round, stored in the path storage container corresponding to the pixel, with the first illumination path selected in the current round. It will be understood that the illumination paths stored in the path storage container corresponding to the pixel are updated with each round of illumination path sampling and selection until the first sampling stop condition is met, at which point the computer device may use the first illumination path stored in the path storage container corresponding to the pixel as the first candidate illumination path for the pixel.

[0080] In one embodiment, the path storage container may include a path reservoir. As shown in FIG3 , the first illumination path selected in the previous round is stored in the path reservoir corresponding to the pixel. The new first illumination path is used as the first illumination path selected in this round, and the first illumination path selected in the previous round in the path reservoir corresponding to the pixel is replaced with the first illumination path selected in this round (i.e., the illumination path selected in this round). It is understood that the illumination paths stored in the path reservoir corresponding to the pixel will be updated with each round of illumination path sampling and selection until the first sampling stop condition is met. The computer device may use the first illumination path stored in the path reservoir corresponding to the pixel as the first candidate illumination path for the pixel. It is also understood that in the process of updating the illumination paths stored in the path reservoir, the illumination contribution value provided by the first illumination path selected in this round, the position and normal of the first ejected pixel in the first illumination path selected in this round, the number of sampled first illumination paths (i.e., the total number of paths), the total path importance parameter of each first illumination path, and the resampling parameter currently corresponding to the path reservoir will also be continuously updated. The average path importance parameter of each first illumination path can be determined based on the ratio of the total path importance parameter of each first illumination path to the number of sampled first illumination paths. The resampling parameter currently corresponding to the path reservoir can be determined based on the ratio of the average path importance parameter of each first illumination path to the path importance parameter of the first illumination path selected in the current round.

[0081] In the above embodiment, for each pixel point in the virtual scene, during the process of iteratively sampling the first lighting path of the pixel point, the first lighting path selected in each round is temporarily stored in the path storage container corresponding to the pixel point, and the first lighting path temporarily stored in the path storage container corresponding to the pixel point is updated after each round of sampling. This can further improve the accuracy of the finally selected first candidate lighting path of each pixel point in the virtual scene, thereby further improving the rendering quality of the virtual scene.

[0082] In one embodiment, the neighborhood pixels of a pixel point are determined, and multiple second illumination paths obtained by performing illumination path sampling on the neighborhood pixels are determined, and a second candidate illumination path is selected from the multiple second illumination paths according to the probability of each of the multiple second illumination paths being selected, including: for each neighborhood pixel point of the pixel point, performing path sampling in this round on the neighborhood pixels to obtain the second illumination path sampled in this round; from the second illumination paths sampled in this round and the second illumination paths selected in the previous round, according to the probability of each of the second illumination paths sampled in this round and the second illumination paths selected in the previous round being selected, a new second illumination path is selected, and the new second illumination path is used as the second illumination path selected in this round; the next round is used as a new round, and the step of performing path sampling in this round on the neighborhood pixels to obtain the second illumination path sampled in this round is returned to continue execution until the second sampling stop condition is met, and the second illumination path selected in the last round is used as the second candidate illumination path.

[0083] Specifically, for each neighboring pixel point of a pixel point in the virtual scene, the computer device may perform a path sampling for the neighboring pixel point in this round to obtain the second illumination path of the current sampling round. The computer device may obtain the second illumination path selected after the previous sampling round of the current sampling round, and from the second illumination path of the current sampling round and the second illumination path selected in the previous round, according to the probability of the second illumination path of the current sampling round and the second illumination path selected in the previous round being selected, select a new second illumination path, and use the new second illumination path as the second illumination path selected in the current round. Furthermore, the computer device may use the next round of sampling in the current sampling round as the new current sampling round, return to each neighboring pixel point of the pixel point in the virtual scene, perform the path sampling for the current round on the neighboring pixel point, and continue to perform the steps of obtaining the second illumination path of the current sampling round until the second sampling stop condition is met, and use the second illumination path selected in the last round as the second candidate illumination path for the neighboring pixel point.

[0084] In one embodiment, the second sampling stop condition may be any one of the following: the number of illumination path sampling for the neighboring pixel points reaches a preset number of sampling for the neighboring pixel points, and the number of iterative sampling reaches a preset number of sampling for the neighboring pixel points.

[0085] In one embodiment, the second illumination path selected in the previous round is stored in a path storage container corresponding to the neighborhood pixel point; using the new second illumination path as the second illumination path selected in the current round includes: using the new second illumination path as the second illumination path selected in the current round, and replacing the second illumination path selected in the previous round in the path storage container corresponding to the neighborhood pixel point with the second illumination path selected in the current round. It will be understood that the illumination paths stored in the path storage container corresponding to the neighborhood pixel point will be updated with each round of illumination path sampling and selection until a second sampling stop condition is met, at which point the computer device may use the second illumination path stored in the path storage container corresponding to the neighborhood pixel point as the second candidate illumination path for the neighborhood pixel point. In this way, for each neighborhood pixel point corresponding to a pixel point in the virtual scene, during the iterative sampling of the second lighting path of the neighborhood pixel point, the second lighting path selected in each round is temporarily stored through the path storage container corresponding to the neighborhood pixel point, and the second lighting path temporarily stored in the path storage container corresponding to the neighborhood pixel point is updated after each round of sampling. This can further improve the accuracy of the final selected second candidate lighting path of each neighborhood pixel point of the pixel point in the virtual scene, thereby further improving the rendering quality of the virtual scene.

[0086] In one embodiment, the computer device may select the illumination path with the greatest illumination contribution from the second illumination paths sampled in this round and the second illumination paths selected in the previous round as the new second illumination path, and use the new second illumination path as the second illumination path selected in this round.

[0087] In the above embodiment, by iteratively sampling the second illumination paths of neighboring pixels, after each round of sampling, a new second illumination path is selected from the second illumination paths sampled in the current round and the second illumination paths selected in the previous round, based on the probability of selection of the second illumination paths sampled in the current round and the second illumination paths selected in the previous round. This new second illumination path is used as the second illumination path selected in the current round, and the second illumination path selected in the last round is used as the second candidate illumination path. Since important paths are selected in each round, the second illumination paths selected in the previous round that participate in the current selection can be guaranteed to be highly important. Therefore, the accuracy of the second candidate illumination paths ultimately selected for the neighboring pixels can be improved, thereby further improving the quality of illumination rendering.

[0088] In one embodiment, a new second illumination path is selected from the second illumination path sampled in this round and the second illumination path selected in the previous round according to the probability of each of the second illumination path sampled in this round and the second illumination path selected in the previous round being selected, including: determining the path importance parameter of the second illumination path sampled in this round according to the illumination contribution value of the second illumination path sampled in this round; determining the path importance parameter of the second illumination path selected in the previous round according to the illumination contribution value of the second illumination path selected in the previous round; obtaining the second selected random number corresponding to this round; determining the value range of the second selected random number according to the value range mapped by the path importance parameter of the second illumination path sampled in this round and the value range mapped by the path importance parameter of the second illumination path selected in the previous round; and selecting a new second illumination path from the second illumination path sampled in this round and the second illumination path selected in the previous round according to the value range to which the second selected random number belongs.

[0089] In one embodiment, the computer device may determine the path importance parameter of the second illumination path sampled in the current round based on the illumination contribution value of the second illumination path sampled in the current round, and determine the path importance parameter of the second illumination path selected in the previous round based on the illumination contribution value of the second illumination path selected in the previous round. Furthermore, the computer device may obtain a second selected random number corresponding to the current round and, based on the second selected random number, the path importance parameter of the second illumination path sampled in the current round, and the path importance parameter of the second illumination path selected in the previous round, select a new second illumination path from the second illumination path sampled in the current round and the second illumination path selected in the previous round. It will be understood that the larger the path importance parameter, the larger the range of values ​​it maps to. If the second selected random number is thrown into the range of values ​​mapped to the path importance parameter, the probability that the second selected random number falls within a larger range of values ​​increases. It will be understood that the computer device may select the second illumination path corresponding to the path importance parameter mapped to the range of values ​​within which the second selected random number falls as the second candidate illumination path.

[0090] In one embodiment, the computer device may convert the color intensity value in the illumination contribution value of the second illumination path sampled in the current round into the color brightness value corresponding to the second illumination path sampled in the current round. Furthermore, the computer device may determine the path importance parameter of the second illumination path sampled in the current round based on the color brightness value corresponding to the second illumination path sampled in the current round. For example, the computer device may directly use the color brightness value corresponding to the second illumination path sampled in the current round, i.e., the color brightness value, as the path importance parameter of the second illumination path sampled in the current round. For another example, the computer device may also perform weighted processing on the color brightness value corresponding to the second illumination path sampled in the current round, i.e., the color brightness value, to obtain the path importance parameter of the second illumination path sampled in the current round.

[0091] In one embodiment, the computer device may convert the color intensity value in the illumination contribution value of the second illumination path selected in the previous round into the color brightness value corresponding to the second illumination path selected in the previous round. Furthermore, the computer device may determine the path importance parameter of the second illumination path selected in the previous round based on the color brightness value corresponding to the second illumination path selected in the previous round. For example, the computer device may directly use the color brightness value corresponding to the second illumination path selected in the previous round, i.e., the color brightness value, as the path importance parameter of the second illumination path selected in the previous round. For another example, the computer device may also perform weighted processing on the color brightness value corresponding to the second illumination path selected in the previous round, i.e., the color brightness value, to obtain the path importance parameter of the second illumination path selected in the previous round.

[0092] In the above embodiment, in each round of selection, a new second lighting path is selected from the second lighting path sampled in this round and the second lighting path selected in the previous round through the second selected random number of this round, the path importance parameter of the second lighting path sampled in this round, and the path importance parameter of the second lighting path selected in the previous round. This can improve the accuracy of the second lighting path selected in this round, and further ensure that when each pixel point in the virtual scene is illuminated and rendered, the diversity of the candidate lighting paths selected corresponding to the neighborhood pixels of each pixel point can be ensured, thereby further improving the rendering quality of the virtual scene.

[0093] In one embodiment, the method also includes: for each pixel point in the virtual scene, determining at least one initial neighboring pixel point of the pixel point from the virtual scene; for each initial neighboring pixel point, if there is no occlusion between the initial neighboring pixel point and the ejection pixel point, the initial neighboring pixel point is used as the neighboring pixel point of the pixel point; wherein the ejection pixel point is the first pixel point on the first illumination path to be ejected.

[0094] In one embodiment, for each pixel in a virtual scene, the computer device may determine at least one initial neighboring pixel of the pixel from the virtual scene. The computer device may determine the first pixel on the first illumination path of the pixel that experiences a bounce as the bounce pixel. It will be understood that bounce refers to the effect of light reflection or refraction caused by the surface of a virtual object in the virtual scene when light strikes the surface of the virtual object. It will be understood that the surface of the virtual object is composed of many pixels, and the first pixel on the first illumination path that causes light reflection or refraction may be determined as the bounce pixel. For each initial neighboring pixel, if there is no occlusion between the initial neighboring pixel and the bounce pixel, the computer device may select the initial neighboring pixel as the pixel's neighboring pixel. It will be understood that if there is occlusion between the initial neighboring pixel and the bounce pixel, the computer device may skip the initial neighboring pixel. It will be understood that initial neighboring pixels that are occluded by the bounce pixel will not be selected as the pixel's neighboring pixel.

[0095] In one embodiment, as shown in (a) and (b) of FIG4 , for pixel 5 in a virtual scene, the initial neighboring pixel points of pixel 5 (i.e., pixel 1, pixel 2, pixel 3, and pixel 4) are determined from the virtual scene. The illumination path of pixel 5 is: pixel 5 → ejection pixel 405 → virtual light source 401 (the direction of the arrow in FIG4 is obtained by reversing the illumination path direction according to the reversibility principle of light). Ejection pixel 405 is the first pixel point on the illumination path of pixel 5 to be ejected. If there is no occlusion between pixel 3 and pixel 4 and ejection pixel 405, pixel 3 and pixel 4 are regarded as neighboring pixel points of pixel 5. If there is occlusion between pixel 1 and pixel 2 and ejection pixel 405, the computer device can skip pixel 1 and pixel 2. It can be understood that pixel 1 and pixel 2 will not be regarded as neighboring pixel points of pixel 5.

[0096] In one embodiment, as shown in FIG4(a), the first candidate illumination path selected for pixel 5 is: pixel 5 → ejected pixel 405 → virtual light source 401. The second candidate illumination path selected for the neighborhood pixel of pixel 5 (i.e., pixel 1) is: pixel 1 → pixel 402 → virtual light source 401. The second candidate illumination path selected for the neighborhood pixel of pixel 5 (i.e., pixel 2) is: pixel 2 → pixel 403. The second candidate illumination path selected for the neighborhood pixel of pixel 5 (i.e., pixel 3) is: pixel 3 → pixel 404. The second candidate illumination path selected for the neighborhood pixel of pixel 5 (i.e., pixel 4) is: pixel 4 → pixel 406. It can be understood that among the above-selected illumination paths, only the illumination paths of pixel 1 and pixel 5 are valid illumination paths, i.e., there is direct illumination, i.e., virtual light source 401, in the illumination paths of pixel 1 and pixel 5. The illumination paths of pixel 2, pixel 3, and pixel 4 are invalid illumination paths, that is, there is no direct illumination in the illumination paths of pixel 2, pixel 3, and pixel 4, that is, there is no virtual light source 401. Generally, the illumination contribution of an effective illumination path to a pixel is greater than the illumination contribution of an invalid illumination path to a pixel. Therefore, as shown in (b) of FIG4 , for pixel 5, the first candidate illumination path of pixel 5 can be selected as the target illumination path of pixel 5 from the first candidate illumination path of pixel 5 and the second candidate illumination paths of pixel 3 and pixel 4. Similarly, for pixel 3 and pixel 4, pixel 5 is a neighboring pixel of pixel 3 and pixel 4, and the first candidate illumination path of pixel 5 can also be selected as the target illumination path of pixel 3 and pixel 4 from the first candidate illumination path of pixel 5 and the second candidate illumination paths of pixel 3 and pixel 4.

[0097] As shown in Figure 5(a), for each pixel in the virtual scene (a small square represents a pixel), only one first illumination path is sampled for that pixel. Thus, with only one path sampling, only three pixels in the virtual scene can find a valid illumination path, resulting in poor virtual scene rendering quality. As shown in Figure 5(b), for each pixel in the virtual scene, multiple first illumination paths are sampled for that pixel. Thus, with only multiple path samplings, nearly all pixels in the virtual scene can find a valid illumination path. However, the noise is still severe, the illumination rendering effect is not smooth, and the virtual scene rendering quality is poor. As shown in (c) of FIG5 , the illumination rendering method of the present application, i.e., for each pixel in the virtual scene, multiple first illumination paths obtained by sampling the illumination path of the pixel are determined, a first candidate illumination path is selected from the multiple first illumination paths according to the probability of each of the multiple first illumination paths being selected, and the neighboring pixels of the pixel are determined, and multiple second illumination paths obtained by sampling the illumination path of the neighboring pixels are determined, and a second candidate illumination path is selected from the multiple second illumination paths according to the probability of each of the multiple second illumination paths being selected, and the relevant illumination path of the pixel is determined, and the illumination contribution provided by the relevant illumination path to the pixel is determined with reference to the illumination contribution value of the target illumination path, and the comprehensive illumination contribution value of the pixel is obtained. The comprehensive illumination contribution value of each pixel in the virtual scene is used to perform illumination rendering on each pixel in the virtual scene. This can make the illumination rendering effect smooth, thereby improving the rendering quality of the virtual scene.

[0098] In the above embodiment, for each initial neighborhood pixel point in the virtual scene, if there is occlusion between the initial neighborhood pixel point and the ejection pixel point, it means that the light bounced by the ejection pixel point will not reach the initial neighborhood pixel point. Therefore, by using the initial neighborhood pixel point that has no occlusion between it and the ejection pixel point as the neighborhood pixel point of the pixel point, the light leakage effect in the rendered virtual scene can be effectively prevented.

[0099] In one embodiment, for each pixel point in the virtual scene, at least one initial neighboring pixel point of the pixel point is determined from the virtual scene, and the initial neighboring pixel point is directly used as the neighboring pixel point of the pixel point.

[0100] In one embodiment, a first candidate lighting path and a second candidate lighting path constitute a candidate path set; selecting a target lighting path from the first candidate lighting path and the second candidate lighting path includes: selecting a target lighting path from the candidate path set; wherein the probability of each candidate lighting path in the candidate path set being selected is positively correlated with the lighting contribution value of the candidate lighting path.

[0101] In one embodiment, the number of second candidate lighting paths is at least one. For each pixel in the virtual scene, the first candidate lighting path of the pixel is used as the lighting path selected in the first round. Each round from the second round onwards is used as the current round, and a new lighting path is selected from the second candidate lighting path to be selected in the current round and the lighting path selected in the previous round, and the new lighting path is used as the lighting path selected in the current round. The next round is used as the new current round, and the step of selecting a new lighting path from the second candidate lighting path to be selected in the current round and the lighting path selected in the previous round, and using the new lighting path as the lighting path selected in the current round is continued until the path selection stop condition is met, and the lighting path selected in the last round is used as the target lighting path for the pixel.

[0102] In one embodiment, the path selection stopping condition may include either one of the number of iterations reaching the number of second candidate lighting paths and the number of iterations reaching a preset number of iterations for path selection.

[0103] In one embodiment, the computer device may select a candidate lighting path with the largest lighting contribution value from the first candidate lighting path and the second candidate lighting path as the target lighting path.

[0104] In the above embodiment, by selecting a target illumination path from a set of candidate paths, the probability of each candidate illumination path being selected is positively correlated with the illumination contribution value of the candidate illumination path. This ensures that a high probability of selecting a candidate illumination path of high importance is achieved while also ensuring the diversity of the candidate illumination paths, thereby further improving the rendering quality of the virtual scene.

[0105] In one embodiment, the relevant lighting path of the pixel point is determined, and the lighting contribution provided by the relevant lighting path to the pixel point is determined with reference to the lighting contribution value of the target lighting path to obtain the comprehensive lighting contribution value of the pixel point, including: based on the path importance parameter of the target lighting path, eliminating the color intensity value in the lighting contribution value of the target lighting path to obtain the color type value of the target lighting path; the path importance parameter of the target lighting path is used to characterize the intensity of the color in the lighting contribution value of the target lighting path; the average path importance parameter of each relevant lighting path of the pixel point is assigned to the color type value of the target lighting path to obtain the corresponding comprehensive lighting contribution value of the pixel point; wherein, the average path importance parameter is used to characterize the average intensity of the color in the lighting contribution value of each relevant lighting path.

[0106] Specifically, for each pixel in the virtual scene, the computer device may, based on the path importance parameter of the target lighting path for that pixel, eliminate the color intensity value from the lighting contribution value of the target lighting path to obtain the color type value of the target lighting path for that pixel. Furthermore, the computer device may assign the color type value of the target lighting path for that pixel the average path importance parameter of each of the relevant lighting paths for that pixel to obtain the corresponding comprehensive lighting contribution value for that pixel.

[0107] In one embodiment, the computer device may convert the color intensity value in the illumination contribution value of the target illumination path into a color saturation value corresponding to the target illumination path, and determine a path importance parameter for the target illumination path based on the color saturation value corresponding to the target illumination path. For each pixel in the virtual scene, the computer device may eliminate the color intensity value in the illumination contribution value of the target illumination path based on the path importance parameter of the target illumination path for that pixel to obtain a color type value for the target illumination path for that pixel. For each associated illumination path of the pixel, the computer device may convert the color intensity value in the illumination contribution value of the associated illumination path into a color saturation value corresponding to the associated illumination path, and determine the path importance parameter for the associated illumination path based on the color saturation value corresponding to the associated illumination path. The computer device may average the path importance parameters of the associated illumination paths for the pixel to obtain an average path importance parameter for each associated illumination path. Furthermore, the computer device may assign the average path importance parameter of the associated illumination paths for the pixel to the color type value of the target illumination path for that pixel to obtain a corresponding comprehensive illumination contribution value for that pixel.

[0108] In one embodiment, the computer device may convert the color intensity value in the illumination contribution value of the target illumination path into a color chromaticity value corresponding to the target illumination path, and determine a path importance parameter for the target illumination path based on the color chromaticity value corresponding to the target illumination path. For each pixel in the virtual scene, the computer device may eliminate the color intensity value in the illumination contribution value of the target illumination path based on the path importance parameter of the target illumination path for that pixel, thereby obtaining a color type value for the target illumination path for that pixel. For each associated illumination path of the pixel, the computer device may convert the color intensity value in the illumination contribution value of the associated illumination path into a color chromaticity value corresponding to the associated illumination path, and determine the path importance parameter for the associated illumination path based on the color chromaticity value corresponding to the associated illumination path. Furthermore, the computer device may average the path importance parameters of the associated illumination paths for the pixel to obtain an average path importance parameter for each associated illumination path. Furthermore, the computer device may assign the average path importance parameter of the associated illumination paths for the pixel to the color type value of the target illumination path for that pixel, thereby obtaining a corresponding comprehensive illumination contribution value for that pixel.

[0109] In the above embodiment, the color intensity value in the illumination contribution value of the target illumination path is eliminated by using the path importance parameter of the target illumination path, and the color type value of the target illumination path without intensity can be obtained. Then, by using the average path importance parameter of each related illumination path of the pixel point, the color type value of the target illumination path is assigned the average intensity of the color in the illumination contribution value representing each related illumination path, and the corresponding comprehensive illumination contribution value of the pixel point can be obtained, thereby further improving the rendering quality.

[0110] In one embodiment, the method further includes: converting the color intensity value in the illumination contribution value of the target illumination path into a color brightness value corresponding to the target illumination path; and determining a path importance parameter of the target illumination path based on the color brightness value corresponding to the target illumination path.

[0111] In one embodiment, the computer device may convert the color intensity value in the illumination contribution value of the target illumination path into a color brightness value corresponding to the target illumination path, and determine a path importance parameter for the target illumination path based on the color brightness value corresponding to the target illumination path. For each pixel in the virtual scene, the computer device may eliminate the color intensity value in the illumination contribution value of the target illumination path based on the path importance parameter of the target illumination path of that pixel, thereby obtaining a color type value for the target illumination path of that pixel. Furthermore, the computer device may assign the color type value of the target illumination path of that pixel the average path importance parameter of each of the relevant illumination paths for that pixel to the color type value of the target illumination path of that pixel, thereby obtaining a corresponding comprehensive illumination contribution value for that pixel.

[0112] In the above embodiment, a method for characterizing color intensity based on brightness is provided by converting the color intensity value in the illumination contribution value of the target illumination path into the color brightness value corresponding to the target illumination path, and determining the path importance parameter of the target illumination path based on the color brightness value corresponding to the target illumination path.

[0113] In one embodiment, the method also includes: for each relevant lighting path of the pixel point, converting the color intensity value in the lighting contribution value of the relevant lighting path into a color brightness value corresponding to the relevant lighting path; determining the path importance parameter of the relevant lighting path based on the color brightness value corresponding to the relevant lighting path; and averaging the path importance parameters of each relevant lighting path of the pixel point to obtain an average path importance parameter of each relevant lighting path.

[0114] In one embodiment, for each pixel in a virtual scene, the computer device may, based on the path importance parameter of the target lighting path for that pixel, eliminate the color intensity value from the illumination contribution value of the target lighting path to obtain the color type value of the target lighting path for that pixel. For each relevant lighting path for that pixel, the color intensity value in the illumination contribution value of the relevant lighting path is converted into a color brightness value corresponding to that lighting path, and the path importance parameter of that lighting path is determined based on the color brightness value corresponding to that lighting path. Furthermore, the computer device may average the path importance parameters of each relevant lighting path for that pixel to obtain an average path importance parameter for each relevant lighting path. Furthermore, the computer device may assign the average path importance parameter of each relevant lighting path for that pixel to the color type value of the target lighting path for that pixel to obtain the corresponding comprehensive illumination contribution value for that pixel.

[0115] In one embodiment, the computer device may convert the color intensity value in the illumination contribution value of the target illumination path into a color brightness value corresponding to the target illumination path, and determine a path importance parameter for the target illumination path based on the color brightness value corresponding to the target illumination path. For each pixel in the virtual scene, the computer device may eliminate the color intensity value in the illumination contribution value of the target illumination path based on the path importance parameter of the target illumination path for that pixel, thereby obtaining a color type value for the target illumination path for that pixel. For each associated illumination path of the pixel, the computer device may convert the color intensity value in the illumination contribution value of the associated illumination path into a color brightness value corresponding to the associated illumination path, and determine the path importance parameter for the associated illumination path based on the color brightness value corresponding to the associated illumination path. Furthermore, the computer device may average the path importance parameters of the associated illumination paths for the pixel to obtain an average path importance parameter for each associated illumination path. Furthermore, the computer device may assign the average path importance parameter of the associated illumination paths for the pixel to the color type value of the target illumination path for that pixel, thereby obtaining a corresponding comprehensive illumination contribution value for that pixel.

[0116] In one embodiment, the comprehensive illumination contribution value of a pixel point can be calculated by the following formula: RW←Rw / (RM·p(Rz)) L=f(z)W(z)

[0117] Among them, L represents the comprehensive illumination contribution value of the pixel point, f(z) represents the illumination contribution value of the target illumination path of the pixel point, W(z) represents the resampling parameter corresponding to each related illumination path of the pixel point, Rz represents the target illumination path of the pixel point, p(Rz) represents the path importance parameter of the target illumination path, Rw represents the total path importance parameter of each related illumination path, and RM represents the total number of paths of each related illumination path of the pixel point. When the target illumination path has been selected for the pixel point, W(z) is RW. Rw / (RM·p(Rz)) can be transformed into (Rw / RM)·(1 / p(Rz)). It can be understood that (Rw / RM) represents the average path importance parameter of each related illumination path. RW represents the resampling parameter corresponding to each related illumination path. The arrow ← represents mapping.

[0118] It can be understood that when a target illumination path has been selected for a pixel, substituting (Rw / RM)·(1 / p(Rz)) into L=f(z)W(z) can be transformed into L=(Rw / RM)·(f(z) / p(Rz)). It can be understood that (f(z) / p(Rz)) represents the color type value of the target illumination path obtained by eliminating the color intensity value from the illumination contribution value of the target illumination path. L represents the comprehensive illumination contribution value of the pixel obtained by assigning the average path importance parameter of each relevant illumination path to the color type value of the target illumination path.

[0119] In the above embodiment, the color intensity value in the illumination contribution value of the relevant illumination path is converted into the color brightness value corresponding to the relevant illumination path, and the path importance parameter of the relevant illumination path is determined based on the color brightness value corresponding to the relevant illumination path. Then, the path importance parameters of each relevant illumination path of the pixel point are averaged to obtain the average path importance parameter of each relevant illumination path, thereby providing a method for characterizing the average intensity of color based on brightness.

[0120] In one embodiment, the first lighting path and the second lighting path include indirect lighting paths obtained by performing indirect lighting sampling on pixel points; wherein the indirect lighting path is a lighting path formed when light emitted by a virtual light source in a virtual scene is reflected or refracted by a virtual object in the virtual scene.

[0121] In one embodiment, as shown in FIG6 , a computer device can enable an indirect lighting sampling mode through a parameter configuration interface. When the indirect lighting sampling mode is enabled, for each pixel in the virtual scene, the computer device can select a first candidate indirect lighting path from multiple first indirect lighting paths for the pixel, with the probability of the first indirect lighting path being selected being positively correlated with the lighting contribution value of the first indirect lighting path. The computer device can also select a second candidate indirect lighting path from multiple second indirect lighting paths for neighboring pixels of the pixel, with the probability of the second indirect lighting path being selected being positively correlated with the lighting contribution value of the second indirect lighting path. Furthermore, the computer device can select a target indirect lighting path from the first candidate indirect lighting paths and the second candidate indirect lighting paths, and determine the lighting contribution provided by the relevant indirect lighting path to the pixel with reference to the lighting contribution value of the target indirect lighting path, thereby obtaining a corresponding comprehensive lighting contribution value for the pixel. Furthermore, the computer device can pre-bake a lightmap corresponding to the virtual scene based on the comprehensive lighting contribution values ​​corresponding to each pixel in the virtual scene. It will be understood that the lightmap is used to record the comprehensive lighting contribution value of each pixel in the virtual scene. Furthermore, when receiving a rendering instruction, the computer device can perform lighting rendering on each pixel in the virtual scene according to the comprehensive lighting contribution value of each pixel in the virtual scene recorded in the pre-baked light map, which can improve the rendering efficiency of the virtual scene.

[0122] In the above embodiment, an indirect lighting path sampling method suitable for indirect lighting sampling is provided. The indirect lighting path sampling method of this embodiment can improve the rendering quality of virtual scenes, especially the rendering quality of virtual scenes with difficult lighting conditions, i.e., insufficient direct lighting.

[0123] In one embodiment, the first illumination path and the second illumination path include direct illumination paths obtained by performing direct illumination sampling on pixel points, wherein the direct illumination paths are illumination paths formed by light rays directly emitted by virtual light sources in the virtual scene.

[0124] In one embodiment, part (a1) of FIG7 shows the lighting effect of a virtual scene before denoising, obtained by a traditional lighting rendering method, when the number of lighting paths sampled for a pixel is 64. Part (a2) of FIG7 shows the lighting effect of a virtual scene after denoising, obtained by a traditional lighting rendering method, when the number of lighting paths sampled for a pixel is 64. It can be seen that when a virtual scene is rendered using a traditional lighting rendering method, if the number of sampled lighting paths is insufficient, even if denoising is performed on the rendered virtual scene image, the quality of the denoised image is still poor. Part (b1) of FIG7 shows the lighting effect of a virtual scene before denoising, obtained by a traditional lighting rendering method, when the number of sampled lighting paths for a pixel is 512. Part (b2) of FIG7 shows the lighting effect of a virtual scene after denoising, obtained by a traditional lighting rendering method, when the number of sampled lighting paths for a pixel is 512. It can be seen that when the virtual scene is rendered by the traditional lighting rendering method, when the number of sampled lighting paths is slightly increased, even if the rendered virtual scene image is denoised, the image quality after denoising is not significantly improved. Part (c1) in Figure 7 shows the lighting effect of the virtual scene before denoising, obtained based on the lighting rendering method of the present application, when the number of sampled lighting paths for the pixel points is 64. Part (c2) in Figure 7 shows the lighting effect of the virtual scene after denoising, obtained based on the lighting rendering method of the present application, when the number of sampled lighting paths for the pixel points is 64. It can be seen that when the virtual scene is rendered by the lighting rendering method of the present application, when the number of sampled lighting paths is insufficient, even if the rendered virtual scene image is not denoised, the image quality before denoising is significantly improved. After denoising the rendered virtual scene image, the image quality after denoising is even more significantly improved.

[0125] In one embodiment, the lighting conditions of the virtual scene are good, that is, there is sufficient direct light, for example, the well-lit virtual room A and virtual room B shown in Figure 8. Part (a1) in Figure 8 shows the lighting effect of virtual room A obtained based on the traditional lighting rendering method when the number of sampled lighting paths for the pixels in virtual room A is 768. It can be seen that when the traditional lighting rendering method is used to render virtual room A, the lighting rendering effect of virtual room A is better when a large number of sampled lighting paths are used. However, sampling a large number of lighting paths will reduce rendering efficiency. Part (a2) in Figure 8 shows the lighting effect of virtual room A obtained based on the lighting rendering method of the present application when the number of sampled lighting paths for the pixels in virtual room A is 64. It can be seen that when the lighting rendering method of the present application is used to render virtual room A, the lighting rendering effect of virtual room A is also good when a small number of sampled lighting paths are used. Part (b1) in Figure 8 shows the lighting effect of the virtual room B obtained based on the traditional lighting rendering method when the number of sampled lighting paths for the pixel points in the virtual room B is 768. It can be seen that when the virtual room B is rendered by the traditional lighting rendering method, the lighting rendering effect of the virtual room B is better when the number of sampled lighting paths is large. However, sampling more lighting paths will reduce the rendering efficiency. Part (b2) in Figure 8 shows the lighting effect of the virtual room B obtained based on the lighting rendering method of the present application when the number of sampled lighting paths for the pixel points in the virtual room B is 64. It can be seen that when the virtual room B is rendered by the lighting rendering method of the present application, the lighting rendering effect of the virtual room B is also very good when the number of sampled lighting paths is small. In summary, by performing lighting rendering on the virtual scene using the lighting rendering method of the present application, the rendering quality can be improved while ensuring the rendering efficiency.

[0126] In one embodiment, as shown in FIG9 , a virtual scene is subjected to difficult lighting conditions, i.e., insufficient direct lighting. For example, in FIG9 , the insufficiently lit virtual room C is shown. Part (a1) in FIG9 shows the lighting effect of virtual room C obtained using a traditional lighting rendering method before denoising, when 768 lighting paths are sampled for pixels in virtual room C. It can be seen that when the traditional lighting rendering method is used to render virtual room C, the lighting rendering effect of the insufficiently lit virtual room C is relatively poor when a large number of lighting paths are sampled. Part (a2) in FIG9 shows the lighting effect of virtual room C obtained using a traditional lighting rendering method after denoising, when 768 lighting paths are sampled for pixels in virtual room C. It can be seen that when the traditional lighting rendering method is used to render virtual room C, the lighting rendering effect of the insufficiently lit virtual room C is still relatively poor even if denoising is performed on the rendered image.

[0127] Part (b1) of Figure 9 shows the lighting effect of virtual room C before denoising, obtained using the lighting rendering method of the present application, when the number of sampled lighting paths for the pixels in virtual room C is 768. It can be seen that when the lighting rendering method of the present application is used to render virtual room C, the lighting rendering effect of virtual room C with insufficient lighting is also relatively good, given the same number of sampled lighting paths. Part (b2) of Figure 9 shows the lighting effect of virtual room C after denoising, obtained using the lighting rendering method of the present application, when the number of sampled lighting paths for the pixels in virtual room C is 768. It can be seen that when the lighting rendering method of the present application is used to render virtual room C, the lighting rendering effect of virtual room C with insufficient lighting can be further improved by denoising the rendered image, given the same number of sampled lighting paths. In summary, the lighting path sampling method of the present application can improve the rendering quality of virtual scenes, especially those with difficult lighting conditions, i.e., those with insufficient direct lighting.

[0128] As shown in FIG10 , in one embodiment, a lighting rendering method is provided. The method can be applied to a computer device, which can be a terminal or a server. The method can be executed independently by the terminal or server itself, or through interaction between the terminal and the server. This embodiment uses the method applied to a computer device as an example to illustrate the method. The method specifically includes the following steps:

[0129] Step 1002 : For each pixel point in the virtual scene, perform path sampling for this round on the pixel point to obtain a first indirect illumination path of this round of sampling.

[0130] Step 1004 : Determine the path importance parameter of the first indirect lighting path sampled in this round according to the lighting contribution value of the first indirect lighting path sampled in this round; the path importance parameter of the first indirect lighting path is positively correlated with the lighting contribution value of the first indirect lighting path.

[0131] Step 1006 : Determine the path importance parameter of the first indirect lighting path selected in the previous round according to the lighting contribution value of the first indirect lighting path selected in the previous round.

[0132] Step 1008: Obtain the first selected random number corresponding to this round.

[0133] Step 1010: Determine the value range of the first selected random number based on the value range mapped by the path importance parameter of the first indirect lighting path sampled in this round and the value range mapped by the path importance parameter of the first indirect lighting path selected in the previous round. Select a new first indirect lighting path from the first indirect lighting path sampled in this round and the first indirect lighting path selected in the previous round based on the value range of the first selected random number. Use the new first indirect lighting path as the first indirect lighting path selected in this round.

[0134] Step 1012: take the next round as the new round, return to the step of sampling the path of the pixel points in this round to obtain the first indirect lighting path sampled in this round to continue execution until the first sampling stop condition is met, and take the first indirect lighting path selected in the last round as the first candidate indirect lighting path.

[0135] Step 1014: for each pixel point in the virtual scene, determine at least one initial neighboring pixel point of the pixel point from the virtual scene.

[0136] In step 1016, for each initial neighborhood pixel point, if there is no occlusion between the initial neighborhood pixel point and the bounce pixel point, the initial neighborhood pixel point is used as the neighborhood pixel point of the pixel point; the bounce pixel point is the first pixel point that is bounced on the first indirect lighting path.

[0137] Step 1018: For each neighboring pixel of the pixel point, perform path sampling for the neighboring pixel point in this round to obtain a second indirect lighting path of this round of sampling.

[0138] Step 1020: Determine the path importance parameter of the second indirect lighting path sampled in this round according to the lighting contribution value of the second indirect lighting path sampled in this round; the path importance parameter of the second indirect lighting path is positively correlated with the lighting contribution value of the second indirect lighting path.

[0139] Step 1022: Determine the path importance parameter of the second indirect lighting path selected in the previous round according to the lighting contribution value of the second indirect lighting path selected in the previous round.

[0140] Step 1024: Obtain the second selected random number corresponding to this round.

[0141] Step 1026: Determine the value range of the second selected random number based on the value range mapped by the path importance parameter of the second indirect lighting path sampled in this round and the value range mapped by the path importance parameter of the second indirect lighting path selected in the previous round. Select a new second indirect lighting path from the second indirect lighting path sampled in this round and the second indirect lighting path selected in the previous round based on the value range of the second selected random number, and use the new second indirect lighting path as the second indirect lighting path selected in this round.

[0142] Step 1028: Take the next round as the new round, return to the step of sampling the path of the current round for the neighboring pixel points to obtain the second indirect lighting path of the current round sampling to continue execution until the second sampling stop condition is met, and take the second indirect lighting path selected in the last round as the second candidate indirect lighting path.

[0143] Step 1030, selecting a target indirect lighting path from the candidate path set; the first candidate indirect lighting path and the second candidate indirect lighting path constitute the candidate path set; the probability of each candidate indirect lighting path in the candidate path set being selected is positively correlated with the lighting contribution value of the candidate indirect lighting path.

[0144] Step 1032, based on the path importance parameter of the target indirect lighting path, eliminate the color intensity value in the lighting contribution value of the target indirect lighting path to obtain the color type value of the target indirect lighting path; the path importance parameter of the target indirect lighting path is used to characterize the intensity of the color in the lighting contribution value of the target indirect lighting path.

[0145] In step 1034, the average path importance parameter of each relevant indirect lighting path for the pixel is assigned to the color type value of the target indirect lighting path to obtain the corresponding comprehensive lighting contribution value of the pixel. The average path importance parameter is used to represent the average intensity of the colors in the lighting contribution values ​​of each relevant indirect lighting path. The relevant indirect lighting paths include the first indirect lighting path and the second indirect lighting path.

[0146] Step 1036 , using the comprehensive illumination contribution value of each pixel in the virtual scene, perform illumination rendering on each pixel in the virtual scene.

[0147] The present application also provides an application scenario, which applies the above-mentioned lighting rendering method. Specifically, the lighting rendering method can be applied to the lighting rendering scene of virtual objects in the game. It can be understood that the virtual scene in the present application includes the game scene, and the virtual objects in the game scene may include at least one of the game characters and virtual objects in the game. The virtual objects in the game may include at least one of the virtual rooms, virtual desk lamps, virtual plants and virtual animals in the game. Specifically, for each pixel point in the game scene, the path sampling of this round is performed on the pixel point to obtain the first indirect lighting path sampled in this round. According to the lighting contribution value of the first indirect lighting path sampled in this round, the path importance parameter of the first indirect lighting path sampled in this round is determined. According to the lighting contribution value of the first indirect lighting path selected in the previous round, the path importance parameter of the first indirect lighting path selected in the previous round is determined. The first selected random number corresponding to this round is obtained. Based on the first selected random number, the path importance parameter of the first indirect lighting path sampled in this round, and the path importance parameter of the first indirect lighting path selected in the previous round, a new first indirect lighting path is selected from the first indirect lighting path sampled in this round and the first indirect lighting path selected in the previous round, and the new first indirect lighting path is used as the first indirect lighting path selected in this round. The next round is used as the new current round, and the process returns to the step of performing path sampling on the pixel points in this round to obtain the first indirect lighting path sampled in this round to continue execution until the first sampling stop condition is met, at which point the first indirect lighting path selected in the last round is used as the first candidate indirect lighting path.

[0148] For each pixel in the game scene, determine at least one initial neighboring pixel of the pixel from the game scene. For each initial neighboring pixel, if there is no occlusion between the initial neighboring pixel and the ejected pixel, the initial neighboring pixel is used as the neighboring pixel of the pixel; the ejected pixel is the first pixel on the first indirect lighting path that is ejected. For each neighboring pixel of the pixel, perform path sampling for the neighboring pixel in this round to obtain the second indirect lighting path sampled in this round. According to the illumination contribution value of the second indirect lighting path sampled in this round, determine the path importance parameter of the second indirect lighting path sampled in this round. According to the illumination contribution value of the second indirect lighting path selected in the previous round, determine the path importance parameter of the second indirect lighting path selected in the previous round. Get the second selected random number corresponding to this round. Based on the value range mapped by the path importance parameter of the second indirect lighting path sampled in this round and the value range mapped by the path importance parameter of the second indirect lighting path selected in the previous round, the value range of the second selected random number is determined. Based on the value range of the second selected random number, a new second indirect lighting path is selected from the second indirect lighting path sampled in this round and the second indirect lighting path selected in the previous round, and the new second indirect lighting path is used as the second indirect lighting path selected in this round. The next round is used as the new current round, and the step of performing path sampling for the neighboring pixels in this round to obtain the second indirect lighting path sampled in this round is returned to continue execution until the second sampling stop condition is met, at which point the second indirect lighting path selected in the last round is used as the second candidate indirect lighting path.

[0149] A target indirect lighting path is selected from a candidate path set; the first candidate indirect lighting path and the second candidate indirect lighting path form the candidate path set; the probability of each candidate indirect lighting path in the candidate path set being selected is positively correlated with the lighting contribution value of the candidate indirect lighting path. Based on the path importance parameter of the target indirect lighting path, the color intensity value in the lighting contribution value of the target indirect lighting path is eliminated to obtain the color type value of the target indirect lighting path; the path importance parameter of the target indirect lighting path is used to characterize the intensity of the color in the lighting contribution value of the target indirect lighting path. The average path importance parameter of each related indirect lighting path of the pixel point is assigned to the color type value of the target indirect lighting path to obtain the corresponding comprehensive lighting contribution value of the pixel point; the average path importance parameter is used to characterize the average intensity of the color in the lighting contribution value of each related indirect lighting path. The related indirect lighting paths include the first indirect lighting path and the second indirect lighting path; the comprehensive lighting contribution value is used to perform lighting rendering on the corresponding pixel point in the game scene. The lighting rendering method of the present application can improve the lighting rendering quality of virtual objects in the game scene, making the lighting rendering effect of virtual objects in the game scene more realistic. For example, the lighting rendering method of the present application can improve the lighting rendering quality of virtual objects such as virtual rooms, virtual lamps, virtual plants, and virtual animals in the game scene, making virtual objects such as virtual rooms, virtual lamps, virtual plants, and virtual animals have more realistic lighting rendering effects.

[0150] This application also provides some application scenarios, which apply the above-mentioned lighting rendering method. Specifically, the lighting rendering method can also be applied to scenes such as film and television special effects, visual design, VR (Virtual Reality), industrial simulation and digital cultural creation. It can be understood that in scenes such as film and television special effects, visual design, VR (Virtual Reality), industrial simulation and digital cultural creation, lighting rendering for virtual scenes may also be involved. Through the lighting rendering method of this application, the rendering quality for scenes such as film and television special effects, visual design, VR (Virtual Reality), industrial simulation and digital cultural creation can be improved.

[0151] It should be understood that, although the various steps in the flow chart of the above-mentioned embodiments are shown in sequence, these steps are not necessarily performed in sequence. Unless clearly stated herein, the execution of these steps does not have strict order restrictions, and these steps can be performed in other sequences. Moreover, at least a portion of the steps in the above-mentioned embodiments may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0152] In one embodiment, as shown in FIG11 , a lighting rendering apparatus 1100 is provided, which specifically includes:

[0153] The selection module 1102 is used to determine, for each pixel point in the virtual scene, multiple first illumination paths obtained by sampling the illumination paths of the pixel point, and select a first candidate illumination path from the multiple first illumination paths according to the probability of each of the multiple first illumination paths being selected; the probability of each of the multiple first illumination paths being selected is positively correlated with the illumination contribution value of each of the multiple first illumination paths; determine the neighborhood pixels of the pixel point, and determine multiple second illumination paths obtained by sampling the illumination paths of the neighborhood pixels, and select a second candidate illumination path from the multiple second illumination paths according to the probability of each of the multiple second illumination paths being selected; the probability of each of the multiple second illumination paths being selected is positively correlated with the illumination contribution value of each of the multiple second illumination paths; and select a target illumination path from the first candidate illumination paths and the second candidate illumination paths.

[0154] Rendering module 1104 is used to determine the relevant lighting path of the pixel point, refer to the lighting contribution value of the target lighting path, determine the lighting contribution provided by the relevant lighting path to the pixel point, and obtain the comprehensive lighting contribution value of the pixel point; the relevant lighting path includes a first lighting path and a second lighting path; use the comprehensive lighting contribution value of each pixel point in the virtual scene to perform lighting rendering on each pixel point in the virtual scene.

[0155] In one embodiment, the selection module 1102 is also used to perform path sampling for each pixel point in the virtual scene in this round to obtain the first illumination path sampled in this round; from the first illumination path sampled in this round and the first illumination path selected in the previous round, a new first illumination path is selected according to the probability of the first illumination path sampled in this round and the first illumination path selected in the previous round being selected, and the new first illumination path is used as the first illumination path selected in this round; the next round is used as the new round, and the step of performing path sampling for the pixel point in this round to obtain the first illumination path sampled in this round is returned to continue execution until the first sampling stop condition is met, and the first illumination path selected in the last round is used as the first candidate illumination path.

[0156] In one embodiment, the selection module 1102 is further used to determine the path importance parameter of the first illumination path sampled in this round based on the illumination contribution value of the first illumination path sampled in this round; determine the path importance parameter of the first illumination path selected in the previous round based on the illumination contribution value of the first illumination path selected in the previous round; obtain the first selected random number corresponding to this round; determine the value range to which the first selected random number belongs based on the value range mapped by the path importance parameter of the first illumination path sampled in this round and the value range mapped by the path importance parameter of the first illumination path selected in the previous round, and select a new first illumination path from the first illumination path sampled in this round and the first illumination path selected in the previous round based on the value range to which the first selected random number belongs. Wherein, the path importance parameter is positively correlated with the size of the mapped value range.

[0157] In one embodiment, the first lighting path selected in the previous round is stored in the path storage container corresponding to the pixel point; the selection module 1102 is also used to use the new first lighting path as the first lighting path selected in this round, and replace the first lighting path selected in the previous round in the path storage container corresponding to the pixel point with the first lighting path selected in this round.

[0158] In one embodiment, the selection module 1102 is also used to perform path sampling for each neighboring pixel point of the pixel point in this round to obtain the second illumination path sampled in this round; from the second illumination path sampled in this round and the second illumination path selected in the previous round, a new second illumination path is selected according to the probability of the second illumination path sampled in this round and the second illumination path selected in the previous round being selected, and the new second illumination path is used as the second illumination path selected in this round; the next round is used as the new round, and the step of performing path sampling for the neighboring pixel points in this round to obtain the second illumination path sampled in this round is returned to continue execution until the second sampling stop condition is met, and the second illumination path selected in the last round is used as the second candidate illumination path.

[0159] In one embodiment, the selection module 1102 is further used to determine the path importance parameter of the second illumination path sampled in this round based on the illumination contribution value of the second illumination path sampled in this round; determine the path importance parameter of the second illumination path selected in the previous round based on the illumination contribution value of the second illumination path selected in the previous round; obtain the second selected random number corresponding to this round; determine the value range to which the second selected random number belongs based on the value range mapped by the path importance parameter of the second illumination path sampled in this round and the value range mapped by the path importance parameter of the second illumination path selected in the previous round, and select a new second illumination path from the second illumination path sampled in this round and the second illumination path selected in the previous round based on the value range to which the second selected random number belongs. Among them, the path importance parameter is positively correlated with the size of the mapped value range.

[0160] In one embodiment, the selection module 1102 is also used to determine at least one initial neighboring pixel point of the pixel point from the virtual scene for each pixel point in the virtual scene; for each initial neighboring pixel point, if there is no occlusion between the initial neighboring pixel point and the ejection pixel point, the initial neighboring pixel point is used as the neighboring pixel point of the pixel point; wherein the ejection pixel point is the first pixel point that is ejected on the first illumination path.

[0161] In one embodiment, the first candidate lighting path and the second candidate lighting path constitute a candidate path set; the selection module 1102 is further used to select a target lighting path from the candidate path set; wherein, the probability of each candidate lighting path in the candidate path set being selected is positively correlated with the lighting contribution value of the candidate lighting path.

[0162] In one embodiment, the rendering module 1104 is also used to eliminate the color intensity value in the illumination contribution value of the target illumination path based on the path importance parameter of the target illumination path to obtain the color type value of the target illumination path; the path importance parameter of the target illumination path is used to characterize the intensity of the color in the illumination contribution value of the target illumination path; the average path importance parameter of each related illumination path of the pixel point is assigned to the color type value of the target illumination path to obtain the corresponding comprehensive illumination contribution value of the pixel point; wherein, the average path importance parameter is used to characterize the average intensity of the color in the illumination contribution value of each related illumination path.

[0163] In one embodiment, the rendering module 1104 is further used to convert the color intensity value in the illumination contribution value of the target illumination path into the color brightness value corresponding to the target illumination path; and determine the path importance parameter of the target illumination path based on the color brightness value corresponding to the target illumination path.

[0164] In one embodiment, the rendering module 1104 is also used to convert the color intensity value in the illumination contribution value of each relevant illumination path of the pixel point into a color brightness value corresponding to the relevant illumination path; determine the path importance parameter of the relevant illumination path based on the color brightness value corresponding to the relevant illumination path; and average the path importance parameters of each relevant illumination path of the pixel point to obtain the average path importance parameter of each relevant illumination path.

[0165] In one embodiment, the first lighting path and the second lighting path include indirect lighting paths obtained by performing indirect lighting sampling on pixel points; wherein the indirect lighting path is a lighting path formed when light emitted by a virtual light source in a virtual scene is reflected or refracted by a virtual object in the virtual scene.

[0166] The above-mentioned illumination rendering device, for each pixel in a virtual scene, determines multiple first illumination paths obtained by illumination path sampling for the pixel, and selects a first candidate illumination path from the multiple first illumination paths based on the probability of each of the multiple first illumination paths being selected. The probability of each of the multiple first illumination paths being selected is positively correlated with the illumination contribution values ​​of each of the multiple first illumination paths. It is understood that the greater the illumination contribution provided by a first illumination path to the pixel, the more important the first illumination path is to the pixel, and the greater the probability of its selection. Neighboring pixels of the pixel are determined, and multiple second illumination paths obtained by illumination path sampling for the neighboring pixels are determined. A second candidate illumination path is selected from the multiple second illumination paths based on the probability of each of the multiple second illumination paths being selected. The probability of each of the multiple second illumination paths being selected is positively correlated with the illumination contribution values ​​of each of the multiple second illumination paths. It is understood that the greater the illumination contribution provided by a second illumination path to the neighborhood pixel, the more important the second illumination path is to the neighborhood pixel, and the greater the probability of its selection. A target lighting path is selected from the first candidate lighting path and the second candidate lighting path, and the relevant lighting path of the pixel is determined. With reference to the lighting contribution value of the target lighting path, the lighting contribution provided by the relevant lighting path to the pixel is determined to obtain the comprehensive lighting contribution value of the pixel. The comprehensive lighting contribution value of each pixel in the virtual scene is used to perform lighting rendering on each pixel in the virtual scene. Since the relevant lighting path includes the first lighting path and the second lighting path, compared with the traditional method of integrating the lighting contribution values ​​provided by the lighting paths obtained by uniformly sampling the pixels to perform lighting rendering on the virtual scene, the present application calculates the comprehensive lighting contribution values ​​provided by each relevant lighting path corresponding to the pixel point and its neighboring pixels to perform lighting rendering on the pixel by referring to the lighting contribution values ​​of the selected lighting paths with higher importance, thereby improving the rendering quality when the number of lighting paths sampled for the pixel point is small.

[0167] Each module in the aforementioned lighting rendering device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a computer device memory in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0168] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in Figure 12. The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, memory, and input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a lighting rendering method.

[0169] In one embodiment, a computer device is provided, which may be a terminal. Its internal structure diagram may be as shown in FIG13 . The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and an external device. The communication interface of the computer device is configured to communicate with an external terminal via wired or wireless communication, where the wireless communication may be achieved via Wi-Fi, a mobile cellular network, NFC (near-field communication), or other technologies. When executed by the processor, the computer program implements a lighting rendering method. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0170] Those skilled in the art will understand that the structures shown in Figures 12 and 13 are merely block diagrams of partial structures related to the solution of the present application, and do not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figures, or combine certain components, or have a different component arrangement.

[0171] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0172] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor.

[0173] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0174] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.

[0175] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0176] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0177] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A lighting rendering method, executed by a computer device, comprising: For each pixel point in the virtual scene, determine a plurality of first illumination paths obtained by performing illumination path sampling on the pixel point, and select a first candidate illumination path from the plurality of first illumination paths according to a probability that each of the plurality of first illumination paths is selected; The probability of each of the plurality of first illumination paths being selected is positively correlated with the illumination contribution value of each of the plurality of first illumination paths; Determine a neighborhood pixel point of the pixel point, and determine a plurality of second illumination paths obtained by performing illumination path sampling on the neighborhood pixel point, and select a second candidate illumination path from the plurality of second illumination paths according to a probability that each of the plurality of second illumination paths is selected; The probability of each of the plurality of second illumination paths being selected is positively correlated with the illumination contribution value of each of the plurality of second illumination paths; Selecting a target lighting path from the first candidate lighting path and the second candidate lighting path; Determine a relevant illumination path of the pixel point, refer to the illumination contribution value of the target illumination path, determine the illumination contribution provided by the relevant illumination path to the pixel point, and obtain a comprehensive illumination contribution value of the pixel point; the relevant illumination path includes the first illumination path and the second illumination path; and Using the comprehensive illumination contribution value of each pixel in the virtual scene, illumination rendering is performed on each pixel in the virtual scene.

2. The method according to claim 1, wherein for each pixel point in the virtual scene, determining a plurality of first illumination paths obtained by performing illumination path sampling on the pixel point, and selecting a first candidate illumination path from the plurality of first illumination paths according to the probability of each of the plurality of first illumination paths being selected, comprises: For each pixel point in the virtual scene, perform path sampling for this round on the pixel point to obtain a first illumination path for this round of sampling; From the first illumination path sampled in this round and the first illumination path selected in the previous round, a new first illumination path is selected according to the probability of the first illumination path sampled in this round and the first illumination path selected in the previous round being selected respectively, and the new first illumination path is used as the first illumination path selected in this round; Take the next round as the new round, return to the step of performing path sampling for the pixel point in this round to obtain the first illumination path sampled in this round to continue execution until the first sampling stop condition is met, and take the first illumination path selected in the last round as the first candidate illumination path.

3. The method according to claim 2, wherein the step of selecting a new first illumination path from the first illumination paths sampled in the current round and the first illumination paths selected in the previous round according to the probability of the first illumination paths sampled in the current round and the first illumination paths selected in the previous round being selected comprises: Determine the path importance parameter of the first illumination path sampled in this round according to the illumination contribution value of the first illumination path sampled in this round; Determine the path importance parameter of the first illumination path selected in the previous round according to the illumination contribution value of the first illumination path selected in the previous round; Get the first selected random number corresponding to this round; According to the value range mapped by the path importance parameter of the first illumination path sampled in this round and the value range mapped by the path importance parameter of the first illumination path selected in the previous round, the value range to which the first selected random number belongs is determined, and according to the value range to which the first selected random number belongs, a new first illumination path is selected from the first illumination path sampled in this round and the first illumination path selected in the previous round; wherein the path importance parameter is positively correlated with the size of the mapped value range.

4. According to the method of claim 2 or 3, the first illumination path selected in the previous round is stored in the path storage container corresponding to the pixel point; The step of using the new first illumination path as the first illumination path selected in this round includes: The new first illumination path is used as the first illumination path selected in this round, and the first illumination path selected in the previous round in the path storage container corresponding to the pixel point is replaced with the first illumination path selected in this round.

5. According to the method according to any one of claims 1 to 4, determining the neighborhood pixel points of the pixel point, and determining multiple second illumination paths obtained by performing illumination path sampling on the neighborhood pixel points, and selecting a second candidate illumination path from the multiple second illumination paths according to the probability of each of the multiple second illumination paths being selected, comprises: For each neighboring pixel point of the pixel point, perform path sampling of this round for the neighboring pixel point to obtain a second illumination path of this round of sampling; From the second illumination path sampled in this round and the second illumination path selected in the previous round, a new second illumination path is selected according to the probability of the second illumination path sampled in this round and the second illumination path selected in the previous round being selected respectively, and the new second illumination path is used as the second illumination path selected in this round; Take the next round as the new round, return to the step of performing path sampling for the neighborhood pixel points in this round to obtain the second illumination path sampled in this round to continue execution until the second sampling stop condition is met, and take the second illumination path selected in the last round as the second candidate illumination path.

6. The method according to claim 5, wherein the selecting a new second illumination path from the second illumination path sampled in the current round and the second illumination path selected in the previous round according to the probability of the second illumination path sampled in the current round and the second illumination path selected in the previous round being selected respectively comprises: Determine the path importance parameter of the second illumination path sampled in this round according to the illumination contribution value of the second illumination path sampled in this round; Determine the path importance parameter of the second illumination path selected in the previous round according to the illumination contribution value of the second illumination path selected in the previous round; Get the second selected random number corresponding to this round; According to the value range mapped by the path importance parameter of the second illumination path sampled in this round and the value range mapped by the path importance parameter of the second illumination path selected in the previous round, the value range to which the second selected random number belongs is determined, and according to the value range to which the second selected random number belongs, a new second illumination path is selected from the second illumination path sampled in this round and the second illumination path selected in the previous round; wherein the path importance parameter is positively correlated with the size of the mapped value range.

7. The method according to any one of claims 1 to 6, further comprising: For each pixel point in the virtual scene, determining at least one initial neighborhood pixel point of the pixel point from the virtual scene; For each initial neighborhood pixel point, if there is no occlusion between the initial neighborhood pixel point and the ejected pixel point, the initial neighborhood pixel point is used as the neighborhood pixel point of the pixel point; The ejection pixel point is the first pixel point on the first illumination path that is ejected.

8. The method according to any one of claims 1 to 7, wherein the first candidate illumination path and the second candidate illumination path constitute a candidate path set; and the step of selecting a target illumination path from the first candidate illumination path and the second candidate illumination path comprises: Selecting a target illumination path from the set of candidate paths; The probability of each candidate illumination path in the candidate path set being selected is positively correlated with the illumination contribution value of the candidate illumination path.

9. The method according to any one of claims 1 to 8, wherein referring to the illumination contribution value of the target illumination path, determining the illumination contribution provided by the relevant illumination path to the pixel point, and obtaining the comprehensive illumination contribution value of the pixel point comprises: Based on the path importance parameter of the target illumination path, eliminating the color intensity value in the illumination contribution value of the target illumination path to obtain the color type value of the target illumination path; The path importance parameter of the target illumination path is used to characterize the intensity of the color in the illumination contribution value of the target illumination path; Assigning the average path importance parameter of each relevant illumination path of the pixel point to the color type value of the target illumination path to obtain the corresponding comprehensive illumination contribution value of the pixel point; The average path importance parameter is used to characterize the average intensity of the colors in the illumination contribution values ​​of the relevant illumination paths.

10. The method according to claim 9, further comprising: Converting the color intensity value in the illumination contribution value of the target illumination path into the color brightness value corresponding to the target illumination path; A path importance parameter of the target illumination path is determined according to the color brightness value corresponding to the target illumination path.

11. The method according to claim 9 or 10, further comprising: For each relevant illumination path of the pixel point, converting a color intensity value in an illumination contribution value of the relevant illumination path into a color brightness value corresponding to the relevant illumination path; Determining a path importance parameter of the relevant illumination path according to a color brightness value corresponding to the relevant illumination path; The path importance parameters of the relevant illumination paths of the pixel point are averaged to obtain the average path importance parameters of the relevant illumination paths.

12. The method according to any one of claims 1 to 11, wherein the first illumination path and the second illumination path comprise indirect illumination paths obtained by performing indirect illumination sampling on the pixel points; in, The indirect lighting path is a lighting path formed after the light emitted by the virtual light source in the virtual scene is reflected or refracted by the virtual object in the virtual scene.

13. A lighting rendering device, comprising: A selection module is used to determine, for each pixel point in the virtual scene, a plurality of first illumination paths obtained by performing illumination path sampling on the pixel point, and select a first candidate illumination path from the plurality of first illumination paths according to the probability of each of the plurality of first illumination paths being selected; the probability of each of the plurality of first illumination paths being selected is positively correlated with the illumination contribution value of each of the plurality of first illumination paths; Determine a neighborhood pixel point of the pixel point, and determine a plurality of second illumination paths obtained by performing illumination path sampling on the neighborhood pixel point, and select a second candidate illumination path from the plurality of second illumination paths according to a probability that each of the plurality of second illumination paths is selected; The probability of each of the plurality of second illumination paths being selected is positively correlated with the illumination contribution value of each of the plurality of second illumination paths; Selecting a target lighting path from the first candidate lighting path and the second candidate lighting path; and a rendering module, configured to determine a relevant illumination path of the pixel point, determine an illumination contribution provided by the relevant illumination path to the pixel point with reference to an illumination contribution value of the target illumination path, and obtain a comprehensive illumination contribution value of the pixel point; the relevant illumination path includes the first illumination path and the second illumination path; Using the comprehensive illumination contribution value of each pixel in the virtual scene, illumination rendering is performed on each pixel in the virtual scene.

14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.

16. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Rendering method and device

    CN111354066A

  • Global illumination using shared lighting contributions for interactions in path tracing

    CN112840378A

  • Image rendering method and device, electronic equipment and storage medium

    CN115496845A

  • Illumination rendering method and device, equipment and medium

    CN116612225A

  • Rendering images using color contribution values of render elements

    US20170109898A1