Detailed Description
To explain technical contents, structural features, and objects and effects of the technical solutions in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
Referring to fig. 1, a flow chart of a real-time rendering method of a multi-layer material object according to an embodiment of the invention is shown; the method can be applied to the real-time rendering of the multilayer material object, and specifically comprises the following steps:
the process first proceeds to step S1 where a first BRDF is calculated based on the first optical property information of the multi-layered material object. The multi-layer material object is an object to be rendered, and can be automobile glass, furniture and the like, the multi-layer material object is usually composed of a base material layer and a plurality of additive material layers sprayed on the base material layer, and the multi-layer paint is sprayed on the base material layer by layer in an overlapping mode. The first optical property information is information representing the optical property of the object, and comprises the distribution conditions of reflection, scattering, attenuation and the like of light rays in the object.
Then, in step S2, a second BRDF may be calculated according to the first optical property information of the multi-layer material object, where the second BRDF is a sub-surface BRDF of the multi-layer material object after the material layer is added on the substrate material layer, and the number of the added material layers is one or more. After a new material layer is added on the substrate material layer, the sub-surface BRDF of the multi-layer material object changes, so that the sub-surface BRDF needs to be recalculated. The number of the added material layers can be one or more according to actual requirements, and the second BRDF is the subsurface BRDF formed by adding one or more material layers on the substrate material layer of the multilayer material object.
Then, the process proceeds to step S3 to calculate a third BRDF according to the second optical property information of the last added material layer, where the third BRDF is the surface BRDF of the last added material layer. In order to better reflect the reflection characteristic of the surface of the object and enable the real-time rendering of the object to be closer to the real situation that light is reflected on the surface of the object, not only the sub-surface BRDF but also the surface BRDF of the object need to be calculated. For the multilayer material object, the surface BRDF of the last added material layer can best reflect the reflection characteristics of the light on the surface of the object, so that the third BRDF can be calculated according to the second optical property information of the last added material layer, wherein the second optical property information is information representing the optical properties of the object and includes the condition that the light is reflected on the surface of the object. The method may then proceed to step S4 for real-time rendering of the multi-layer material object based on the second and third BRDFs. And after the multi-layer material object is rendered in real time based on the second BRDF and the third BRDF, the obtained virtual model of the multi-layer material object can well reflect the reflection characteristic of light on the surface of the object.
According to the technical scheme, firstly, calculating the sub-surface BRDF of the base material layer of the multilayer material object according to the first optical property information of the multilayer material object; calculating the sub-surface BRDF of the multilayer material object after the material layer is added on the substrate material layer according to the first optical property information of the multilayer material object, wherein the number of the added material layers is one or more; then calculating a third BRDF according to the second optical property information of the finally added material layer; and finally, performing real-time rendering on the multilayer material object based on the second BRDF and the third BRDF. Because the subsurface BRDF of the object added with each material layer is calculated in an iterative mode, the process that the light rays need to be simulated to propagate inside the object when the subsurface BRDF is calculated by the existing algorithm (such as a ray tracing algorithm) is effectively avoided, the algorithm complexity for calculating the subsurface BRDF of the multilayer material object is greatly reduced, the calculation time is shortened, the efficiency for rendering the multilayer material object in real time is improved, and the method has a wide market prospect in the technical field of computer graphics rendering.
In this embodiment, the first optical property information of the multilayer material object specifically includes first optical property information of the substrate material layer and first optical property information of the added material layer, and the first optical property information includes a scattering phase function and a single scattering albedo. Because the materials of different material layers are different, the corresponding first optical property information is also different. In computer graphics, the distribution of light inside an object is often characterized using a scattering phase function (phase function) and a single scattering albedo (single scattering albedo). The scattering phase function characterizes the distribution of light at each scattering inside the object, and the single scattering albedo is the ratio of the light scattering rate and the light attenuation rate. The second optical property information includes a fresnel reflection value and a smoothness, the fresnel reflection value is used for representing the percentage of the light reflected on the surface of the object to the incident light, and the smoothness is used for representing the smoothness of the surface of the object.
The multilayer material object comprises the substrate material layer and the added material layer, and the substrate material layer and the added material layer can be converted into a mathematical model which can be processed by a computer by calculating the optical property information of the substrate material layer and the added material layer, so that the subsequent BRDF calculation and rendering operation are facilitated. In the present embodiment, since the mathematical model is calculated in a space after fourier transform, it is necessary to fourier-expand a scattering phase function first. Specifically, the fourier expansion coefficient of the scattering phase function is first calculated, which can be calculated by the following formula (1):
<math> <mrow> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <mi>μ</mi> <mo>,</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>)</mo> </mrow> <mo>=</mo> <msup> <mrow> <mo>(</mo> <mo>-</mo> <mn>1</mn> <mo>)</mo> </mrow> <mi>m</mi> </msup> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mi>m</mi> </mrow> <msub> <mi>s</mi> <mi>max</mi> </msub> </munderover> <msub> <mi>λ</mi> <mi>s</mi> </msub> <msubsup> <mi>P</mi> <mrow> <mi>m</mi> <mn>0</mn> </mrow> <mi>s</mi> </msubsup> <mrow> <mo>(</mo> <mi>μ</mi> <mo>)</mo> </mrow> <msubsup> <mi>P</mi> <mrow> <mi>m</mi> <mn>0</mn> </mrow> <mi>s</mi> </msubsup> <mrow> <mo>(</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>)</mo> </mrow> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>1</mn> <mo>)</mo> </mrow> </mrow></math>
wherein m is a Fourier expansion term of m times; μ is the cosine value at the zenith angle of the scattering direction; p is a radical ofm(μ, μ') is the fourier expansion coefficient of the scattering phase function;is a general sphere function (general spherical function); lambda [ alpha ]sFor the Legendre polynomial expansion coefficients of the scattering phase function, in this example, the Henyey-Greenstein phase function is used for the scattering phase function, then λsCan be represented by the following formula (2):
λs=(2s+1)gs(2)
where g is an asymmetry parameter (asymmetry parameter) of the phase function.
As shown in fig. 2, in the present embodiment, the method for calculating the first BRDF specifically includes: and step S5, according to the scattering phase function and the single scattering albedo of the substrate material layer, calculating the subsurface BRDF of the layer by iteration by using an Ambartsumain integral equation. Specifically, the Ambartsumain integral equation is shown in the following equation (3):
<math> <mrow> <mfenced open='' close=''> <mtable> <mtr> <mtd> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>+</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mi>α</mi> <mn>4</mn> </mfrac> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>+</mo> <mfrac> <mrow> <mi>α</mi> <msub> <mi>μ</mi> <mi>q</mi> </msub> </mrow> <mn>2</mn> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <mi>α</mi> <msub> <mi>μ</mi> <mi>p</mi> </msub> </mrow> <mn>2</mn> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mi>α</mi> <msub> <mi>μ</mi> <mi>p</mi> </msub> <msub> <mi>μ</mi> <mi>q</mi> </msub> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <munderover> <mi>Σ</mi> <mrow> <msup> <mi>s</mi> <mo>′</mo> </msup> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>,</mo> <mo>-</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> </mtable> </mfenced> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>3</mn> <mo>)</mo> </mrow> </mrow></math>
wherein, alpha is the single scattering albedo, which is the ratio of the light scattering rate and the light attenuation rate corresponding to the substrate material; rmThe coefficient of the mth Fourier expansion term of the BRDF is obtained; mu.siCosine value being the zenith angle of incidence direction; mu.soThe cosine value is the angle of the emission direction zenith. Converting the formula (3) into an n × n numerical value to calculate an algebraic expression, as shown in the following formula (4):
<math> <mrow> <mfenced open='' close=''> <mtable> <mtr> <mtd> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>+</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mi>α</mi> <mn>4</mn> </mfrac> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>+</mo> <mfrac> <mrow> <mi>α</mi> <msub> <mi>μ</mi> <mi>q</mi> </msub> </mrow> <mn>2</mn> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <mi>α</mi> <msub> <mi>μ</mi> <mi>p</mi> </msub> </mrow> <mn>2</mn> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mi>α</mi> <msub> <mi>μ</mi> <mi>p</mi> </msub> <msub> <mi>μ</mi> <mi>q</mi> </msub> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <munderover> <mi>Σ</mi> <mrow> <msup> <mi>s</mi> <mo>′</mo> </msup> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>,</mo> <mo>-</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> </mtable> </mfenced> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>4</mn> <mo>)</mo> </mrow> </mrow></math>
μ and ω are the product nodes and their corresponding weights, respectively, as shown in equations (5) and (6) below:
<math> <mrow> <msub> <mi>μ</mi> <mi>n</mi> </msub> <mo>=</mo> <mi>cos</mi> <mrow> <mo>(</mo> <mfrac> <mi>π</mi> <mn>4</mn> </mfrac> <msub> <mi>G</mi> <mi>n</mi> </msub> <mo>+</mo> <mfrac> <mi>π</mi> <mn>4</mn> </mfrac> <mo>)</mo> </mrow> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>5</mn> <mo>)</mo> </mrow> </mrow></math>
<math> <mrow> <msub> <mi>ω</mi> <mi>n</mi> </msub> <mo>=</mo> <mfrac> <mi>π</mi> <mn>4</mn> </mfrac> <msub> <mi>W</mi> <mi>n</mi> </msub> <mi>sin</mi> <mrow> <mo>(</mo> <mfrac> <mi>π</mi> <mn>4</mn> </mfrac> <msub> <mi>G</mi> <mi>n</mi> </msub> <mo>+</mo> <mfrac> <mi>π</mi> <mn>4</mn> </mfrac> <mo>)</mo> </mrow> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>6</mn> <mo>)</mo> </mrow> </mrow></math>
wherein the maximum value of n is the interval [0, 1 ]]Number of intermediate product nodes, GnIs a Gaussian product node; wnWeights corresponding to the Gaussian product nodes; rmIs calculated by the following equation (7):
<math> <mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mi>α</mi> <mrow> <mn>4</mn> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>+</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mrow> </mfrac> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>7</mn> <mo>)</mo> </mrow> </mrow></math>
a large number of experiments show that after 10 iterations, R of most materialsmThe convergence precision can be achieved (the coefficient of the mth Fourier expansion term of the BRDF), and the requirement of calculating the BRDF is also met. Thus, at this time, the R is based on the substrate material layermThe subsurface BRDF of the substrate material layer can be calculated.
Accordingly, after the first BRDF is calculated, a second BRDF may be calculated from the first BRDF.
In this embodiment, the optical thickness of the added material layer satisfies a predetermined threshold condition. The preset threshold value can adopt different threshold values according to the requirements of different algorithms. As shown in fig. 2, in the present embodiment, the method for calculating the second BRDF specifically includes: step S6 calculates the sub-surface BRDF after the addition of the material layer based on the sub-surface BRDF of the previous layer using the inviiant Imbedding method. Since the Invariant Imbedding method can only calculate the scattering result of the light ray at most once each time, the optical thickness of the added material layer needs to be small enough, so that the scattering frequency of the light ray on the layer can be guaranteed to be at most once, and before calculating the second BRDF, the optical thickness of the added material layer can meet the preset threshold condition by adjusting the preset threshold, that is, the scattering frequency of the light ray on the layer is at most once. The Invariant embedding method can calculate a new BRDF on the basis of the original BRDF, and the characteristic determines that the method is very suitable for calculating the sub-surface BRDF of a multilayer material object, and the sub-surface BRDF of the base material layer is calculated according to the formulas (1) to (7), so that the sub-surface BRDF of the multilayer material object, namely the second BRDF, can be calculated after all the material layers are added only by adopting the Invariant embedding method to calculate the sub-surface BRDF after the material layers are added each time for the base material layer and calculating one by one. Specifically, the fourier expansion coefficient of the subsurface BRDF after the addition of the material layer is first calculated, and the calculation equation is shown in the following formula (8):
<math> <mrow> <mfenced open='' close=''> <mtable> <mtr> <mtd> <msubsup> <mi>R</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mrow> <mo>(</mo> <mn>1</mn> <mo>-</mo> <mfrac> <mi>Δτ</mi> <msub> <mi>μ</mi> <mn>0</mn> </msub> </mfrac> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> <mrow> <mo>(</mo> <mn>1</mn> <mo>-</mo> <mfrac> <mi>Δτ</mi> <msub> <mi>μ</mi> <mi>i</mi> </msub> </mfrac> <mo>)</mo> </mrow> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <mrow> <mn>4</mn> <msub> <mi>μ</mi> <mn>0</mn> </msub> <msub> <mi>μ</mi> <mi>i</mi> </msub> </mrow> </mfrac> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <mrow> <mn>2</mn> <msub> <mi>μ</mi> <mi>i</mi> </msub> </mrow> </mfrac> <msubsup> <mo>∫</mo> <mn>0</mn> <mn>1</mn> </msubsup> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>)</mo> </mrow> <msup> <mi>du</mi> <mo>′</mo> </msup> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <msub> <mrow> <mn>2</mn> <mi>μ</mi> </mrow> <mn>0</mn> </msub> </mfrac> <msubsup> <mo>∫</mo> <mn>0</mn> <mn>1</mn> </msubsup> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>du</mi> <mo>′</mo> </msup> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> <msubsup> <mo>∫</mo> <mn>0</mn> <mn>1</mn> </msubsup> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>)</mo> </mrow> <msup> <mi>du</mi> <mo>′</mo> </msup> <msubsup> <mo>∫</mo> <mn>0</mn> <mn>1</mn> </msubsup> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <mo>-</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>,</mo> <msup> <mi>μ</mi> <mrow> <mo>′</mo> <mo>′</mo> </mrow> </msup> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msup> <mi>μ</mi> <mrow> <mo>′</mo> <mo>′</mo> </mrow> </msup> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>du</mi> <mrow> <mo>′</mo> <mo>′</mo> </mrow> </msup> </mtd> </mtr> </mtable> </mfenced> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>8</mn> <mo>)</mo> </mrow> </mrow></math>
wherein n represents the added nth layer material, n-1 represents the (previous) nth layer material added before the nth layer material is added, and alpha is the single scattering reflectance, namely the ratio of the light scattering rate and the light attenuation rate corresponding to the added material layer; rmFor mth Fourier expansion of BRDFA term coefficient; mu.siCosine value being the zenith angle of incidence direction; mu.soΔ τ represents the optical thickness of the added material layer as the cosine value of the angle of the emission direction zenith. Converting equation (8) into an algebraic calculation equation as shown in equation (9) below:
<math> <mrow> <mfenced open='' close=''> <mtable> <mtr> <mtd> <msubsup> <mi>R</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mrow> <mo>(</mo> <mn>1</mn> <mo>-</mo> <mfrac> <mi>Δτ</mi> <msub> <mi>μ</mi> <mi>p</mi> </msub> </mfrac> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mrow> <mo>(</mo> <mn>1</mn> <mo>-</mo> <mfrac> <mi>Δτ</mi> <msub> <mi>μ</mi> <mi>q</mi> </msub> </mfrac> <mo>)</mo> </mrow> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <mrow> <mn>4</mn> <msub> <mi>μ</mi> <mi>p</mi> </msub> <msub> <mi>μ</mi> <mi>q</mi> </msub> </mrow> </mfrac> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <mrow> <mn>2</mn> <msub> <mi>μ</mi> <mi>q</mi> </msub> </mrow> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <mrow> <mn>2</mn> <msub> <mi>μ</mi> <mi>p</mi> </msub> </mrow> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <munderover> <mi>Σ</mi> <mrow> <msup> <mi>s</mi> <mo>′</mo> </msup> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>ω</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> </mtable> </mfenced> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>9</mn> <mo>)</mo> </mrow> </mrow></math>
due to the addition of the new material layer, the sub-surface BRDF of the object also changes, so that the sub-surface BRDF of the object after the addition of the material layer needs to be reconstructed through the calculated fourier expansion coefficient, and can be calculated by the following formula (10):
wherein,is the reflection azimuth angle; mu.s0Cosine values at zenith angle of the reflection direction.
Accordingly, after the second BRDF is calculated, the calculated second BRDF may be used for real-time rendering.
As shown in fig. 2, in the present embodiment, the method for calculating the third BRDF specifically includes: step S7 calculates a Cook-torance BRDF of the last-added material layer using second optical property information including a fresnel reflection value representing a percentage of the light reflected at the surface of the object to the incident light and a smoothness representing a degree of smoothness of the surface of the object. In order to better reflect the reflection characteristic of the surface of the object and enable the real-time rendering of the object to be closer to the real situation that light is reflected on the surface of the object, not only the sub-surface BRDF but also the surface BRDF of the object need to be calculated. The Cook-Torrance BRDF describes the reflectivity of the highlight part of the material layer, and can be calculated according to the second optical property information of the finally added material layer, and the calculated Cook-Torrance BRDF is the surface BRDF of the finally added material layer, namely the third BRDF.
As shown in fig. 2, in the present embodiment, the step "performing real-time rendering of the multilayer material object based on the second BRDF and the third BRDF" specifically includes: and S8, linearly superposing the second BRDF and the third BRDF, and generating a rendering result according to the superposition result. The calculated second BRDF may be stored in a texture map and then imported into a renderer, and the renderer performs real-time rendering of the multilayer material object based on the second BRDF and the third BRDF. Specifically, the final real-time rendering is accomplished using the following equation (11):
L(ω0)=R(ω0,ωi)E(ωi)(ωi·n) (11)
wherein, ω isiIs the direction of incident light, omega0The direction of the reflected light is n, the normal vector direction of the surface of the object is n, the E is the radiant emittance of the incident light, the L is the illumination color obtained in the corresponding direction, and the R is the BRDF of the surface of the object.
According to the technical scheme, firstly, calculating the sub-surface BRDF of the base material layer of the multilayer material object according to the first optical property information of the multilayer material object; calculating the sub-surface BRDF of the multilayer material object after the material layer is added on the substrate material layer according to the first optical property information of the multilayer material object, wherein the number of the added material layers is one or more; then calculating a third BRDF according to the second optical property information of the finally added material layer; and finally, performing real-time rendering on the multilayer material object based on the second BRDF and the third BRDF. Because the subsurface BRDF of the object added with each material layer is calculated in an iterative mode, the process that the light rays need to be simulated to propagate inside the object when the subsurface BRDF is calculated by the existing algorithm (such as a ray tracing algorithm) is effectively avoided, the algorithm complexity for calculating the subsurface BRDF of the multilayer material object is greatly reduced, the calculation time is shortened, the efficiency for rendering the multilayer material object in real time is improved, and the method has a wide market prospect in the technical field of computer graphics rendering.
The inventor also provides a real-time rendering device for a multi-layer material object, please refer to fig. 3, which is a schematic structural diagram of the real-time rendering device for a multi-layer material object according to an embodiment of the present invention. The device comprises a calculating unit 1 and a real-time rendering unit 2, wherein the first calculating module 11 is configured to calculate a first BRDF according to first optical property information of the multilayer material object, where the first BRDF is a subsurface BRDF of a base material layer of the multilayer material object; the second calculating module 12 is configured to calculate a second BRDF according to the first optical property information of the multilayer material object, where the second BRDF is a subsurface BRDF of the multilayer material object after a material layer is added on a substrate material layer; the number of the added material layers is one or more; the third calculating module 13 is configured to calculate a third BRDF according to the second optical property information of the last added material layer; and the real-time rendering unit 2 is used for rendering the multilayer material object in real time based on the second BRDF and the third BRDF.
When a real-time rendering device of a multilayer material object is used for real-time rendering, first, the first calculating module 11 calculates a first BRDF according to first optical property information of the multilayer material object. The multi-layer material object is an object to be rendered, and can be automobile glass, furniture and the like, the multi-layer material object is usually composed of a base material layer and a plurality of additive material layers sprayed on the base material layer, and the multi-layer paint is sprayed on the base material layer by layer in an overlapping mode. The first optical property information is information representing the optical property of the object, and comprises the distribution conditions of reflection, scattering, attenuation and the like of light rays in the object.
And then, the second calculating module 12 calculates a second BRDF according to the first optical property information of the multilayer material object, where the second BRDF is a subsurface BRDF of the multilayer material object after adding a material layer on a substrate material layer, and the number of the added material layers is one or more. After a new material layer is added on the substrate material layer, the sub-surface BRDF of the multi-layer material object changes, so that the sub-surface BRDF needs to be recalculated. The number of the added material layers can be one or more according to actual requirements, and the second BRDF is the subsurface BRDF formed by adding one or more material layers on the substrate material layer of the multilayer material object.
The third calculation module 13 then calculates a third BRDF based on the second optical property information of the last added material layer, the third BRDF being the surface BRDF of the last added material layer. In order to better reflect the reflection characteristic of the surface of the object and enable the real-time rendering of the object to be closer to the real situation that light is reflected on the surface of the object, not only the sub-surface BRDF but also the surface BRDF of the object need to be calculated. For the multilayer material object, the surface BRDF of the last added material layer can best reflect the reflection characteristics of the light on the surface of the object, so that the third BRDF can be calculated according to the second optical property information of the last added material layer, wherein the second optical property information is information representing the optical properties of the object and includes the condition that the light is reflected on the surface of the object. The method may then proceed to step S4 for real-time rendering of the multi-layer material object based on the second and third BRDFs. And after the multi-layer material object is rendered in real time based on the second BRDF and the third BRDF, the obtained virtual model of the multi-layer material object can well reflect the reflection characteristic of light on the surface of the object.
According to the technical scheme, firstly, calculating the sub-surface BRDF of the base material layer of the multilayer material object according to the first optical property information of the multilayer material object; calculating the sub-surface BRDF of the multilayer material object after the material layer is added on the substrate material layer according to the first optical property information of the multilayer material object, wherein the number of the added material layers is one or more; then calculating a third BRDF according to the second optical property information of the finally added material layer; and finally, performing real-time rendering on the multilayer material object based on the second BRDF and the third BRDF. Because the subsurface BRDF of the object added with each material layer is calculated in an iterative mode, the process that the light rays need to be simulated to propagate inside the object when the subsurface BRDF is calculated by the existing algorithm (such as a ray tracing algorithm) is effectively avoided, the algorithm complexity for calculating the subsurface BRDF of the multilayer material object is greatly reduced, the calculation time is shortened, the efficiency for rendering the multilayer material object in real time is improved, and the method has a wide market prospect in the technical field of computer graphics rendering.
In this embodiment, the first optical property information of the multilayer material object specifically includes first optical property information of the substrate material layer and first optical property information of the added material layer, and the first optical property information includes a scattering phase function and a single scattering albedo. Because the materials of different material layers are different, the corresponding first optical property information is also different. In computer graphics, the distribution of light inside an object is often characterized using a scattering phase function (phase function) and a single scattering albedo (single scattering albedo). The scattering phase function characterizes the distribution of light at each scattering inside the object, and the single scattering albedo is the ratio of the light scattering rate and the light attenuation rate. The second optical property information includes a fresnel reflection value and a smoothness, the fresnel reflection value is used for representing the percentage of the light reflected on the surface of the object to the incident light, and the smoothness is used for representing the smoothness of the surface of the object.
The multilayer material object comprises the substrate material layer and the added material layer, and the substrate material layer and the added material layer can be converted into a mathematical model which can be processed by a computer by calculating the optical property information of the substrate material layer and the added material layer, so that the subsequent BRDF calculation and rendering operation are facilitated. In the present embodiment, since the mathematical model is calculated in a space after fourier transform, it is necessary to fourier-expand a scattering phase function first. Specifically, the first calculation module 11 first calculates a fourier expansion coefficient of the scattering phase function, which can be calculated by the following formula (1):
<math> <mrow> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <mi>μ</mi> <mo>,</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>)</mo> </mrow> <mo>=</mo> <msup> <mrow> <mo>(</mo> <mo>-</mo> <mn>1</mn> <mo>)</mo> </mrow> <mi>m</mi> </msup> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mi>m</mi> </mrow> <msub> <mi>s</mi> <mi>max</mi> </msub> </munderover> <msub> <mi>λ</mi> <mi>s</mi> </msub> <msubsup> <mi>P</mi> <mrow> <mi>m</mi> <mn>0</mn> </mrow> <mi>s</mi> </msubsup> <mrow> <mo>(</mo> <mi>μ</mi> <mo>)</mo> </mrow> <msubsup> <mi>P</mi> <mrow> <mi>m</mi> <mn>0</mn> </mrow> <mi>s</mi> </msubsup> <mrow> <mo>(</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>)</mo> </mrow> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>1</mn> <mo>)</mo> </mrow> </mrow></math>
wherein m is a Fourier expansion term of m times; μ is the cosine value at the zenith angle of the scattering direction; p is a radical ofm(μ, μ') is the fourier expansion coefficient of the scattering phase function;is a general sphere function (general spherical function); lambda [ alpha ]sFor the Legendre polynomial expansion coefficients of the scattering phase function, in this example, the Henyey-Greenstein phase function is used for the scattering phase function, then λsCan be represented by the following formula (2):
λs=(2s+1)gs(2)
where g is an asymmetry parameter (asymmetry parameter) of the phase function.
In this embodiment, the method for calculating the first BRDF specifically includes: and according to the scattering phase function and the single scattering albedo of the substrate material layer, iteratively calculating the subsurface BRDF of the layer by adopting an Ambartsumain integral equation. Specifically, the Ambartsumain integral equation is shown in the following equation (3):
<math> <mrow> <mfenced open='' close=''> <mtable> <mtr> <mtd> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>+</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mi>α</mi> <mn>4</mn> </mfrac> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>+</mo> <mfrac> <mrow> <mi>α</mi> <msub> <mi>μ</mi> <mi>q</mi> </msub> </mrow> <mn>2</mn> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <mi>α</mi> <msub> <mi>μ</mi> <mi>p</mi> </msub> </mrow> <mn>2</mn> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mi>α</mi> <msub> <mi>μ</mi> <mi>p</mi> </msub> <msub> <mi>μ</mi> <mi>q</mi> </msub> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <munderover> <mi>Σ</mi> <mrow> <msup> <mi>s</mi> <mo>′</mo> </msup> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>,</mo> <mo>-</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> </mtable> </mfenced> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>3</mn> <mo>)</mo> </mrow> </mrow></math>
wherein, alpha is the single scattering albedo, which is the ratio of the light scattering rate and the light attenuation rate corresponding to the substrate material; rmThe coefficient of the mth Fourier expansion term of the BRDF is obtained; mu.siCosine value being the zenith angle of incidence direction; mu.soThe cosine value is the angle of the emission direction zenith. Converting the formula (3) into an n × n numerical value to calculate an algebraic expression, as shown in the following formula (4):
<math> <mrow> <mfenced open='' close=''> <mtable> <mtr> <mtd> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>+</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mi>α</mi> <mn>4</mn> </mfrac> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>+</mo> <mfrac> <mrow> <mi>α</mi> <msub> <mi>μ</mi> <mi>q</mi> </msub> </mrow> <mn>2</mn> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <mi>α</mi> <msub> <mi>μ</mi> <mi>p</mi> </msub> </mrow> <mn>2</mn> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mi>α</mi> <msub> <mi>μ</mi> <mi>p</mi> </msub> <msub> <mi>μ</mi> <mi>q</mi> </msub> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <munderover> <mi>Σ</mi> <mrow> <msup> <mi>s</mi> <mo>′</mo> </msup> <mo>=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <msub> <mi>ω</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>,</mo> <mo>-</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>)</mo> </mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> </mtable> </mfenced> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>4</mn> <mo>)</mo> </mrow> </mrow></math>
μ and ω are the product nodes and their corresponding weights, respectively, as shown in equations (5) and (6) below:
<math> <mrow> <msub> <mi>μ</mi> <mi>n</mi> </msub> <mo>=</mo> <mi>cos</mi> <mrow> <mo>(</mo> <mfrac> <mi>π</mi> <mn>4</mn> </mfrac> <msub> <mi>G</mi> <mi>n</mi> </msub> <mo>+</mo> <mfrac> <mi>π</mi> <mn>4</mn> </mfrac> <mo>)</mo> </mrow> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>5</mn> <mo>)</mo> </mrow> </mrow></math>
<math> <mrow> <msub> <mi>ω</mi> <mi>n</mi> </msub> <mo>=</mo> <mfrac> <mi>π</mi> <mn>4</mn> </mfrac> <msub> <mi>W</mi> <mi>n</mi> </msub> <mi>sin</mi> <mrow> <mo>(</mo> <mfrac> <mi>π</mi> <mn>4</mn> </mfrac> <msub> <mi>G</mi> <mi>n</mi> </msub> <mo>+</mo> <mfrac> <mi>π</mi> <mn>4</mn> </mfrac> <mo>)</mo> </mrow> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>6</mn> <mo>)</mo> </mrow> </mrow></math>
wherein the maximum value of n is the interval [0, 1 ]]Number of intermediate product nodes, GnIs a Gaussian product node; wnWeights corresponding to the Gaussian product nodes; rmIs calculated by the following equation (7):
<math> <mrow> <msup> <mi>R</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mi>α</mi> <mrow> <mn>4</mn> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>+</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mrow> </mfrac> <msup> <mi>p</mi> <mi>m</mi> </msup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>7</mn> <mo>)</mo> </mrow> </mrow></math>
a large number of experiments show that after 10 iterations, R of most materialsmThe convergence precision can be achieved (the coefficient of the mth Fourier expansion term of the BRDF), and the requirement of calculating the BRDF is also met. Thus, at this time, the R is based on the substrate material layermThe subsurface BRDF of the substrate material layer can be calculated.
Accordingly, the first calculating module 11 finishes calculating the first BRDF, and then may calculate the second BRDF according to the first BRDF.
In this embodiment, the optical thickness of the added material layer satisfies a predetermined threshold condition. The preset threshold value can adopt different threshold values according to the requirements of different algorithms. In this embodiment, the method for calculating the second BRDF specifically includes: and calculating the sub-surface BRDF after the material layer is added by using an Invariant Imbedding method on the basis of the sub-surface BRDF of the previous layer. Since the Invariant Imbedding method can only calculate the scattering result of the light ray at most once each time, the optical thickness of the added material layer needs to be small enough, so that the scattering frequency of the light ray on the layer can be guaranteed to be at most once, and before calculating the second BRDF, the optical thickness of the added material layer can meet the preset threshold condition by adjusting the preset threshold, that is, the scattering frequency of the light ray on the layer is at most once. The Invariant embedding method can calculate a new BRDF on the basis of the original BRDF, and the characteristic determines that the method is very suitable for calculating the sub-surface BRDF of the multilayer material object, and the sub-surface BRDF of the base material layer is calculated according to the formulas (1) to (7), so that the sub-surface BRDF of the multilayer material object, namely the second BRDF, can be calculated after all the material layers are added only by adopting the Invariant embedding method to calculate the sub-surface BRDF after the material layers are added each time for the base material layer and calculating one by one. Specifically, the fourier expansion coefficient of the subsurface BRDF after the addition of the material layer is first calculated, and the calculation equation is shown in the following formula (8):
<math> <mrow> <mfenced open='' close=''> <mtable> <mtr> <mtd> <msubsup> <mi>R</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mrow> <mo>(</mo> <mn>1</mn> <mo>-</mo> <mfrac> <mi>Δτ</mi> <msub> <mi>μ</mi> <mn>0</mn> </msub> </mfrac> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> <mrow> <mo>(</mo> <mn>1</mn> <mo>-</mo> <mfrac> <mi>Δτ</mi> <msub> <mi>μ</mi> <mi>i</mi> </msub> </mfrac> <mo>)</mo> </mrow> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <mrow> <mn>4</mn> <msub> <mi>μ</mi> <mn>0</mn> </msub> <msub> <mi>μ</mi> <mi>i</mi> </msub> </mrow> </mfrac> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <mrow> <mn>2</mn> <msub> <mi>μ</mi> <mi>i</mi> </msub> </mrow> </mfrac> <msubsup> <mo>∫</mo> <mn>0</mn> <mn>1</mn> </msubsup> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>)</mo> </mrow> <msup> <mi>du</mi> <mo>′</mo> </msup> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <msub> <mrow> <mn>2</mn> <mi>μ</mi> </mrow> <mn>0</mn> </msub> </mfrac> <msubsup> <mo>∫</mo> <mn>0</mn> <mn>1</mn> </msubsup> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>du</mi> <mo>′</mo> </msup> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> <msubsup> <mo>∫</mo> <mn>0</mn> <mn>1</mn> </msubsup> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mn>0</mn> </msub> <mo>,</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>)</mo> </mrow> <msup> <mi>du</mi> <mo>′</mo> </msup> <msubsup> <mo>∫</mo> <mn>0</mn> <mn>1</mn> </msubsup> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <mo>-</mo> <msup> <mi>μ</mi> <mo>′</mo> </msup> <mo>,</mo> <msup> <mi>μ</mi> <mrow> <mo>′</mo> <mo>′</mo> </mrow> </msup> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msup> <mi>μ</mi> <mrow> <mo>′</mo> <mo>′</mo> </mrow> </msup> <mo>,</mo> <msub> <mi>μ</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> <msup> <mi>du</mi> <mrow> <mo>′</mo> <mo>′</mo> </mrow> </msup> </mtd> </mtr> </mtable> </mfenced> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>8</mn> <mo>)</mo> </mrow> </mrow></math>
wherein n represents the added nth layer material, n-1 represents the (previous) nth layer material added before the nth layer material is added, and alpha is the single scattering reflectance, namely the ratio of the light scattering rate and the light attenuation rate corresponding to the added material layer; rmThe coefficient of the mth Fourier expansion term of the BRDF is obtained; mu.siCosine value being the zenith angle of incidence direction; mu.soΔ τ represents the optical thickness of the added material layer as the cosine value of the angle of the emission direction zenith. Converting equation (8) into an algebraic calculation equation as shown in equation (9) below:
<math> <mrow> <mfenced open='' close=''> <mtable> <mtr> <mtd> <msubsup> <mi>R</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mrow> <mo>(</mo> <mn>1</mn> <mo>-</mo> <mfrac> <mi>Δτ</mi> <msub> <mi>μ</mi> <mi>p</mi> </msub> </mfrac> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <mrow> <mo>(</mo> <mn>1</mn> <mo>-</mo> <mfrac> <mi>Δτ</mi> <msub> <mi>μ</mi> <mi>q</mi> </msub> </mfrac> <mo>)</mo> </mrow> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <mrow> <mn>4</mn> <msub> <mi>μ</mi> <mi>p</mi> </msub> <msub> <mi>μ</mi> <mi>q</mi> </msub> </mrow> </mfrac> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <mrow> <mn>2</mn> <msub> <mi>μ</mi> <mi>q</mi> </msub> </mrow> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <mfrac> <mrow> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> </mrow> <mrow> <mn>2</mn> <msub> <mi>μ</mi> <mi>p</mi> </msub> </mrow> </mfrac> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mo>+</mo> <msub> <mi>a</mi> <mi>n</mi> </msub> <mi>Δτ</mi> <munderover> <mi>Σ</mi> <mrow> <mi>s</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>ω</mi> <mi>s</mi> </msub> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <mi>p</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>)</mo> </mrow> <munderover> <mi>Σ</mi> <mrow> <msup> <mi>s</mi> <mo>′</mo> </msup> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>ω</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <msubsup> <mi>p</mi> <mi>n</mi> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <mo>-</mo> <msub> <mi>μ</mi> <mi>s</mi> </msub> <mo>,</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>)</mo> </mrow> <msubsup> <mi>R</mi> <mrow> <mi>n</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>m</mi> </msubsup> <mrow> <mo>(</mo> <msub> <mi>μ</mi> <msup> <mi>s</mi> <mo>′</mo> </msup> </msub> <mo>,</mo> <msub> <mi>μ</mi> <mi>q</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> </mtable> </mfenced> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>9</mn> <mo>)</mo> </mrow> </mrow></math>
due to the addition of the new material layer, the sub-surface BRDF of the object also changes, so that the sub-surface BRDF of the object after the addition of the material layer needs to be reconstructed through the calculated fourier expansion coefficient, and can be calculated by the following formula (10):
wherein,is the reflection azimuth angle; mu.s0Cosine values at zenith angle of the reflection direction.
Accordingly, the second calculating module 12 finishes calculating the second BRDF, and then may perform a real-time rendering operation using the calculated second BRDF.
In this embodiment, the method for calculating the third BRDF by the third calculating module 13 specifically includes: and calculating the Cook-torance BRDF of the finally added material layer by using second optical property information of the finally added material layer, wherein the second optical property information comprises a fresnel reflection value and a smoothness, the fresnel reflection value is used for representing the percentage of the light rays reflected on the surface of the object to the incident light rays, and the smoothness is used for representing the smoothness degree of the surface of the object. In order to better reflect the reflection characteristic of the surface of the object and enable the real-time rendering of the object to be closer to the real situation that light is reflected on the surface of the object, not only the sub-surface BRDF but also the surface BRDF of the object need to be calculated. The Cook-Torrance BRDF describes the reflectivity of the highlight part of the material layer, and can be calculated according to the second optical property information of the finally added material layer, and the calculated Cook-Torrance BRDF is the surface BRDF of the finally added material layer, namely the third BRDF.
In this embodiment, the step of "performing real-time rendering of the multilayer material object based on the second BRDF and the third BRDF" specifically includes: and linearly superposing the second BRDF and the third BRDF, and generating a rendering result according to the superposition result. The calculated second BRDF may be stored in a texture map and then imported into a renderer, and the renderer performs real-time rendering of the multilayer material object based on the second BRDF and the third BRDF. Specifically, the final real-time rendering is accomplished using the following equation (11):
L(ω0)=R(ω0,ωi)E(ωi)(ωi·n) (11)
wherein, ω isiIs the direction of incident light, omega0The direction of the reflected light is n, the normal vector direction of the surface of the object is n, the E is the radiant emittance of the incident light, the L is the illumination color obtained in the corresponding direction, and the R is the BRDF of the surface of the object.
According to the technical scheme, firstly, calculating the sub-surface BRDF of the base material layer of the multilayer material object according to the first optical property information of the multilayer material object; calculating the sub-surface BRDF of the multilayer material object after the material layer is added on the substrate material layer according to the first optical property information of the multilayer material object, wherein the number of the added material layers is one or more; then calculating a third BRDF according to the second optical property information of the finally added material layer; and finally, performing real-time rendering on the multilayer material object based on the second BRDF and the third BRDF. Because the subsurface BRDF of the object added with each material layer is calculated in an iterative mode, the process that the light rays need to be simulated to propagate inside the object when the subsurface BRDF is calculated by the existing algorithm (such as a ray tracing algorithm) is effectively avoided, the algorithm complexity for calculating the subsurface BRDF of the multilayer material object is greatly reduced, the calculation time is shortened, the efficiency for rendering the multilayer material object in real time is improved, and the method has a wide market prospect in the technical field of computer graphics rendering.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrases "comprising … …" or "comprising … …" does not exclude the presence of additional elements in a process, method, article, or terminal that comprises the element. Further, herein, "greater than," "less than," "more than," and the like are understood to exclude the present numbers; the terms "above", "below", "within" and the like are to be understood as including the number.
As will be appreciated by one skilled in the art, the above-described embodiments may be provided as a method, apparatus, or computer program product. These embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. All or part of the steps in the methods according to the embodiments may be implemented by a program instructing associated hardware, where the program may be stored in a storage medium readable by a computer device and used to execute all or part of the steps in the methods according to the embodiments. The computer devices, including but not limited to: personal computers, servers, general-purpose computers, special-purpose computers, network devices, embedded devices, programmable devices, intelligent mobile terminals, intelligent home devices, wearable intelligent devices, vehicle-mounted intelligent devices, and the like; the storage medium includes but is not limited to: RAM, ROM, magnetic disk, magnetic tape, optical disk, flash memory, U disk, removable hard disk, memory card, memory stick, network server storage, network cloud storage, etc.
The various embodiments described above are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a computer apparatus to produce a machine, such that the instructions, which execute via the processor of the computer apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer device to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer apparatus to cause a series of operational steps to be performed on the computer apparatus to produce a computer implemented process such that the instructions which execute on the computer apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Although the embodiments have been described, once the basic inventive concept is obtained, other variations and modifications of these embodiments can be made by those skilled in the art, so that the above embodiments are only examples of the present invention, and not intended to limit the scope of the present invention, and all equivalent structures or equivalent processes using the contents of the present specification and drawings, or any other related technical fields, which are directly or indirectly applied thereto, are included in the scope of the present invention.