Dynamic scene real-time rendering method under dynamic global ambient illumination
By using hemispherical harmonic functions (HSH) for real-time rendering of dynamic scenes, the problem of rapidly handling ambient lighting, occlusion, and material reflection in complex dynamic scenes is solved, achieving efficient dynamic scene rendering and lighting operations.
Patent Information
- Application Number
- PCT/CN2024/127225
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-13
- Filing Date
- 2024-10-25
- Publication Date
- 2026-02-19
AI Technical Summary
Existing technologies struggle to efficiently handle ambient lighting representation, occlusion transmission, material reflection characteristics, and coordinate rotation in real-time rendering of complex dynamic scenes, resulting in high computational load, low efficiency, and an inability to meet the rapid rendering requirements of dynamic scenes.
Ambient lighting modeling is performed using hemispherical harmonic functions (HSH). Combined with fast rotation methods and occlusion representation, the hemispherical harmonic lighting vector traverses occlusion, and the material reflection characteristics are characterized using the reflection angle spectrum, thus achieving fast lighting and shadow calculation.
It significantly reduces the amount of online real-time computation, supports rapid rendering of dynamic and complex scenes, and provides freedom in environmental and material changes, making it suitable for real-time rendering of dynamic scenes.
Smart Images

Figure CN2024127225_19022026_PF_FP_ABST
Abstract
Description
A dynamic scene real-time rendering method under dynamic global ambient light TECHNICAL FIELD
[0001] The present application belongs to the technical field of three-dimensional computer image processing, and particularly relates to a dynamic scene real-time rendering method based on a spherical harmonic function under dynamic global ambient light. BACKGROUND
[0002] With the increasingly widespread application of realistic games, virtual reality and augmented reality, real-time rendering in complex dynamic scenes faces great challenges. The main challenge in this field is how to obtain complex lighting on the rendered pixel and efficiently obtain the required rendering integral. To solve this problem, Sloan et al. proposed a precomputed radiance transfer (PRT) framework for scene rendering under ambient light (see references
Peter-Pike Sloan, Jan Kautz, and John Snyder. 2002. Precomputed radiance transfer for real-time rendering in dynamic, low-frequency lighting environments. ACM Trans. Graph. 21, 3 (July 2002), 527-536
Jan Kautz, Peter-Pike Sloan, and John Snyder. 2002. Fast, arbitrary BRDF shading for low-frequency lighting using spherical harmonics. In Proceedings of the 13th Eurographics workshop on Rendering (EGRW'02). Eurographics Association, Goslar, DEU, 291-296.
[0003] Spherical Harmonics (SH) was first applied in PRT due to its orthogonality and completeness on the whole sphere, which supports fast rotation operation, triple product and multiple product required by occlusion operation. However, SH is inefficient in expressing high frequency signals, and can only achieve good results in rendering low frequency light and shadow image and diffuse reflection material, which limits its application in complex scenes. Therefore, Ng et al. proposed Spherical Wavelet (SW) function (reference document
Ren Ng, Ravi Ramamoorthi, and Pat Hanrahan. 2003. All-frequency shadows using nonlinear wavelet lighting approximation. ACM Trans. Graph. 22, 3 (July 2003), 376-381.
Yu-Ting Tsai and Zen-Chung Shih. 2006. All-frequency precomputed radiance transfer using spherical radial basis functions and clustered tensor approximation. ACM Trans. Graph. 25, 3 (July 2006), 967-976.
[0004] Spherical Harmonics (SH), Spherical Wavelet (SW) and Radial Basis Function (SRBF) also face a common problem in expressing the reflection characteristics of the material, that is, the Bidirectional Reflectance Distribution Function (BRDF) of the material needs to be projected onto the basis function to apply the orthogonality to calculate the dot product in the hemisphere space. This additional BRDF projection also brings additional computational load. In addition, if the optical transfer function is obtained in advance through PRT, the occlusion relationship and material reflection characteristics are fixed, although very high dynamic rendering characteristics can be obtained, but it can only be used for static scenes.
[0005] Therefore, the application of complex dynamic scene needs to further explore new rendering methods, match the coordinate rotation, triple and multiple integrals, material reflection characteristic expression and other fast acquisition methods, so as to obtain better rendering effect.
[0006] SUMMARY
[0007] In order to solve the problem of real-time rendering of complex dynamic scene, the application provides a dynamic scene real-time rendering method under dynamic global environment illumination, which is based on Hemispherical harmonics (HSH) rotation, triple and multiple integrals, material reflection characteristics and full frequency rendering.
[0008] To achieve the above object, the application provides the following technical scheme.
[0009] A dynamic scene real-time rendering method under dynamic global environment illumination, comprising the following steps:
[0010] Step 1: using spherical harmonics SH to model illumination;
[0011] Step 2: using the fast rotation method of spherical harmonics SH to perform coordinate system conversion;
[0012] Step 3: converting spherical harmonics illumination based on spherical harmonics SH to hemispherical harmonics illumination based on hemispherical harmonics HSH;
[0013] Step 4: obtaining expression of hemispherical harmonics occlusion;
[0014] Step 5: performing hemispherical harmonics illumination occlusion operation;
[0015] Step 6: estimating reflected light based on material reflection angle spectrum;
[0016] Step 7: obtaining reflection light intensity of the concerned direction.
[0017] Further, in step 1, a global coordinate system of the rendering scene is established, and the environment illumination is expressed as linear superposition of real spherical harmonics in the global coordinate system.
[0018] Further, in step 2, the object in computer graphics rendering is discretized into many elements, the element to be rendered is selected, the local coordinate system centered on the element is established, the Euler angle of the conversion from the global coordinate system to the local coordinate system is obtained, and the rotation matrix of the spherical harmonics is constructed, so as to convert the global spherical harmonics illumination coefficient into local spherical harmonics illumination through the rotation matrix.
[0019] Further, in step 3, the local spherical harmonic light coefficients are converted into hemispherical harmonic light coefficients by using a pre-computed conversion matrix from spherical harmonic SH to hemispherical harmonic HSH.
[0020] Further, in step 4, the occlusion is divided into multiple layers from far to near, and the innermost layer of occlusion is the self-occlusion of the object, and the hemispherical harmonic coefficients of each layer of occlusion are obtained by decomposing the distribution of the occlusion with hemispherical harmonics.
[0021] Further, the occlusion includes static occlusion and dynamic occlusion, the static occlusion is determined by pre-computation, and the dynamic occlusion is determined by sampling computation.
[0022] Further, in step 5, the hemispherical harmonic Kleibsh-Gordon coefficients are pre-computed to obtain the hemispherical harmonic transmission tensor; and based on the hemispherical harmonic light coefficients, the outermost layer of hemispherical harmonic occlusion coefficients and the hemispherical harmonic transmission tensor, the hemispherical harmonic light after penetrating the outermost layer is obtained; and the hemispherical harmonic light coefficients of the final illumination to the material are obtained by penetrating the occlusion layer by layer.
[0023] Further, in step 6, the reflection angle spectrum of the material is obtained, and based on the final illumination hemispherical harmonic light coefficients and the reflection angle spectrum, the reflection hemispherical harmonic coefficients are obtained.
[0024] Further, in step 7, the hemispherical harmonic values of the hemispherical distribution pre-computed are stored in a table form, the reflection direction to be estimated is determined, the hemispherical harmonic value of the direction is obtained by looking up the table, and the reflection intensity of the direction is obtained by combining the corresponding reflection hemispherical harmonic coefficients.
[0025] Compared with the prior art, the present application has the following beneficial effects:
[0026] 1. The spherical harmonic SH is used to describe the ambient light in the present application, and fast light rotation is supported.
[0027] 2. The fast conversion from spherical harmonic light to hemispherical harmonic light is supported, and the occlusion is also expressed by hemispherical harmonics.
[0028] 3. The transmission tensor used in the operation method of the hemispherical harmonic light vector (HSH Illumination Vector) penetrating the hemispherical harmonic occlusion (HSH Occlusion) has sparsity and symmetry, which can greatly reduce the number of non-zero elements to be stored and the associated multiplication and addition times, so that the occlusion penetration operation is fast.
[0029] 4. The reflection characteristics of the material are obtained by using the reflection angle spectrum RAS based on the hemispherical harmonic, the reflection angle spectrum can be pre-computed, and it has sparsity, occupies small memory, and the reflection of the light penetrating the hemispherical occlusion through the material can be calculated by multiplying the reflection angle spectrum and the incident light hemispherical harmonic coefficients, so that the material reflection is fast.
[0030] 5. The method of the present invention significantly reduces the amount of online real-time computation, making it suitable for rendering and lighting operations in dynamic and complex scenes. Compared with traditional pre-calculated rendering, the present invention also provides greater freedom. For example, changing the spherical harmonic lighting can realize environmental transformation, updating the hemispherical harmonic occlusion coefficient can realize changes in occlusion relationships, and updating the material reflection angle spectrum can realize changes in materials. Attached Figure Description
[0031] Figure 1 is a flowchart of the method of the present invention;
[0032] Figure 2 shows the shape of the first 6 spherical harmonics. The vertical axis is the elevation angle order l of the hemispherical harmonics, and the horizontal axis is the azimuth angle ordinal number m of the spherical harmonics.
[0033] Figure 3 shows the shape of the first 15 hemispherical harmonic functions. The vertical axis is the order l of the hemispherical harmonic function, the horizontal axis is the azimuth ordinal number m of the hemispherical harmonic function, and the number k next to the dashed arrow is the number of terms in the serialization of the hemispherical harmonic function.
[0034] Figure 4 is a block diagram illustrating the principle of graphics rendering based on hemispherical harmonic functions in this invention.
[0035] Figure 5 illustrates the decomposition principle of the real spherical harmonic function S30 within the same order function after rotation.
[0036] Figure 6 is a schematic diagram of the transformation matrix used to equivalently transform the coefficients of spherical harmonic functions into the coefficients of hemispherical harmonic functions;
[0037] Figure 7 is a schematic diagram of hemispherical harmonic illumination after multiple layers of hemispherical harmonic shading;
[0038] Figure 8 shows the distribution of effective elements of the transmission tensor; the larger the diameter of the sphere, the larger the absolute value.
[0039] Figure 9 shows the reflection angle spectrum of a material. The vertical axis represents the code of the incident hemispherical harmonic illumination, and the horizontal axis represents the code of the reflected hemispherical harmonic illumination. The intensity of the reflection mode is represented by grayscale. Detailed Implementation
[0040] The present invention will now be described in further detail with reference to the accompanying drawings.
[0041] This invention is a real-time dynamic scene rendering method based on hemispherical harmonic functions. As shown in Figure 1, the method mainly includes the following steps: modeling illumination using spherical harmonic functions (SH); performing coordinate system transformation using the fast rotation method of SH; converting SH spherical harmonic illumination to hemispherical harmonic (HSH) illumination; representing hemispherical harmonic occlusion; using an algorithm for illumination passing through hemispherical harmonic occlusion; estimating reflected light based on the material's reflection angle spectrum; and calculating light and shadow.
[0042] In computer graphics rendering, objects are discretized into many patches, and the core of rendering is to calculate the radiance of a specific direction according to the incident radiance, the occlusion of the patch, and the reflection characteristics of the material.
[0043] Ambient light is characterized by spherical harmonics in the global coordinate system, and the coefficients from low frequency to high frequency are obtained.
[0044] The selected patch is drawn, a local coordinate system is established with it as the center, the Euler angles of the conversion from the global coordinate system to the local coordinate system are obtained, and then the rotation matrix of the spherical harmonic function is calculated. The global spherical harmonic lighting coefficients are converted into local spherical harmonic lighting through the rotation matrix.
[0045] The pre-calculated spherical harmonic function SH to hemispherical harmonic function matrix is used to convert the local spherical harmonic lighting coefficients into hemispherical harmonic lighting coefficients.
[0046] The occlusion is divided into multiple from far to near, which are V1, V2, …, to V-self (self-occlusion of the object), and each occlusion distribution is decomposed by hemispherical harmonics to obtain the hemispherical harmonic coefficients of the occlusion. Static occlusion (such as self-occlusion) can be pre-calculated, and dynamic occlusion needs to be sampled and calculated.
[0047] The Clebsch-Gordan coefficients of the pre-calculated hemispherical harmonic function are stored as a three-order tensor in order, called hemispherical harmonic transfer tensor (HSH Transfer Tensor). The hemispherical harmonic lighting coefficients, the outermost hemispherical harmonic occlusion coefficients, and the tensor are multiplied to obtain the hemispherical harmonic lighting after penetrating the outermost layer.
[0048] As above, the occlusion is penetrated layer by layer to obtain the hemispherical harmonic lighting coefficients of the final lighting to the material.
[0049] The reflectance angular spectrum (RAS) of the material is pre-calculated, as described in the references
Yi Zheng, Lin Lin, Changpeng Ding, Yonghui Hou, and Xiaofei Li, “Hemispherical harmonic illumination and reflectance angular spectrum,” Optics Express, 32(5), 6823-6837, 2024
Material reflection characteristic representation and rendering method based on modal light illumination, Chinese invention patent, patent number ZL 202110467306.8
[0050] The half-sphere harmonic function value of the half-sphere distribution is pre-calculated and stored in a table form, the reflection direction to be estimated is determined, the value of the half-sphere harmonic function of the direction is obtained by looking up the table, the value is multiplied by the corresponding reflection half-sphere harmonic coefficient and accumulated to obtain the reflection intensity of the direction. The functions involved in the application are described as follows:
[0051] (1) Real Spherical Harmonics
[0052] The expression formula of the real spherical harmonic function is as follows:
[0053] Among them:
[0054] θ is the zenith angle in the global spherical coordinate system, ranging from 0 to π;
[0055] is the zenith angle in the global spherical coordinate system, ranging from 0 to 2π;
[0056] is Legendre polynomials;
[0057] is Associated Legendre polynomials, expressed as follows:
[0058] The first 6 orders of the real spherical harmonic function are shown in reference to Fig. 2.
[0059] is a set of orthogonal complete functions on the sphere, so the distribution on the sphere can be approximated by expanding it, and the formula is as follows:
[0060] The orthogonality of the real spherical harmonic function is reflected in the following formula:
[0061] Where L is the approximate truncation order, and there are (L+1) 2 real spherical harmonic functions participate in the approximation, and there are (L+1) 2 coefficients The order is arranged from low to high, and the order m is arranged from small to large, so that the approximation coefficient vector can be obtained. In order to simplify, a single subscript is used to record the coefficient vector, denoted as
[0062] (2) Hemi-Spherical Harmonics
[0063] The function expression is
[0064] The first 15 terms of the hemi-spherical harmonics are shown in Fig. 3.
[0065] The hemi-spherical harmonics are an orthogonal complete function set on the hemi-sphere, so the distribution on the hemi-sphere can be approximated by expansion thereof, and the formula is as follows:
[0066] The hemi-spherical harmonics are orthogonal, and the orthogonality is reflected in the following formula:
[0067] where L is the truncation order of approximation, and there are 0.5(L+1)(L+2) hemi-spherical harmonics participating in approximation, and there are 0.5(L+1)(L+2) coefficients corresponding to the order arranged in order from low to high, and the ordinal number m from small to large, and the approximation coefficient vector is obtained. s In order to simplify, a single subscript is used to record the coefficient vector, denoted as [μ1μ2…μ
[0068] The specific steps of the dynamic scene real-time rendering method under dynamic global ambient light of the application include: step 1: establishing a global coordinate system, and representing the ambient light by using a spherical harmonic function.
[0069] Step 1.1: establishing a global coordinate system of the rendering scene;
[0070] As shown in Fig. 4, the origin of the coordinate system is O, and the three orthogonal axes are Global-X, Global-Y and Global-Z, and the coordinate system is denoted as a global coordinate system, wherein: 1 is a spherical harmonic light distribution; 2 is a hemi-spherical harmonic light; 3 is a hemi-spherical occlusion; and 4 is a rendered fragment P.
[0071] Step 1.2: obtaining a global incident light irradiance distribution, and expressing the global incident light irradiance distribution as a linear superposition of real spherical harmonic functions;
[0072] The distribution on the sphere far away from the scene is projected onto the spherical harmonic function to obtain a global spherical harmonic light vector The vector is the spherical harmonic light distribution (spherical harmonic light distribution 1 in Fig. 4).
[0073] where G is the number of truncated terms of spherical harmonics, g = 1, 2, …, G, and G = (L + 1) if the first L real spherical harmonics are used for approximation 2 ;
[0074] Step 2: Establish a local coordinate system of the rendering patch, calculate Euler angles of the conversion from the local coordinate system to the global coordinate system, and then construct a rotation matrix of the spherical harmonics to convert the global spherical harmonic light coefficient vector into a local spherical harmonic light coefficient vector.
[0075] Step 2.1: Establish a local coordinate system of the rendering patch;
[0076] As shown in FIG. 4, the spatial coordinates of the patch center point P are (x p ,y p ,z p ), the normal direction is established as the local coordinate system with P as the origin, the normal direction as the Z axis (Local Z in FIG. 4), and the two perpendicular directions on the tangent plane passing through P as the X axis (Local X) and the Y axis (Local Y) If the material is isotropic, the direction of the X axis can be arbitrarily selected; if the material is anisotropic, the priority of the X axis is consistent with the horizontal axis direction determined when measuring the reflection characteristics of the material, thereby reducing the calculation amount required for the calculation of the interaction and reflection of light and the material. If the material is isotropic, the direction of the X axis can be arbitrarily selected; if the material is anisotropic, the priority of the X axis is consistent with the horizontal axis direction determined when measuring the reflection characteristics of the material, thereby reducing the calculation amount required for the calculation of the interaction and reflection of light and the material.
[0077] Step 2.2: Obtain Euler angles a, b, g from the global coordinate system to the local coordinate system;
[0078] The definition of Euler angles is related to the rotation order, and based on the rotation of spherical harmonics around the Z axis, the operation amount for constructing the rotation matrix is small, and the rotation of ZYZ order is used but not limited to it, which corresponds to Euler angles a, b, g respectively; the rotation matrix can be determined by the following formula:
[0079] After multiplication, the following expression can be obtained:
[0080] According to the three-axis directions of the global coordinate system and the local coordinate system, the rotation matrix can be constructed as follows,
[0081] Therefore, the Euler angles can be calculated as:
[0082] Step 2.3: Construct the rotation matrix R SH (α,β,γ) of the spherical harmonics, and the light coefficient vector is converted from the global to the local.
[0083] Since fragment lighting calculations are performed in the local coordinate system, the spherical harmonic lighting coefficients in the global coordinate system need to be transformed to the local coordinate system. This transformation can be done in two ways: one is to convert the global spherical lighting... Light distribution based on Euler angles transformed into a local coordinate system (θ′, The first step involves using the zenith angle and azimuth angle in the local coordinate system. Then, real spherical harmonic functions are used for decomposition to obtain the spherical harmonic illumination coefficient vector in the local coordinate system. The second step involves constructing a rotation matrix R for the spherical harmonic function coefficients based on Euler angles. SH (α,β,γ), and then directly calculate the spherical harmonic illumination coefficient vector in the local coordinate system using the global spherical harmonic illumination coefficient vector. This invention employs the second method, which has the significant advantage of requiring far less computation than the first method. Especially for real spherical harmonic functions, a coefficient rotation of a specific order does not affect coefficient rotations of other orders, therefore R... SH (α,β,γ) is a block sparse diagonal matrix, where the size of each block corresponds to the ordinal number in each order. That is, the coefficients of each real spherical harmonic function after rotation are only derived from the linear combination of the coefficients in the corresponding order of the original spherical harmonic function, as shown in Figures 3 and 5.
[0084] in It is a global spherical harmonic function After rotation, the projection onto the local spherical harmonic function The coefficients, specifically their values, depend on the Euler angles. Following the block matrix format, the above coefficient rotation matrix can also be expressed as:
[0085] Step 2.2 has already calculated the Euler angles α, β, γ. The coefficient rotation matrix R... SH It can be decomposed into the product of three rotations: a rotation of angle α around the Z-axis, a rotation of angle β around the Y-axis, and a rotation of angle γ around the Z-axis. The coefficient rotation matrices for the two rotations around the Z-axis are easily obtained from the formula for spherical harmonic functions. The rotation around the Y-axis needs to be further decomposed into a 90° positive rotation around the X-axis, a β-rotation around the Z-axis, and finally a 90° negative rotation around the X-axis. SH (α,β,γ)=Z γ Y β Z α =Z γ X -90 Z β X +90 Z α (15)
[0086] Where X +90 and X -90The rotation matrix of spherical harmonic function coefficients corresponding to the rotation of 90 degrees in positive direction and 90 degrees in negative direction around the X axis, which is a fixed block diagonal matrix independent of Euler angles, can be pre-computed.
[0087] The following is an example of the rotation matrix of the first 3 order spherical harmonic functions (9 terms in total).
[0088] Z β and Z γ are basically the same as Z α , only replace α with β and γ in the corresponding positions.
[0089] The calculation of higher order X -90 and X -90 can be obtained by analytical or numerical methods.
[0090] Step 2.4: Calculate the spherical harmonic light coefficient vector in the local coordinate system
[0091] Using the rotation matrix R SH (α,β,γ) of spherical harmonic function coefficients, calculate the coefficient vector of the local spherical harmonic light.
[0092] The coefficient vector of the local spherical harmonic light is obtained
[0093] Step 3: Convert the local spherical harmonic light into equivalent hemispherical harmonic light.
[0094] For the rendered pixel, only the upper hemisphere light will reach it without considering other occlusions, so the spherical harmonic light in the local coordinate system needs to be converted into equivalent hemispherical harmonic light. For convenience, the conversion from spherical harmonic function coefficients to hemispherical coefficients is directly calculated without sampling in the spatial domain and then projecting to calculate the coefficients.
[0095] Step 3.1 uses the first J terms of hemispherical harmonic functions to expand the first G terms of spherical harmonic functions on the hemispherical surface to obtain the conversion matrix, denoted as Ψ.
[0096] Where is calculated by the following formula. There is a truncation error in the above formula, so the approximately equal sign is used.
[0097] This conversion matrix is fixed and can be pre-computed and stored, without real-time calculation. Its form is shown in Figure 6.
[0098] Step 3.2 converts the coefficient vector of the local spherical harmonic light coefficient vector of the spherical harmonics illumination The superscript 0 represents the illumination at the farthest distance from the fragment without occlusion.
[0099] Step 4: Sample the occlusion distribution (also called visibility distribution) of the fragment P, project it to the spherical harmonics, the occlusion coefficient vector.
[0100] The occlusion of a fragment is complex, both the occlusion of the fragment by the rendered object itself and the occlusion by other objects, especially in dynamic rendering process, the occlusion distribution is changing all the time. Here the occlusion is divided into K layers from far to near, the innermost layer is the self-occlusion, then project the K layer occlusion distribution to the spherical harmonics to obtain the K layer occlusion coefficient vector, refer to FIG. 7.
[0101] The k-th spherical harmonics occlusion coefficient vector is denoted as
[0102] Step 5: Obtain the illumination radiance distribution after transmitting the K layer spherical harmonics occlusion.
[0103] Step 5.1 Calculate the Clebsch-Gordan coefficients of the spherical harmonics, construct the transmission tensor.
[0104] After expanding and arranging it, we can obtain:
[0105] The matrix Ω (J rows and Q columns) is called the spherical harmonics transmission matrix, which connects the incident spherical harmonics illumination coefficient vector and the spherical harmonics occlusion coefficient vector, and is used to calculate the spherical harmonics illumination distribution after occlusion. The graph of Ω is referred to FIG. 8. The elements H j ·H q (j = 1, 2, …, J; q = 1, 2, …, Q) are spherical distribution functions, which can be expanded by spherical harmonics:
[0106] λ j,q,t is the triple integral of the spherical harmonics, refer to the triple integral of the real spherical harmonics, and λ j,q,t is called the Clebsch-Gordan coefficient of the spherical harmonics, and Ω is expressed as the product of a third-order tensor and a spherical harmonics vector.
[0107] The tensor of the above formula is denoted as called the transmission tensor, and Ω is rewritten in the form of matrix stacking:
[0108] The symbol → in the formula represents the next layer; The tensor has a fixed expression, independent of the incident light and the shielding distribution, which can be pre-calculated and stored. Due to the use of spherical harmonics, the elements only generate one-sixth of the transmission tensor of the spherical harmonics of the same order, and have strong sparsity characteristics. In addition, the symmetry is used to reduce the calculation amount and speed up the calculation, which can meet the real-time rendering requirements, The morphological reference is shown in FIG. 8.
[0109] Step 5.2 Calculate the hemispherical harmonic illumination coefficient vector Transmission through the kth hemispherical harmonic shielding coefficient vector The obtained illumination coefficient vector
[0110] Substitute formula (27) into formula (24) and arrange it to obtain the following expression,
[0111] W j ,j=1,2,…,J is a Q-row T-column matrix,
[0112] Thus, the hemispherical harmonic illumination coefficient vector after transmission through the kth hemispherical shielding can be obtained as is a T-dimensional vector,
[0113] Step 5.3 Repeat step 5.2 until the illumination is transmitted through the innermost shielding (self-shielding) to obtain the hemispherical harmonic illumination coefficient vector of the real illumination on the material
[0114] Step 6: Obtain the reflectance angular spectrum RAS (Reflectance Angular Spectrum) of the material, and then multiply it by the hemispherical harmonic illumination coefficient vector on the material to obtain the reflected hemispherical harmonic coefficient vector.
[0115] Step 6.1 Obtain the reflectance angular spectrum of the material, which is a set of two-dimensional matrices encoded by hemispherical harmonics. The obtaining process is described in reference
Yi Zheng, Lin Lin, Changpeng Ding, Yonghui Hou, and Xiaofei Li, “Hemispherical harmonic illumination and reflectance angular spectrum,” Optics Express, 32(5), 6823-6837, 2024
Material reflectance characterization and rendering method based on modal light illumination, Chinese invention patent, patent number ZL 202110467306.8
[0116] The figure of RAS is shown in Fig. 9, and the spherical harmonic coefficient vector of the reflected light is denoted as The following formula is used for calculation:
[0117] Step 7: Calculate the reflection intensity of the direction of interest.
[0118] The spherical harmonic coefficient of the reflected light is obtained Then, the reflection intensity of any direction can be calculated, and the formula is:
[0119] Therefore, the value of the first T spherical harmonics at the position is calculated One method is to obtain the value of the first T spherical harmonics at the position by real-time calculation, which is direct but slightly large in calculation amount. Another method is to calculate the values of the first T spherical harmonics at multiple positions distributed on the hemisphere in advance, store them according to the table method, and obtain the value of the specific spherical harmonic at the position by table lookup and interpolation in actual use, which trades storage amount for calculation speed and has better real-time performance.
[0120] The above only describes the preferred embodiments of the present application and is not used to limit the present application. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for real-time rendering of dynamic scenes under dynamic global ambient lighting, characterized in that, The method comprises the following steps: Step 1: modeling the illumination by using spherical harmonics SH; Step 2: performing coordinate system conversion by using a fast rotation method of spherical harmonics SH; Step 3: converting spherical harmonic illumination based on spherical harmonics SH into hemispherical harmonic illumination based on hemispherical harmonics HSH; Step 4: obtaining an expression of hemispherical harmonic occlusion; Step 5: performing hemispherical harmonic light penetration through hemispherical harmonic occlusion; Step 6: estimating reflected light based on a material reflection angle spectrum; Step 7: obtaining the reflected light intensity of a direction of interest.
2. The method of claim 1, wherein, In step 1, a global coordinate system of a rendering scene is established, and ambient light is expressed as a linear superposition of real spherical harmonics in the global coordinate system.
3. The method of claim 1, wherein, In step 2, an object in computer graphics rendering is discretized into a plurality of patches, a selected patch is drawn, a local coordinate system centered on the patch is established, Euler angles for conversion from the global coordinate system to the local coordinate system are obtained, and a rotation matrix of spherical harmonics is constructed, so as to convert global spherical harmonic illumination coefficients into local spherical harmonic illumination by using the rotation matrix.
4. The method of claim 1, wherein, In step 3, a precomputed conversion matrix of spherical harmonics SH to hemispherical harmonics HSH is used to convert the local spherical harmonic illumination coefficients into hemispherical harmonic illumination coefficients.
5. The method of claim 1, wherein, In step 4, the occlusion is divided into multiple layers from far to near, the innermost layer of occlusion is the self-occlusion of the object itself, and the occlusion distribution of each layer is decomposed by using hemispherical harmonics to obtain hemispherical harmonic coefficients of the occlusion.
6. The method of claim 5, wherein, The occlusion comprises static occlusion and dynamic occlusion, the static occlusion is determined by precomputation, and the dynamic occlusion is determined by sampling computation.
7. The method of claim 1, wherein, In step 5, Kleibsh-Gordon coefficients of hemispherical harmonics are obtained by precomputation to construct a hemispherical harmonic transmission tensor; based on the hemispherical harmonic illumination coefficients, the outermost layer hemispherical harmonic occlusion coefficients and the hemispherical harmonic transmission tensor, hemispherical harmonic illumination after penetrating the outermost layer is obtained. In this way, the occlusion is penetrated layer by layer to obtain the hemispherical harmonic illumination coefficients of the final illumination to the material.
8. The method of claim 1, wherein, In step 6, the reflection angle spectrum of the material is obtained, and based on the final illumination hemispherical harmonic coefficients and the reflection angle spectrum, reflection hemispherical harmonic coefficients are obtained.
9. The method of claim 1, wherein, In step 7, the hemispherical harmonic function values of the hemispherical distribution are stored in a table form in advance, the reflection direction to be estimated is determined, the hemispherical harmonic function value of the direction is obtained by looking up the table, and the reflection intensity of the direction is obtained by combining the corresponding reflection hemispherical harmonic coefficients.
Citation Information
Patent Citations
Rendering method based on hemispherical orthogonal function
CN110728748A
Method for producting of spherical harmonic lighitng locally, and spherical harmonic rendering apparatus
KR1020150137975A