A multi-light-source direct illumination rendering method and system based on multiple control variables
By dividing the integral domain into multiple subdomains and employing a multi-control variable method, the problem of low rendering efficiency in complex scenes with multiple light sources is solved, achieving higher quality image rendering and faster rendering speed.
Patent Information
- Application Number
- CN202411926833.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-12-25
AI Technical Summary
Traditional direct lighting rendering methods are inefficient in complex scenes with multiple light sources and are prone to generating significant noise. Single-control variable methods cannot effectively handle the discontinuity of integral functions, resulting in low computational efficiency and poor image quality.
The method of multiple control variables is adopted to divide the integral domain into multiple non-overlapping subdomains. Each subdomain contains one or more light sources. The control variables of the low-order polynomial are sampled independently in each subdomain. The control variables are fitted by the least squares regression method, the integral value of each control variable is calculated, and the weighted fusion is performed based on the weights to finally obtain the scene rendering result.
It effectively reduces the variance of integral estimation, improves image quality, has wider applicability to handling complex integral problems, and enhances computational efficiency and the speed and quality of image/scene rendering.
Smart Images

Figure CN119762660B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of computer graphics and rendering, and particularly relates to a multi-light direct illumination rendering method and system based on multiple control variables. BACKGROUND
[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute prior art.
[0003] Direct illumination is a core component of light computation in computer graphics, which refers to the light contribution that light rays travel from a light source, pass through a single bounce to reach the surface of an object and be seen by an observer, and is commonly used in the field of scene rendering. The traditional Monte Carlo integration method is widely used in direct illumination rendering, but due to its dependence on random sampling, the generated image has large noise and slow convergence speed at low sampling rate.
[0004] In order to improve the convergence speed of Monte Carlo integration, various variance reduction techniques have been introduced in the prior art, such as importance sampling, which improves the integration efficiency by optimizing the sampling probability distribution, multiple importance sampling, which combines multiple sampling strategies to take advantage of each strategy, and regression-based control variable method, which reduces the noise of the result image by approximating the integral function. However, these methods have obvious limitations in complex scenes. For example, when there are a large number of light sources in the scene, resulting in discontinuity of the integral function, the single control variable method is difficult to handle such discontinuity of the integral function, the approximation effect is significantly reduced, resulting in low computational efficiency. SUMMARY
[0005] The present application proposes a multi-light direct illumination rendering method and system based on multiple control variables, which uses multiple control variables to fit different parts of the integral function respectively, thereby reducing the calculation variance and improving the image quality. It can solve the problems of low efficiency, easy to produce significant noise, single control variable method cannot effectively handle multiple discontinuous points in the integral function, and difficult to balance computational efficiency and result quality at low sampling rate in the prior art direct illumination rendering method in complex multi-light scenes.
[0006] According to some embodiments, the present application adopts the following technical scheme:
[0007] A multi-light direct illumination rendering method based on multiple control variables, comprising the following steps:
[0008] According to the number and distribution information of the light sources in the scene, the integral domain is divided into a plurality of disjoint sub-domains, each sub-domain containing one or more light sources;
[0009] In each sub-domain, control variables of low-order polynomials are generated independently, and the sampling data is fitted by least square regression method;
[0010] The integral value of each control variable is calculated, and the corresponding weight is calculated based on the importance of the corresponding sub-domain;
[0011] The integral value is estimated using multiple control variables, and the results of each sub-domain are weighted and fused based on the weights to obtain the final estimated value, and scene rendering is performed according to the final estimated value.
[0012] As an optional implementation, when the number of light sources in the scene is less than a set value, a control variable h i (u) is constructed for each light source, and samples are generated using a uniform light source sampling method, and each control variable is constructed by collecting sample data from its corresponding sample.
[0013] As an optional implementation, the number of each pixel control variable is the same as the number of light sources in the scene, and the weight v i of each control variable is set to the reciprocal of the number of light sources.
[0014] As an optional implementation, for each light source control variable h i (u), the gradient descent method is used to minimize the error by collecting sample data, a first-order polynomial function is fitted, and its corresponding coefficients a i and integral H i are calculated.
[0015] As an optional implementation, when the number of light sources in the scene is greater than or equal to a set value, a hierarchical structure is constructed for all light sources in the scene, a representative point of the pixel is selected to create a light cut, and all light source clusters or single light sources that contribute to the pixel are identified;
[0016] For each light source cluster or single light source, a control variable is constructed, and samples are generated using a light cut-based light source sampling method, and each control variable is constructed by collecting sample data from its corresponding light source cluster or single light source, and the sample data is used to fit the parameters of the control variable.
[0017] As a further implementation, the process of generating samples using a light cut-based light source sampling method includes:
[0018] Starting from a root node containing all the light sources, the nodes are recursively split to form the BVH tree, with a surface area heuristic metric for node splitting, allowing grouping of light sources according to spatial proximity, direction and intensity by considering the light source's bounding cone direction and emitted energy; after construction, each node of the hierarchy stores a spatial bounding box, a directional cone containing the surface normals of all the light sources and the total energy E of these light sources;
[0019] After constructing the light source BVH tree, during path tracing sampling, each shading point is traversed from top to bottom to generate a light cut, which is composed of different node sets in the light source BVH tree, including internal nodes and leaf nodes, representing a cluster of light sources or a single light source that potentially contributes to the current shading point;
[0020] After determining the light cut at each shading point x, the light source cluster is importance sampled to select a certain light source cluster, the importance of which is derived from the spatial and directional boundaries of the light source cluster relative to the shading point x, considering the geometric decay of inverse square distance and the cosine effect of the directional boundary, to recursively sample the light source cluster with a probability proportional to the importance until a leaf node containing a single light source is reached;
[0021] For a single light source in the light source cluster, the light source surface is uniformly sampled according to the standard method to generate light samples.
[0022] As an optional implementation, the process of generating a low-order polynomial control variable for each subdomain includes: the number of pixel control variables varies according to the number of light source clusters or single light sources, and the adaptive construction process of pixel control variables includes:
[0023] Divide the pixel into multiple sub-pixels, select the center of each sub-pixel as its representative point, then emit camera rays from these points to calculate the shading point, and determine the light cut for each shading point;
[0024] Merge the light cuts, and construct a control variable for each light source cluster or single light source after merging, each control variable collects samples from its corresponding light source cluster or single light source, and uses gradient descent method to minimize the error, fit a first-order polynomial function and solve its corresponding coefficients.
[0025] As an optional implementation, the process of estimating the integral value using multiple control variables includes: decomposing the integral domain into multiple non-overlapping sub-regions, sampling multiple samples from each integral layer according to the probability density function in each layer, calculating the Monte Carlo estimate of each integral layer, and obtaining the Monte Carlo estimator converted to the main sampling space;
[0026] According to the Monte Carlo estimates of each integral layer, combined with the volume proportion of each layer, the total estimate is calculated;
[0027] introducing control variable h for each integral layer i (u) with analytical integral, obtaining new control variable integral form, introducing control variable h for each integral layer i (u) is obtained by least square regression fitting using gradient descent method;
[0028] According to the new control variable integral form, the corresponding control variable estimator is calculated;
[0029] According to the corresponding control variable estimator, the multiple control variable estimator on the entire integral domain is combined.
[0030] A multiple control variable based multi-light direct illumination rendering system, comprising:
[0031] The hierarchical module is configured to divide the integral domain into a plurality of disjoint sub-domains according to the number and distribution information of the light sources in the scene, each sub-domain containing one or more light sources;
[0032] The sampling module is configured to independently sample in each sub-domain;
[0033] The multiple control variable construction module is configured to generate a low-order polynomial control variable for each sub-domain, fit the sampling data by the least square regression method, calculate the integral value of each control variable, and calculate the corresponding weight based on the importance of the corresponding sub-domain;
[0034] The final integral estimation module is configured to estimate the integral value using the multiple control variables, weight and fuse the results of each sub-domain based on the weight, obtain the final estimation value, and perform scene rendering according to the final estimation value.
[0035] An electronic device comprising a memory and a processor, and computer instructions stored on the memory and running on the processor, when the computer instructions are run by the processor, the steps in the above method are completed.
[0036] Compared with the prior art, the beneficial effects of the present application are:
[0037] The present application can effectively reduce the variance of integral estimation and generate higher quality images when processing multi-light source scenes by using the multiple control variable method;
[0038] By optimizing the hierarchical and partitioning of the integral domain, the present application can handle complex integral problems with high discontinuity, and has wider scene applicability;
[0039] In the case of a large number of light sources, the present application can still achieve high quality at a low sampling rate, improving the calculation efficiency, and improving the efficiency, speed and quality of image / scene rendering.
[0040] In order to make the above objectives, features and advantages of the present application more obvious and comprehensible, the following preferred embodiments are specifically described below with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0041] The accompanying drawings, which form a part of this specification, are included to provide a further understanding of the application and are incorporated by reference herein. The embodiments illustrated in the drawings are provided merely as examples of the present application and therefore are not to be considered as limiting the present application.
[0042] Figure 1 is a comparison chart of the method provided by an embodiment and the previous Monte Carlo integration method based on a single control variable in solving one-dimensional function integration problems;
[0043] Figure 2 is a flowchart of applying the multiple control variable method in direct illumination rendering in an embodiment;
[0044] Figure 3 is a comparison chart of the same-time direct illumination results of the Veach-mis scene by an embodiment;
[0045] Figure 4 is a schematic diagram of the light source hierarchy and light cut used by an embodiment;
[0046] Figure 5 is a flowchart of the light cut-based light source sampling method used by an embodiment;
[0047] Figure 6 is a schematic diagram of calculating the importance of light source cluster sampling by an embodiment;
[0048] Figure 7 is a comparison chart of the same-time direct illumination results of the Staircase2 scene by an embodiment. DETAILED DESCRIPTION
[0049] The present application will be further described below with reference to the accompanying drawings and embodiments.
[0050] It should be noted that the following detailed description is exemplary in nature and is intended to provide further description of the present application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0051] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments in accordance with the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, elements, components, and / or groups thereof, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof.
[0052] The embodiments in the application and the features in the embodiments can be combined with each other in the case of no conflict.
[0053] Embodiment one
[0054] In this embodiment, a direct lighting calculation method using multiple control variables for a scene with a small number of light sources is proposed, as shown in Figure 2 , which specifically includes the following steps:
[0055] 1) Light source layering and sampling:
[0056] For a scene with a small number of light sources, a control variable h i (u) is constructed for each light source, and a uniform light source sampling method is used to generate samples. Each control variable is constructed by collecting sample data from its corresponding light source, and the sample data is used to fit the parameters of the control variable.
[0057] 2) Multiple control variable construction:
[0058] In this case, the number of control variables for each pixel is the same as the number of light sources in the scene, and the weight v i of each control variable is set to the reciprocal of the number of light sources.
[0059] For the control variable h i (u) of each light source, the gradient descent method is used to minimize the error by using the collected sample data, a first-order polynomial function is fitted, and the corresponding coefficients a i and integral H i are calculated.
[0060] 3) Final integral estimation:
[0061] The final direct lighting estimation value is obtained by the multiple control variable estimator, and based on the direct lighting estimation value, specific scene rendering is performed.
[0062] The specific process of how to use multiple control variables to improve the efficiency of Monte Carlo integration is described in detail below.
[0063] Rendering is to calculate an integral value for each pixel in the image, and the integral problem can be represented as:
[0064]
[0065] In optical transport simulations, the function f(x) represents the measured contribution function of an optical transport path, and Ω represents the path space. The definite integral F provides the solution to the optical transport simulation, which value is usually not available by analytical methods. The Monte Carlo integration provides a numerical solution to this integral by means of random sampling:
[0066]
[0067] where n is the number of samples used to estimate <f> n the number of samples, x i is a random sample drawn according to the probability density function p(x). There exists a mapping x = Φ(u) with the Jacobian |dx / du| = 1 / p(x) that transforms the above integral into the primary sampling space by changing variables:
[0068]
[0069] where U is the unit hypercube space consisting of uniformly distributed random numbers u i that are used to generate samples x i in the primary sampling space. By redefining the integral in the primary sampling space, one can sample the sample u i ~ p(u) = 1 in the unit hypercube space U, and the Monte Carlo estimate of the above integral becomes:
[0070]
[0071] Control variate technique is a technique to reduce the variance of Monte Carlo methods, the basic idea of which is to reduce the variance of the original estimator by introducing one or more auxiliary variables with known expected values and related to the original estimator. By introducing a related function h(u) with known analytical integral H = ∫ U h(u)du, the original integral can be expressed as the sum of the difference integral and the known analytical integral:
[0072]
[0073] where the coefficient a represents the strength of using control variates, and by performing Monte Carlo numerical integration on the difference integral, one can obtain a single control variate estimator:
[0074]
[0075] By minimizing the variance of this estimator, one can obtain the optimal where is the correlation coefficient between and h(u), and Var[h(u)] is the variance of h(u). The stronger the correlation between the introduced control variate function h(u) and the original integrand , the stronger the variance reduction ability of the control variate estimator.
[0076] A polynomial function is chosen as the form of the control variate function used, h(u) can be expressed as:
[0077]
[0078] where It is a monomial, M is the order of the polynomial, and the integral H can be obtained analytically through the weighted sum of monomial integrals:
[0079]
[0080] The least squares regression method can be used to fit a polynomial control variable h(u). First, the polynomial function is modeled as a function with respect to parameters θ=(c0,…,c…). M Let h(u,θ) be a parametric function of u, and define the residual with respect to the parameter θ:
[0081]
[0082] h(u) to The regression involves finding the optimal parameter θ that minimizes the value of R(θ). Next, n random samples u are sampled. i To approximate R(θ), this is equivalent to using an estimator. <r>(θ) to a function Monte Carlo integration is performed.
[0083]
[0084] To obtain <r>The minimum value of (θ) can be solved using a gradient descent method to find the optimal parameter θ, specifically, using the update rule of gradient descent to iteratively update the coefficients θ of the polynomial:
[0085]
[0086] wherein is <r>(θ) Partial derivative with respect to polynomial coefficients, learning rate γ set to 0.01. As before, u i is a Monte Carlo estimator <r>(0) of the random sample, so that only one sample can be used at each update for k = 1,..., n, the gradient update rule above is modified as:
[0087]
[0088] where the short hand represents the residual of each sample, the procedure can be iterated over all samples.
[0089] Next, the theory of the Monte Carlo integration method based on multiple control variables is introduced, which includes the following steps:
[0090] 1) Integration domain stratification
[0091] The integration domain Ω is decomposed into k non-overlapping sub-regions Ω1, Ω2,..., Ω k , satisfying: Then, n i samples are drawn from each layer Ω i according to the probability density function p i . The Monte Carlo estimator for each layer Ω i is:
[0092]
[0093] where X i,j is the jth sample drawn according to the probability density function p i . Similarly, by variable substitution, the Monte Carlo estimator converted to the primary sampling space can be obtained:
[0094]
[0095] Since the probability density function of each layer is different, the corresponding integral functions f1, f2,..., f k of different layers Ω1, Ω2,..., Ω k can be obtained, and the overall estimate is:
[0096]
[0097] where v i ∈ (0, 1] represents the volume proportion of the ith layer. This stratification step can reduce the variance of the original Monte Carlo estimate.
[0098] 2) Multiple control variable integration
[0099] By introducing a control variable h i (u) for each layer Ω i , which has an analytical integral H i = ∫ U h i (u) du, a new control variable integral form can be obtained:
[0100]
[0101] where the coefficients are and h i (u) are the correlation coefficients. Each layer Ω i The control variable h i (u) introduced can be obtained by least square regression fitting using gradient descent method.
[0102] Each layer Ω i After introducing the control variable h i (u), its corresponding control variable estimator is:
[0103]
[0104] The multiple control variable estimator on the entire integral domain Ω is:
[0105]
[0106] Combining the two techniques of layering and control variable, the multiple control variable estimator can simultaneously utilize the advantages of the two techniques, further reducing the variance of Monte Carlo estimation and improving the efficiency of estimation. Figure 1 The Monte Carlo integration method based on multiple control variables in this embodiment is compared with the previous Monte Carlo integration method based on single control variable in solving one-dimensional function integral problem. It can be seen that the method based on multiple control variables constructs multiple low-order polynomial control variables through layering, which is closer to the original integrand than the high-order polynomial control variable constructed by the method based on single control variable, thereby realizing greater variance reduction and further improving the efficiency of Monte Carlo integration.
[0107] This embodiment can realize higher quality direct lighting calculation results for scenes with a small number of light sources at the same time, such as Figure 3 As shown, in the Veach-mis scene with 5 light sources, the relative mean square error relMSE value can achieve 3.38 times acceleration compared with the traditional Monte Carlo estimation method, and also has greater improvement compared with the single control variable method using first-order polynomial or third-order polynomial.
[0108] Embodiment Two
[0109] In this embodiment, a direct lighting calculation method using multiple control variables for scenes with a large number of light sources is proposed, which specifically includes the following steps:
[0110] 1) Light source layering and sampling:
[0111] For scenes with a large number of light sources, first construct a hierarchical structure for all light sources in the scene, then select a representative point of a pixel to create a light section, and identify all light source clusters (or individual light sources) that contribute to that pixel. For example... Figure 4 As shown, the hierarchical structure of the light source is a BVH tree. The internal nodes are collections of multiple light sources (called light source clusters), the leaf nodes are single light sources, and a light slicing is a collection of different nodes in the tree, including internal nodes and leaf nodes.
[0112] For each light source cluster (or a single light source), construct a control variable h. i (u), and uses a light-cutting-based light source sampling method to generate samples. Each control variable is constructed by collecting sample data from its corresponding light source cluster (or a single light source), and the sample data is used to fit the parameters of the control variable.
[0113] Light source sampling methods based on light sectioning, such as Figure 5 As shown, it includes the following steps:
[0114] A. Constructing the Light Source Hierarchy: Starting from the root node containing all light sources, recursively split nodes to form a BVH tree. Node splitting is performed using the Surface Area Orientation Heuristic (SSOH) metric, which allows grouping light sources based on spatial proximity, orientation, and intensity by considering the boundary cone orientation and emitted energy of the light sources. After construction, each node in the hierarchy stores a C... C The spatial bounding box centered on the light source, a direction cone containing the surface normals of all light sources, and the total energy E of these light sources, such as Figure 6 As shown.
[0115] B. Determine the light cut for each shading point: After constructing the light source BVH tree, traverse each shading point from top to bottom during path tracing sampling to generate a light cut, which consists of a set of different nodes in the light source BVH tree, including internal nodes and leaf nodes, representing light source clusters or individual light sources that have potential contributions to the current shading point.
[0116] C. Determining the Importance of Light Source Cluster Sampling: After determining the light cutoff at each shading point x, it is necessary to sample the importance of light source clusters to select a particular cluster. This importance is calculated using the following formula:
[0117]
[0118] This importance stems from the spatial and directional boundaries of the light source cluster relative to the shading point x, taking into account the geometric attenuation of the inverse square distance and the cosine effect of the directional boundaries. For example... Figure 6 As shown, θ u θ is the cone angle that encloses the bounding box starting from the colored point x. i From the shading point x to the center C of the light source cluster C The incident angle, θ, is the orientation axis of the light source cluster relative to the center C. C The angle θ′ between the line connecting the point and the colored point. i =max{θ i -θ u ,0} is the minimum angle of incidence, and θ′=max{θ-θ o -θ u ,0} is the minimum angle formed by the normal of the light source cluster and the direction of the shading point, and d is the center C of the light source cluster. C The distance to the colored point x, f x It is an arbitrary approximation of the two-way scattering distribution function (BSDF) at the colored point x.
[0119] Then, the cluster of light sources is recursively sampled with a probability proportional to that importance until a leaf node containing a single light source is reached.
[0120] D. Sampling a single light source in a cluster of light sources: Once a specific light source is selected, the surface of the light source is uniformly sampled according to standard methods to generate a light sample.
[0121] 2) Construction of multiple control variables:
[0122] In this case, the number of control variables per pixel varies depending on the number of light source clusters (or individual light sources), and the weight v of each control variable... i It is calculated based on the importance of the normalized light source cluster at the representative point. The adaptive construction process of each pixel control variable includes the following steps:
[0123] A. Selecting Representative Points: Divide the pixel into multiple sub-pixels, select the center of each sub-pixel as its representative point, and then emit camera rays from these points to calculate the shading points, determining the light section for each shading point. In the implementation, 16 representative points are selected for each pixel, which provides a good balance between visual quality and computational efficiency.
[0124] B. Merging Light Source Clusters and Calculating Their Weights: Each representative point has its own light slice, corresponding to one or more light source clusters (or a single light source). To generate the control variables for a given pixel, these light slices need to be merged. Assuming there are M representative points and N merged light source clusters, for the i-th light source cluster, the final control variable weights can be calculated using the following steps:
[0125] For each representative point m, the normalized weight of the i-th light source cluster is calculated using the following formula:
[0126]
[0127] Where w i,m N represents the initial importance of the i-th light source cluster for the representative point m m N represents the initial importance of the i-th light source cluster for the representative point m
[0128] After the weights of each representative point are normalized, the normalized weights of all representative points m that contribute to the i-th light source cluster are summed. The maximum weight of the i-th light source cluster is denoted as v i , and the calculation formula is as follows:
[0129]
[0130] Next, a control variable h i (u) is constructed for each merged light source cluster (or single light source). Each control variable collects samples from its corresponding light source cluster (or single light source) and uses the gradient descent method to minimize the error, fit a first-order polynomial function, and obtain the corresponding coefficients a i and the integral H i .
[0131] 2) Final integral estimate:
[0132] The final direct illumination estimate is obtained by the multiple control variable estimator, and based on the obtained direct illumination estimate, specific scene rendering is performed.
[0133] The embodiment can achieve higher quality direct illumination calculation results for scenes with a large number of light sources at the same time. As shown in Figure 7 , in the Staircase2 scene with 21 light sources, the relative mean square error relMSE value can achieve 7.28 times acceleration compared with the traditional Monte Carlo estimation method, and also has a large improvement compared with the single control variable method using either a first-order polynomial or a third-order polynomial.
[0134] Those skilled in the art will appreciate that embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer usable program code.
[0135] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps in one or more flowcharts and / or blocks
[0136] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps in one or more flowcharts and / or blocks
[0137] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps in one or more flowcharts and / or blocks
[0138] The above description is only preferred embodiment of the present application but not for limiting the present application. The present application can have various modifications and changes for those skilled in the art. Any modifications, equivalent replacements, improvements, etc. made by those skilled in the art without creative efforts should be included in the protection scope of the present application.< / r> < / r> < / r> < / r> < / f>
Claims
1. A multiple light source direct illumination rendering method based on multiple control variables, characterized in that, The method comprises the following steps: According to the number and distribution information of the light sources in the scene, the integral domain is divided into a plurality of disjoint sub-domains, each of which contains one or more light sources; Independent sampling is performed in each sub-domain to generate a control variable of a low-order polynomial for each sub-domain, and the sampling data is fitted by a least square regression method; The process of generating a control variable of a low-order polynomial for each sub-domain comprises: the number of pixel control variables varies according to the number of light source clusters or single light sources, and the adaptive construction process of the pixel control variables comprises: The pixel is divided into a plurality of sub-pixels, the center of each sub-pixel is selected as its representative point, then camera rays are emitted from the points to calculate shading points, and light cuts are determined for each shading point; Each light cut is merged, a control variable is constructed for each light source cluster or single light source after merging, each control variable collects samples from the corresponding light source cluster or single light source, and a first-order polynomial function is fitted by minimizing the error by using a gradient descent method, and the corresponding coefficients are calculated; The integral value of each control variable is calculated, and the corresponding weight is calculated based on the importance of the corresponding sub-domain; The integral value is estimated by using multiple control variables, the results of the sub-domains are weighted and fused based on the weights to obtain a final estimation value, and scene rendering is performed according to the final estimation value; The process of estimating the integral value by using multiple control variables comprises: the integral domain is divided into a plurality of non-overlapping sub-regions, a plurality of samples are sampled from each integral layer according to the probability density function in each layer, the Monte Carlo estimation of each integral layer is calculated, and a Monte Carlo estimator converted to the main sampling space is obtained; According to the Monte Carlo estimation of each integral layer, the volume proportion of each layer is combined to calculate the overall estimation; A control variable is introduced for each integral layer, which has an analytical integral, a new control variable integral form is obtained, and the control variable introduced for each integral layer is fitted by using a least square regression of a gradient descent method; According to the new control variable integral form, the corresponding control variable estimator is calculated; According to the corresponding control variable estimators, a multiple control variable estimator on the entire integral domain is combined.
2. A multiple light source direct illumination rendering method based on multiple control variables as claimed in claim 1, characterized in that, When the number of light sources in the scene is less than a set value, a control variable is constructed for each light source, and samples are generated by using a uniform light source sampling method, and each control variable is constructed by using the corresponding sample data.
3. A multiple light source direct illumination rendering method based on multiple control variables as claimed in claim 2, characterized in that, The number of pixel control variables is the same as the number of light sources in the scene, and the weight of each control variable is set as the inverse of the number of light sources.
4. The multiple light source direct illumination rendering method based on multiple control variables as claimed in claim 2, wherein, For the control variable of each light source, a first-order polynomial function is fitted by using the collected sample data to minimize the error by using a gradient descent method, and the corresponding coefficients and integrals are calculated.
5. The multiple light source direct illumination rendering method based on multiple control variables as claimed in claim 1, wherein, When the number of light sources in the scene is greater than or equal to a set value, a hierarchical structure is constructed for all light sources in the scene, representative points of the pixels are selected to create light cuts, and all light source clusters or single light sources contributing to the pixel are identified; For each light cluster or single light, a control variable is constructed and samples are generated using the light cut based light source sampling method, each control variable is constructed by collecting sample data from its corresponding light cluster or single light, and the sample data is used to fit the parameters of the control variable.
6. A multiple light source direct illumination rendering method based on multiple control variables as claimed in claim 5, characterized in that, The process of generating samples using the light cut based light source sampling method includes: Starting from the root node containing all the light sources, recursively split the nodes to form the BVH tree, use the surface area heuristic measure method to split the nodes, and allow the light sources to be grouped according to spatial proximity, direction and intensity by considering the boundary cone direction and emission energy of the light sources; After construction, each node of the hierarchy stores a spatial bounding box, a directional cone containing the surface normal of all light sources, and the total energy of these light sources; After constructing the light source BVH tree, traverse from top to bottom for each shading point during path tracing sampling to generate a light cut, which is composed of different node sets in the light source BVH tree, including internal nodes and leaf nodes, representing light clusters or single lights that have potential contributions to the current shading point; After determining the light cut at each shading point, the importance of the light cluster is sampled to select a certain light cluster, the importance is derived from the spatial and directional boundaries of the light cluster relative to the shading point, considering the geometric attenuation of the inverse square distance and the cosine effect of the directional boundary, and recursively sampling the light cluster with a probability proportional to the importance until reaching a leaf node containing a single light source; For single light sources in the light cluster, uniformly sample the light source surface according to the standard method to generate light samples.
7. A multiple light source direct illumination rendering system based on multiple control variables, characterized in that, It includes: A hierarchical module configured to divide the integral domain into a plurality of disjoint subdomains according to the number and distribution information of the light sources in the scene, each subdomain containing one or more light sources; A sampling module configured to independently sample in each subdomain; A multiple control variable construction module configured to generate a low-order polynomial control variable for each subdomain, and fit the sampling data by least squares regression method, the process of generating a low-order polynomial control variable for each subdomain includes: the number of pixel control variables varies according to the number of light clusters or single lights, and the adaptive construction process of pixel control variables includes: Divide the pixel into multiple subpixels, select the center of each subpixel as its representative point, and then emit camera rays from these points to calculate the shading points, and determine the light cut for each shading point; Merge the light cuts, construct a control variable for each light cluster or single light after merging, each control variable collects samples from its corresponding light cluster or single light, and uses gradient descent method to minimize the error, fit a first-order polynomial function, and calculate the corresponding coefficients; Calculate the integral value of each control variable, and calculate the corresponding weight based on the importance of the corresponding subdomain; A final integral estimation module configured to estimate the integral value using multiple control variables, weight the results of each subdomain based on the weights, and obtain the final estimation value, and perform scene rendering according to the final estimation value; The process of estimating the integral value using multiple control variables includes: dividing the integral domain into a plurality of non-overlapping sub-regions, sampling a plurality of samples from each integral layer according to the probability density function in each layer, calculating the Monte Carlo estimator of each integral layer, and converting the Monte Carlo estimator to the main sampling space; According to the Monte Carlo estimation of each integral layer, combined with the volume proportion of each layer, the total estimation is calculated; Introduce control variables for each integral layer, which have analytical integrals, to obtain a new control variable integral form, and the control variables introduced for each integral layer are obtained by least square regression fitting using gradient descent method; According to the new control variable integral form, the corresponding control variable estimator is calculated; According to the corresponding control variable estimator, the multiple control variable estimator on the entire integral domain is combined.
8. An electronic device, characterized by comprising: The computer program product comprises a memory and a processor, and computer instructions stored in the memory and run on the processor, when the computer instructions are run by the processor, the steps in the method of any one of claims 1-6 are completed.