Multi-light-source direct illumination rendering method and system based on multiple control variables
By using multiple control variable methods in direct lighting rendering of multi-light sources, layering and partitioning the integral domain, fitting low-order polynomial control variables and weighting fusion, the problems of inefficient rendering and noise in the prior art are solved, and higher quality image rendering and wider applicability are achieved.
Patent Information
- Application Number
- CN202411926833.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-25
AI Technical Summary
The prior art has low direct lighting rendering efficiency in complex scenes of multiple light sources, which is prone to significant noise. A single control variable method cannot effectively handle multiple discontinuous points in the integral function, and it is difficult to take into account both the calculation efficiency and the result quality at low sampling rates.
The method based on multiple control variables is adopted to divide the integral domain into multiple disjoint subdomains, and each subdomain is independently sampled, and the control variables of low-order polynomials are generated are fitted through least squares regression, the integral value of each control variable is calculated and the weight is calculated based on importance. The integral value is estimated and weighted and fused, and finally scene rendering is performed.
It effectively reduces the variance of integral estimation, generates higher quality images, can handle complex integral problems with high discontinuity, is more applicable, and can still achieve higher quality with a lower sampling rate when the number of light sources is large, improving the efficiency, speed and quality of computing efficiency and image/scene rendering.
Smart Images

Figure CN119762660A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer graphics and rendering technology, and in particular relates to a multi-light source direct illumination rendering method and system based on multiple control variables. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Direct illumination is a core component of illumination calculation in computer graphics. It refers to the illumination contribution of light that bounces from the light source directly to the surface of the object and is seen by the observer. It is often used in scene rendering and other fields. The traditional Monte Carlo Integration method is widely used in direct illumination rendering, but because it relies on random sampling, the image generated at a low sampling rate has large noise and slow convergence speed.
[0004] In order to improve the convergence speed of Monte Carlo integration, existing technologies have introduced a variety of variance reduction techniques, such as importance sampling to improve integration efficiency by optimizing the sampling probability distribution, multiple importance sampling by combining multiple sampling strategies to take advantage of the advantages of each strategy, and regression-based control variable methods to reduce the noise of the resulting 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 that cause the integral function to be discontinuous, the single control variable method is difficult to handle this discontinuity of the integral function, and the approximation effect is significantly reduced, resulting in low computational efficiency. Summary of the invention
[0005] The present invention proposes a multi-light source direct illumination rendering method and system based on multiple control variables. The present invention utilizes multiple control variables to fit different parts of the integral function respectively, thereby reducing the calculation variance and improving the image quality. The present invention can solve the problems in the prior art that the direct illumination rendering method is inefficient in complex scenes with multiple light sources and is prone to significant noise, the single control variable method cannot effectively process multiple discontinuous points in the integral function, and it is difficult to balance the calculation efficiency and result quality at a low sampling rate.
[0006] According to some embodiments, the present invention adopts the following technical solutions:
[0007] A multi-light source direct illumination rendering method based on multiple control variables comprises the following steps:
[0008] According to the number and distribution information of light sources in the scene, the integral domain is divided into multiple non-overlapping subdomains, each of which contains one or more light sources;
[0009] Independent sampling is performed in each subdomain, a low-order polynomial control variable is generated for each subdomain, and the sampled data is fitted by the least squares regression method;
[0010] Calculate the integral value of each control variable and calculate the corresponding weight based on the importance of the corresponding subdomain;
[0011] The integral value is estimated using multiple control variables, and based on the weights, the results of each subdomain are weighted and fused to obtain a final estimated value, and the scene is rendered 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 is constructed for each light source. i (u), and a uniform light source sampling method is used to generate samples. Each control variable is constructed from its corresponding sample data.
[0013] As an optional implementation, the number of control variables per pixel is the same as the number of light sources in the scene, and the weight v of each control variable is i Set to the inverse of the number of lights.
[0014] As an alternative implementation, the control variable h for each light source is i (u), through the collected sample data, use the gradient descent method to minimize the error, fit a first-order polynomial function, and find its corresponding coefficient α i and integral H i .
[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 a pixel is selected to create a light cut, and all light source clusters or a single light source contributing 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 source sampling method based on light cutting. 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 the light section-based light source sampling method includes:
[0018] Starting from the root node containing all light sources, recursively split nodes to form a BVH tree, using the surface area direction heuristic metric method for node splitting, which allows light sources to be grouped according to spatial proximity, direction, and intensity by considering the bounding cone direction and emission energy of the light source; after construction, each node of the hierarchy stores a spatial bounding box, a direction cone containing the surface normals of all light sources, and the total energy E of these light sources;
[0019] After constructing the light source BVH tree, it is traversed from top to bottom for each shading point during path tracing sampling to generate a light cut, which consists of a different set of nodes in the light source BVH tree, including internal nodes and leaf nodes, representing a light source cluster or a single light source that potentially contributes to the current shading point;
[0020] After determining the light cutoff at each shading point x, importance sampling is performed on the light source clusters to select a certain light source cluster, wherein the importance is derived 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 boundary, and recursively sampling 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 a light source cluster, the light sample is generated by uniformly sampling the light source surface in a standard manner.
[0022] As an optional implementation, the process of generating a low-order polynomial control variable for each sub-domain includes: the number of each pixel control variable varies according to the number of light source clusters or single light sources, and the adaptive construction process of the pixel control variable includes:
[0023] Divide the pixel into multiple sub-pixels, select the center of each sub-pixel as its representative point, and then send camera rays from these points to calculate the shading points, and determine the light cut for each shading point;
[0024] The light sections are merged, and a control variable is constructed for each light source cluster or single light source after the merger. 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 calculate its corresponding coefficient.
[0025] As an optional implementation, the process of estimating the integral value using multiple control variables includes: decomposing the integral domain into a plurality of non-overlapping sub-regions, sampling a plurality of samples from each integral layer according to a probability density function within each layer, calculating a Monte Carlo estimate of each integral layer, and obtaining a Monte Carlo estimator converted to a main sampling space;
[0026] Based on the Monte Carlo estimates of each integration layer, combined with the volume proportions of each layer, an overall estimate is calculated;
[0027] Introduce a control variable h for each integration layer i (u), which has analytical integration, and obtains a new control variable integral form. The control variable h introduced at each integration layer i (u) obtained by least squares regression fitting using the gradient descent method;
[0028] According to the new integral form of the control variable, the corresponding control variable estimator is calculated;
[0029] According to the corresponding control variable estimators, multiple control variable estimators on the entire integral domain are combined.
[0030] A multi-light source direct lighting rendering system based on multiple control variables, comprising:
[0031] A hierarchical module is 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;
[0032] The sampling module is configured to sample independently in each subdomain;
[0033] A multiple control variable building module is configured to generate a low-order polynomial control variable for each subdomain, fit the sampled data by the least squares regression method, calculate the integral value of each control variable, and calculate the corresponding weight based on the importance of the corresponding subdomain;
[0034] The final integral estimation module is configured to estimate the integral value using multiple control variables, weightedly fuse the results of each subdomain based on the weight, obtain a final estimated value, and perform scene rendering according to the final estimated value.
[0035] An electronic device comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps in the above method are completed.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] The present invention utilizes a multiple control variable method to effectively reduce the variance of integral estimation when processing multi-light source scenes, thereby generating higher quality images.
[0038] The present invention optimizes the integration domain by stratification and partitioning, and can handle complex integration problems with high discontinuity, and has wider scene applicability;
[0039] The present invention can achieve higher quality at a lower sampling rate even when the number of light sources is large, thereby improving computing efficiency, and improving the efficiency, speed and quality of image / scene rendering.
[0040] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0042] Figure 1 is a comparison diagram of the method provided by an embodiment and the previous Monte Carlo integration method based on a single control variable in solving a one-dimensional function integration problem;
[0043] Figure 2 is a flow chart of applying a multiple control variable method in direct lighting rendering in one embodiment;
[0044] Figure 3 is a comparison diagram of direct lighting results at the same time in a Veach-mis scene of an embodiment;
[0045] Figure 4 is a schematic diagram of a light source hierarchy and light cuts used in an embodiment;
[0046] Figure 5 is a flow chart of a light source sampling method based on light sectioning used in an embodiment;
[0047] Figure 6 is a schematic diagram of calculating the importance of light source cluster sampling in an embodiment;
[0048] Figure 7 The following is a comparison chart of direct lighting results at the same time in the Staircase2 scene of an embodiment. DETAILED DESCRIPTION
[0049] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0050] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0051] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0052] In the absence of conflict, the embodiments in this application and the features in the embodiments may be combined with each other.
[0053] Embodiment 1
[0054] In this embodiment, a direct illumination calculation method using multiple control variables is proposed for a scene with a small number of light sources, such as Figure 2 As shown, the following steps are included:
[0055] 1) Light source layering and sampling:
[0056] For scenes with a small number of light sources, construct a control variable h for each light source. i (u), 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) Construction of multiple control variables:
[0058] In this case, the number of control variables per pixel is the same as the number of light sources in the scene, and the weight v for each control variable is i Set to the inverse of the number of lights.
[0059] The control variable h for each light source i (u), through the collected sample data, use the gradient descent method to minimize the error, fit a first-order polynomial function, and find its corresponding coefficient α i and integral H i .
[0060] 3) Final integral estimation:
[0061] The final direct lighting estimate is obtained through a multiple control variable estimator, and specific scene rendering is performed based on the direct lighting estimate.
[0062] The following is a detailed introduction to the specific process of how to use multiple control variables to improve the efficiency of Monte Carlo integration.
[0063] Rendering is to calculate an integral value for each pixel in the image. The integral problem can be expressed as:
[0064]
[0065] In light transport simulation, function f(x) represents the measured contribution function of the light transport path, and Ω represents the path space. The definite integral F provides a solution for light transport simulation, and this value is usually not available through analytical methods. Monte Carlo integration provides a numerical solution to this integral through random sampling:
[0066]
[0067] Where n is used to estimate <f> n The number of samples, x i is a random sample sampled according to the probability density function p(x). There is a mapping x = Φ(u) whose Jacobian term is |dx / du| = 1 / p(x). The above integral can be transformed into the main sampling space by changing the variables:
[0068]
[0069] in U is used to generate samples x i A uniformly distributed random number u i By redefining the integral in the main sampling space, samples u can be sampled in the unit cube space U i ~p(u)=1, the Monte Carlo estimate of the above integral becomes:
[0070]
[0071] The control variable technique is a technique used to reduce the variance of the Monte Carlo method. The basic idea 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. U The related function h(u) of h(u)du can express the original integral as the sum of the difference integral and the known analytical integral:
[0072]
[0073] The coefficient α represents the intensity of using the control variable. By performing Monte Carlo numerical integration on the difference integral, a single control variable estimator can be obtained:
[0074]
[0075] By minimizing the variance of this estimator, we can obtain the optimal in yes The correlation coefficient of h(u) and Var[h(u)] is the variance of h(u). The introduced control variable function h(u) is related to the original integrand function The stronger the correlation, the stronger the variance reduction ability of the control variable estimator.
[0076] Selecting the polynomial function as the control variable function form, h(u) can be expressed as:
[0077]
[0078] in is a monomial, M is the order of the polynomial, and the integral H can be obtained analytically by the weighted sum of the integrals of the monomial:
[0079]
[0080] The polynomial control variable h(u) can be fitted by the least squares regression method. First, the polynomial function is modeled as a function of the parameter θ = (c 0 ,…,c M ) and define the residual with respect to the parameter θ:
[0081]
[0082] h(u) to The regression involves finding the optimal parameter θ so that the value of R(θ) is minimized. Next, we sample n random samples u i To approximate R(θ), this is equivalent to using the estimator <r>(θ) for the function Perform Monte Carlo integration.
[0083]
[0084] In order to get <r>The minimum value of (θ) can be solved by gradient descent method to find the optimal parameter θ. Specifically, the update rule of gradient descent is used to iteratively update the coefficient θ of the polynomial:
[0085]
[0086] in for <r>(θ) is the partial derivative of the polynomial coefficients, and the learning rate γ is set to 0.01. As mentioned before, u i is a Monte Carlo estimator <r>(θ), so we can use only one sample per update when k = 1,…,n, and modify the above gradient update rule:
[0087]
[0088] The abbreviation represents the residual of each sample, and this process can be iterated multiple times on all samples.
[0089] Next, we introduce the theory of the Monte Carlo integration method based on multiple control variables, which includes the following steps:
[0090] 1) Integration domain stratification
[0091] Decompose the integration domain Ω into k non-overlapping sub-regions Ω 1 ,Ω 2 ,…,Ω k ,satisfy: Then according to the probability density function p in each layer i From each layer Ω i Medium sampling n i samples, each layer Ω i The Monte Carlo estimate of is:
[0092]
[0093] Where X i,j According to the probability density function p i The jth sample sampled. Similarly, by variable replacement, we can obtain the Monte Carlo estimator converted to the main sampling space:
[0094]
[0095] Since the probability density function of each layer is different, we can get different layers of Ω 1 ,Ω 2 ,…,Ω k The corresponding integrand f 1 ,f 2 ,…,f k , the overall estimate is:
[0096]
[0097] where v i ∈(0,1] represents the volume ratio of the i-th layer. This hierarchical step can reduce the variance of the original Monte Carlo estimate.
[0098] 2) Multiple control variable integration
[0099] By giving each layer Ω i Introducing the control variable h i (u), which has the analytical integral H i =∫ U h i (u)du, we can get the new integral form of the control variable:
[0100]
[0101] The coefficient yes and h i The correlation coefficient of (u). Each layer Ω i The introduced control variable h i (u) can be obtained by least squares regression fitting using the gradient descent method.
[0102] Each layer Ω i Introducing the control variable h i (u), the corresponding control variable estimator is:
[0103]
[0104] The multiple control variable estimator over the entire integration domain Ω is:
[0105]
[0106] By combining the two techniques of stratification and control variables, the multiple control variable estimator can simultaneously utilize the advantages of these two techniques, further reduce the variance of Monte Carlo estimation, and improve the efficiency of estimation. Figure 1 The comparison between the Monte Carlo integration method based on multiple control variables in this embodiment and the previous Monte Carlo integration method based on a single control variable in solving the one-dimensional function integration problem is demonstrated. It can be seen that the method based on multiple control variables uses multiple low-order polynomial control variables constructed in layers to be closer to the original integrand than one high-order polynomial control variable constructed by the method based on a single control variable, thereby achieving greater variance reduction and further improving the efficiency of Monte Carlo integration.
[0107] This embodiment can achieve 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 figure, in the Veach-mis scene with 5 light sources, the relative mean square error relMSE value can achieve a 3.38-fold acceleration compared with the traditional Monte Carlo estimation method, and it is also significantly improved compared with the method of using a single control variable regardless of whether it is a first-order polynomial or a third-order polynomial.
[0108] Embodiment 2
[0109] In this embodiment, a direct illumination calculation method using multiple control variables for a large number of light source scenes 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, we first build a hierarchy for all the light sources in the scene, and then select a representative point of a pixel to create a light cut, identifying all light clusters (or a single light source) that contribute to that pixel. Figure 4 As shown, the hierarchical structure of the light source is a BVH tree, the internal nodes are a collection of multiple light sources (called a light source cluster), the leaf nodes are a single light source, and a light cut is a collection of different nodes in the tree, including internal nodes and leaf nodes.
[0112] For each light source cluster (or single light source), construct a control variable h i (u), and a light source sampling method based on light cutting is used to generate samples. 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.
[0113] Light source sampling methods based on light sectioning are as follows Figure 5 As shown, the following steps are included:
[0114] A. Constructing the light source hierarchy: Starting from the root node containing all light sources, recursively split nodes to form a BVH tree. The surface area direction heuristic (SSOH) metric is used for node splitting, which allows light sources to be grouped according to spatial proximity, direction, and intensity by considering the bounding cone direction and emission energy of the light source. After construction, each node of the hierarchy stores a C C A spatial bounding box centered on , a direction cone containing the surface normals of all light sources and the total energy E of these light sources, such as Figure 6 shown.
[0115] B. Determine the light cut for each shading point: After constructing the light source BVH tree, traverse it from top to bottom for each shading point during path tracing sampling to generate a light cut, which consists of a different set of nodes in the light source BVH tree, including internal nodes and leaf nodes, representing light source clusters or single light sources that potentially contribute to the current shading point.
[0116] C. Determine the importance of light source cluster sampling: After determining the light cut at each shading point x, it is necessary to perform importance sampling on the light source cluster to select a certain light source cluster. This importance is calculated using the following formula:
[0117]
[0118] This importance is derived from the spatial and directional boundaries of the light cluster relative to the shading point x, taking into account the geometric falloff of inverse square distance and the cosine effect of the directional boundaries. Figure 6 As shown, θ u is the cone angle of the bounding box starting from the shading point x, θ i is from the shading point x to the center of the light cluster C C The incident angle, θ is the direction axis of the light source cluster and the center C C The angle between the line and the shading point, θ′ i =max{θ i -θ u ,0} is the minimum incident angle, and θ′=max{θ-θ o -θ u ,0} is the minimum angle between the normal of the light source cluster and the direction of the shading point, and d is the center of the light source cluster C C The distance to the shading point x, f x is an arbitrary approximation of the bidirectional scattering distribution function BSDF at the shading point x.
[0119] Light source clusters are then recursively sampled with probability proportional to this importance until a leaf node containing a single light source is reached.
[0120] D. Sampling a single light source in a light source cluster: Once a specific light source is selected, the light source surface is uniformly sampled according to standard methods to generate light samples.
[0121] 2) Construction of multiple control variables:
[0122] In this case, the number of control variables per pixel varies according to the number of light source clusters (or individual light sources), and the weight v of each control variable is 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. Select representative points: Divide the pixel into multiple sub-pixels, select the center of each sub-pixel as its representative point, and then send camera rays from these points to calculate the shading point, and determine the light cut 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. Merge light source clusters and calculate their weights: Each representative point has its own light cut, corresponding to one or more light source clusters (or a single light source). In order to generate the control variable for a given pixel, these light cuts need to be merged. Assuming there are M representative points and the number of merged light source clusters is N, for the i-th light source cluster, the final control variable weight can be calculated by the following steps:
[0125] For each representative point m, the normalized weight of the i-th light source cluster is calculated by the following formula:
[0126]
[0127] where w i,m represents the initial importance of the i-th light source cluster to the representative point m, N m Represents the total number of light source clusters associated with the representative point m.
[0128] After normalizing the weight of each representative point, the normalized weights of all representative points m contributing to the i-th light source cluster are summed. The final weight of the i-th light source cluster is expressed as v i , the calculation formula is as follows:
[0129]
[0130] Next, construct a control variable h for each merged light source cluster (or single light source) i (u), 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 find its corresponding coefficient α i and integral H i .
[0131] 2) Final integral estimation:
[0132] The final direct lighting estimation value is obtained through a multiple control variable estimator, and specific scene rendering is performed based on the obtained direct lighting estimation value.
[0133] This embodiment can achieve higher quality direct lighting calculation results for scenes with a large number of light sources at the same time, such as Figure 7 As shown, in the Staircase2 scene with 21 light sources, the relative mean square error relMSE value can achieve a 7.28-fold acceleration compared with the traditional Monte Carlo estimation method, and it is also significantly improved compared with the method of using a single control variable regardless of whether it is a first-order polynomial or a third-order polynomial.
[0134] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may 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-ROM, optical storage, etc.) containing computer-usable program code.
[0135] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0138] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made by those skilled in the art within the spirit and principle of the present invention without creative labor shall be included in the protection scope of the present invention.< / r> < / r> < / r> < / r> < / f>
Claims
1. A multi-light source direct illumination rendering method based on multiple control variables, characterized in that: The following steps are involved: According to the number and distribution information of light sources in the scene, the integral domain is divided into multiple non-overlapping subdomains, each of which contains one or more light sources; Independent sampling is performed in each subdomain, a low-order polynomial control variable is generated for each subdomain, and the sampled data is fitted by the least squares regression method; Calculate the integral value of each control variable and calculate the corresponding weight based on the importance of the corresponding subdomain; The integral value is estimated using multiple control variables, and based on the weights, the results of each subdomain are weighted and fused to obtain a final estimated value, and the scene is rendered according to the final estimated value.
2. A multi-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 the set value, a control variable h is constructed for each light source. i (u), and a uniform light source sampling method is used to generate samples. Each control variable is constructed from its corresponding sample data.
3. A multi-light source direct illumination rendering method based on multiple control variables as claimed in claim 2, characterized in that: The number of control variables per pixel is the same as the number of light sources in the scene, and the weight of each control variable is v i Set to the inverse of the number of lights.
4. A multi-light source direct illumination rendering method based on multiple control variables as claimed in claim 2, characterized in that: The control variable h for each light source i (u), through the collected sample data, use the gradient descent method to minimize the error, fit a first-order polynomial function, and find its corresponding coefficient α i and integral H i .
5. The method for direct illumination rendering of multiple light sources based on multiple control variables as claimed in claim 1, characterized in that: When the number of light sources in the scene is greater than or equal to the set value, a hierarchy is constructed for all light sources in the scene, a representative point of a pixel is selected to create a light cut, and all light source clusters or single light sources contributing to the pixel are identified; For each light source cluster or single light source, a control variable is constructed and samples are generated using a light source sampling method based on light cutting. 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.
6. A multi-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 section-based source sampling method includes: Starting from the root node containing all light sources, nodes are recursively split to form a BVH tree. The surface area direction heuristic metric method is used for node splitting. By considering the bounding cone direction and emission energy of the light source, light sources can be grouped according to spatial proximity, direction and intensity. After construction, each node of the hierarchy stores a spatial bounding box, a direction cone containing the surface normals of all light sources, and the total energy of these light sources. After constructing the light source BVH tree, it is traversed from top to bottom for each shading point during path tracing sampling to generate a light cut, which consists of a different set of nodes in the light source BVH tree, including internal nodes and leaf nodes, representing a light source cluster or a single light source that potentially contributes to the current shading point; After determining the light cut at each shading point, importance sampling is performed on the light source clusters to select a certain light source cluster, wherein the importance is derived from the spatial and directional boundaries of the light source cluster relative to the shading point, and the geometric attenuation of the inverse square distance and the cosine effect of the directional boundary are considered, and the light source clusters are recursively sampled with a probability proportional to the importance until a leaf node containing a single light source is reached; For a single light source in a light source cluster, the light sample is generated by uniformly sampling the light source surface in a standard manner.
7. A multi-light source direct illumination rendering method based on multiple control variables as claimed in claim 5, characterized in that: The process of generating a low-order polynomial control variable for each subdomain includes: the number of control variables for each pixel varies according to the number of light source clusters or single light sources, and the adaptive construction process of the pixel control variable includes: Divide the pixel into multiple sub-pixels, select the center of each sub-pixel as its representative point, and then send camera rays from these points to calculate the shading points, and determine the light cut for each shading point; The light sections are merged, and a control variable is constructed for each light source cluster or single light source after the merger. 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 calculate its corresponding coefficient.
8. The method for direct illumination rendering of multiple light sources based on multiple control variables as claimed in claim 5, characterized in that: The process of estimating the integral value using multiple control variables includes: decomposing the integral domain into a plurality of non-overlapping sub-regions, sampling a plurality of samples from each integral layer according to a probability density function within each layer, calculating a Monte Carlo estimate of each integral layer, and obtaining a Monte Carlo estimator converted to a main sampling space; Based on the Monte Carlo estimates of each integration layer, combined with the volume proportions of each layer, an overall estimate is calculated; Introduce a control variable h for each integration layer i (u), which has analytical integration, and obtains a new control variable integral form. The control variable h introduced at each integration layer i (u) obtained by least squares regression fitting using the gradient descent method; According to the new integral form of the control variable, the corresponding control variable estimator is calculated; According to the corresponding control variable estimators, multiple control variable estimators on the entire integral domain are combined.
9. A multi-light source direct lighting rendering system based on multiple control variables, characterized in that: include: A hierarchical module is 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; The sampling module is configured to sample independently in each subdomain; A multiple control variable building module is configured to generate a low-order polynomial control variable for each subdomain, fit the sampled data by the least squares regression method, calculate the integral value of each control variable, and calculate the corresponding weight based on the importance of the corresponding subdomain; The final integral estimation module is configured to estimate the integral value using multiple control variables, weightedly fuse the results of each subdomain based on the weight, obtain a final estimated value, and perform scene rendering according to the final estimated value.
10. An electronic device, characterized in that: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the steps in the method according to any one of claims 1 to 8 are completed.
Citation Information
Patent Citations
Multiple-light source rendering method based on virtual spherical light sources
CN104200512A
Multi-light-source acceleration method for programmable shader
CN104463943A
Region block computation complexity estimation method, parallel light path tracking method and system
CN110033511A
Neural network control variates
CN113496271A
Subsurface scattering calculation method for semitransparent material rendering
CN113674375A
Cited By
BSDF modeling method based on measured data
CN120430077A
BSDF modeling method based on measured data
CN120430077B
Light sampling method based on two-dimensional BSDF
CN120446060A