Rendering method based on BRDF of directional scattering microfacet material
The BRDF model based on directional scattering microfacet materials solves the problems of dark rendering results under high roughness and insufficient research on microfacet materials, achieving more detailed material performance and a wider performance range, and is suitable for real-time and offline rendering. , providing rendering effects that could not be achieved with previous models.
Patent Information
- Application Number
- CN202110164349.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-05
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-02-05
AI Technical Summary
The existing BRDF model's rendering results are extremely dark under high roughness, and there is insufficient research on microfacet materials, and the range of performance is limited, making it difficult to simulate objects in the real physical world.
Using the BRDF model based on directional scattering microfacet materials, the normal distribution function is approximated by calculating the normal direction of the activated surface microfacets and the spherical Gaussian function, and the energy compensation of multiple scatterings is considered, and the macro and micro roughness parameters are used to adjust the material performance. , expand the performance range of BRDF.
It achieves more detailed material performance, is suitable for expressing plastics and other materials, has low computational overhead, is suitable for real-time and offline rendering, provides rendering effects that cannot be achieved by previous models, and has flexible parameter adjustment.
Smart Images

Figure CN114937119B
Abstract
Description
Technical Field
[0001] The present invention relates to a technology in the field of computer graphics rendering, in particular to a rendering method of a bidirectional reflectance distribution function (BRDF) model based on microsurface theory. Background Art
[0002] Bidirectional reflectance distribution function describes the radiance in the outgoing direction after a given incident direction radiance. It is an essential tool for describing the reflectance properties of materials and rendering materials correctly. A simple, accurate and widely applicable BRDF is the consistent pursuit of all current BRDF research work.
[0003] The physical model, or the BRDF reflection model based on the microfacet structure theory, is an indispensable part of the current mainstream physical based rendering (PBR). The Cook-Torrance model is an important representative of them and is a prototype model based on the microfacet theory BRDF. The Cook-Torrance model has a clear analytical expression, small calculation amount and memory usage, and can be used for real-time rendering; it has strong controllability, and artists can intuitively control the model performance by adjusting the roughness parameters, thereby providing quite good visual effects. It is the best choice in the current film and television industry and the game industry.
[0004] Microsurface theory assumes that every point on a macroscopic rough surface is composed of countless microsurfaces underneath, and the lighting performance on the macroscopic surface depends on the integral of the light reflected on these microsurfaces. Therefore, the geometric structure of the microsurfaces and the material of the microsurfaces will have an important impact on the macroscopic integral. However, at present, most of the work is focused on the study of microsurface geometry, and there is little research on microsurface materials. Most of them are limited to perfect mirror material microsurfaces represented by the Cook-Torrance model or perfect diffuse reflection microsurfaces represented by the OrenNayar model, which limits the performance of macroscopic materials.
[0005] At the same time, the initial Cook-Torrance BRDF lighting model only considers the single reflection of light between micro-surfaces, and ignores the subsequent multiple scattering, that is, when the light is blocked by other micro-surfaces, the energy that cannot be directly emitted to the sight direction after a single reflection will be directly ignored. As the roughness coefficient increases, the probability of light being blocked increases, and more and more multiple scattered light is ignored, and the energy loss is also increasing, resulting in abnormally dark rendering results under high roughness. Summary of the invention
[0006] In view of the above-mentioned deficiencies in the prior art, the present invention proposes a rendering method based on the BRDF of a directional scattering microfacet material, which utilizes the microsurface theoretical BRDF model (BRDF with microfacet material, mmBRDF) of the microsurface material in the real-time rendering of the current popular commercial game engine and the calculation of the ray tracing renderer, and provides rendering effects that other reflection models could not provide before.
[0007] The present invention is achieved through the following technical solutions:
[0008] The present invention relates to a rendering method based on BRDF of directional scattering micro-facet material, which performs real-time rendering and ray tracing rendering, and specifically comprises:
[0009] Step 1: Given the incident light ray i, the incident angle o, and the macro surface normal direction n, calculate the corresponding micro surface normal direction m of the activated surface k .
[0010] The active surface is a micro-surface that contributes to the final emitted light in the micro-surface hypothesis.
[0011] Step 2: Based on the Cook-Torrance BRDF model based on the V-groove assumption, the product of the Fresnel term F and the geometric attenuation factor G, as well as the Jacobi determinant that transforms the coordinate system from the local microfacet coordinate system to the macroscopic incident light coordinate system, is synthesized into a term M, and the result is calculated.
[0012] Step 3: Use a spherical Gaussian function with the micro-facet normal of the activated surface as the central axis to approximate the normal distribution function, and perform normalization. Take the lobe sharpness r1 of the spherical Gaussian function as the macro material roughness parameter.
[0013] Step 4: Use a normalized spherical Gaussian function with the micro-surface normal as the central axis to represent the micro-surface material, and take the lobe sharpness r2 of the spherical Gaussian function as the roughness parameter of the micro-surface material.
[0014] Step 5: Use the properties of the spherical Gaussian function to obtain the product of the normal distribution function in step 3 and the spherical Gaussian function representing the microsurface material in step 4, and multiply it with the result in step 2 to obtain the calculation result of the BRDF considering the microsurface material properties under single scattering.
[0015] Step 6: If you want to calculate the energy compensated in multiple scattering, use Lee's multiple scattering calculation method to obtain the normal direction of the microfacet in the kth reflection, and repeat steps 1-5, accumulating the kth result to the final result until all the results of the set scattering times are included in the calculation.
[0016] Step 7: Parameter adjustment. Adjust the macro material roughness parameter r1 to control the overall highlight range of the material, and then adjust the micro surface material roughness r2 to control the performance of the highlight edge tailing part. This will achieve more precise control of material performance and obtain a rendering effect that is closer to physical reality.
[0017] Technical Effects
[0018] The mmBRDF model proposed in the present invention solves the shortcomings of previous illumination reflection models, such as limited performance range, insufficient controllability, and poor simulation effect on objects in the real physical world.
[0019] Compared with other previous technologies, the present invention has the following technical effects:
[0020] 1) The calculation of micro-facet materials expands the performance range of BRDF. Compared with the measured data, it is found that the calculation method of BRDF in the present invention is more suitable for expressing materials such as plastics.
[0021] 2) The application is simple and can be directly used in real-time rendering or offline rendering processes on multiple platforms without making underlying modifications to the renderer.
[0022] 3) Low computational overhead. It not only provides more detailed performance results, but also the BRDF calculation overhead of single scattering is negligible compared to the cook-Torrance BRDF. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic diagram of the process of the present invention;
[0024] Figure 2 It is a comparison diagram of the rendering results of the single scattering of the present invention, the Cook-Torrance model, and the OrenNayar model under different parameters;
[0025] Figure 3 The single scattering rendering result diagram of the present invention with a map under different parameters;
[0026] Figure 4 The figure is a comparison of the rendering results of multiple scattering of Cook-Torrance, Lee and the present invention under different roughness;
[0027] In the figure: r2=2.0. DETAILED DESCRIPTION
[0028] like Figure 1 As shown, this embodiment involves an optimized rendering implementation method based on a microsurface theoretical BRDF model. This method can be used to calculate lighting results in two application scenarios: real-time rendering and ray tracing.
[0029] In the rendering pipeline of real-time rendering, the shader is an important part of calculating the effect of direct light on the surface material of an object. The lighting calculation of the object surface occurs in the shader. Shaders can be written in different languages; on different platforms, there will be some differences in the compilation and specific numerical calculation of shaders. mmBRDF can be implemented in the shader of any platform and any language. Taking the commercial game engine Unity as an example, you can create a new Unity custom shader, use the vertex shader to transform the coordinates of the vertex information, and use the fragment shader to perform lighting calculations based on the lighting direction, line of sight direction, normal direction, macro roughness parameters and micro roughness parameters calculated by the vertex shader.
[0030] In the ray tracing method, the scene is rendered by emitting a ray from the observation point to each pixel and finding the nearest object that blocks the ray path in the world scene. When the ray intersects the surface of the object, the illumination calculation is performed. This embodiment takes the offline rendering of the Mitsuba renderer open source renderer as an example. The open source renderer supports the calculation of BRDF models of different materials in the form of plugins. The specific steps include: creating a new mmBRDF category and inheriting the base class BSDF of Mitsuba itself. The base class BSDF describes the scattering pattern of light on the surface and is assigned to the shape as a material; rewriting several important functions provided by the BSDF base class. The illumination calculation of mmBRDF is implemented in the eval() function.
[0031] In both scenarios above, two most important parameters need to be declared additionally: macro roughness parameter r1 and micro roughness parameter r2. These two parameters can appear in the form of numerical values or in the form of maps. You can also define color maps, normal maps and other parameters as needed.
[0032] The illumination calculation specifically includes:
[0033] Step 1: According to the incident light i, the angle of incidence o and the normal direction n of the macro surface, calculate the normal direction mk of the corresponding activated surface micro surface. The activated surface is provided for the lighting result. The specific method is: when it is the first scattering, then Otherwise, according to the practical multiple scattering algorithm for rough surfaces (JH Lee, A Jarabo, DS Jeon, D Gutierrez, HK Min "Practical multiple scattering for rough surfaces" (2018 / 12 / 04, SIGGRAPH Asia2018 Technical Papers, ACM Transactions on Graphics)), the opening size of the V-groove corresponding to the kth scattering is calculated based on the multiple scattering method in the V-groove.
[0034] Step 2: Based on the Cook-Torrance BRDF model, the product of the Fresnel term F and the geometric attenuation factor G, as well as the Jacobian determinant that converts the coordinate system from the local microfacet coordinate system to the macroscopic incident light coordinate system, is synthesized into a term M, and the result is calculated. Where: V-groove assumption corresponds to the geometric attenuation factor The commonly used Schlick approximation Fresnel term F = lerp ((1-(n·o) 5 ), 1, F0), F0 is the Fresnel coefficient.
[0035] Step 3: Use a spherical Gaussian function with the normal of the activated microfacet as the central axis to approximate the normal distribution function, and perform normalization. Take the lobe sharpness r1 of the spherical Gaussian function as the macro material roughness parameter, that is: Among them: Sg(v; p, λ, μ) = μe λ(v·p-1) , that is, the spherical Gaussian function Sg or lobe with p as the symmetry axis, its lobe sharpness is λ, the lobe amplitude is μ, and v is a vector on the sphere.
[0036] In this embodiment, the spherical Gaussian function must first be normalized to meet the requirements of the normal distribution function. It should be noted that the normal distribution function does not actually need to be directly integrated to 1 on the sphere, but it must ensure that the integral on the projection is normalized, that is, it must satisfy ∫ Ω D(m)<n·m> dm=1.
[0037] Normalized spherical Gaussian function approximates the normal distribution function in: Distribution, normalized spherical Gaussian function on the sphere
[0038] Since the shader has a limited number of calculation bits, floating point overflow is prone to occur. Therefore, this embodiment uses an approximation of A(λ) to solve the overflow problem in this step, specifically: A appro (λ)=scale*y+bias, where: A appro (λ) is the result of approximating A(λ).
[0039] Step 4: Use a normalized spherical Gaussian function with the microfacet normal as the central axis to represent the microfacet material, and take the lobe sharpness r2 of the spherical Gaussian function as the roughness parameter of the microfacet material, specifically:
[0040] Step 5: Use the properties of the spherical Gaussian function to find the product of the normal distribution function in step 2 and the spherical Gaussian function representing the microsurface material in step 3 Where: d m =||λ1p1+λ2p2||, and multiply it with the result in step 2 to get the calculation result of BRDF considering the micro-facet material properties under single scattering
[0041] Step 6: Preferably, when the energy to be compensated in multiple scattering is to be calculated, the normal direction of the microfacet in the kth reflection is obtained from the structure of the V-groove according to the practical multiple scattering algorithm for rough surfaces, and the above steps are repeated, and the kth result is accumulated to the final result until all the results of the set scattering times are included in the calculation, and finally the calculation result of the BRDF considering the microfacet material properties under multiple scattering is obtained. Among them: maxBounce is the maximum number of scattering times set.
[0042] Step 7: Designers can adjust parameters at will to obtain a rendering effect that is closer to physical reality. The macro material roughness parameter r1 controls the overall highlight range of the material, and the micro surface material roughness r2 controls the performance of the highlight edge tailing part. This achieves the purpose of more finely controlling the material performance.
[0043] from Figure 2 and Figure 3It can be seen that r1 and r2 will have a significant impact on the roughness of the mmBRDF material, and this impact is continuous as the parameters change. The appearance of the two parameters makes the adjustment of roughness in this embodiment more detailed and broadens the performance range of the material. The change of r1 to roughness is similar to the roughness parameter in the cook-Torrance BRDF, which makes the material rougher overall; while r7 tends to create a longer tail while maintaining a certain highlight directivity, an effect that the previous cook-Torrance BRDF model could not achieve. From Figure 4 It can also be seen from this embodiment that this embodiment can also provide rendering effects that other reflection models cannot provide before when performing multiple scattering calculations.
[0044] In all material implementations, mmBRDF only provides lighting calculations under the influence of roughness. Other normal maps and environment maps can be integrated into the material performance without conflicts. This method is very easy to apply in rendering pipelines on different platforms, real-time rendering and offline rendering.
[0045] At the same time, although this embodiment provides a wider range of performance, the performance is still excellent. This is due to the definition of micro-facet materials in this method and the use of spherical Gaussian to approximate the micro-facet materials.
[0046] In different scenes, the rendering time of the object material is compared on a ray tracing renderer using the method provided in this embodiment, and the results are shown in Table 1. The rendering tests of this embodiment are all completed on a machine configured with Intel Core i7-7700HQ and 8GB memory.
[0047] Table 1 Comparison of rendering efficiency of mmBRDF and other materials in different scenes
[0048]
[0049]
[0050] In summary, this method has the following advantages:
[0051] 1) The calculation of micro-facet materials expands the BRDF performance range. Compared with the measured data, it is found that the BRDF calculation method of this method is more suitable for expressing materials such as plastics.
[0052] 2) Easy to use. This method can be directly used in real-time rendering or offline rendering processes on multiple platforms without making underlying modifications to the renderer. Previous BRDFs based on microsurface theory that consider microfacet materials often require tedious pre-calculation or Monte Carlo estimation.
[0053] 3) Low computational cost. This method not only provides more detailed performance results, but also the BRDF calculation cost of single scattering is negligible compared to the cook-Torrance BRDF.
[0054] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principle and purpose of the present invention. The protection scope of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. Each implementation scheme within its scope shall be subject to the constraints of the present invention.
Claims
1. A rendering method based on the BRDF of a directional scattering microfacet material, characterized in that: The vertex renderer performs coordinate transformation and vertex-by-vertex lighting calculation. The fragment renderer performs lighting calculation based on the lighting direction, sight direction, normal direction, macro-roughness parameters, and micro-roughness parameters calculated by the vertex renderer, including: Step 1: Given the incident light ray i, the incident angle o, and the macro surface normal direction n, calculate the corresponding micro surface normal direction m of the activated surface k ; Step 2: Based on the Cook-Torrance BRDF model based on the V-groove assumption, the product of the Fresnel term F and the geometric attenuation factor G, as well as the Jacobi determinant that transforms the coordinate system from the local microfacet coordinate system to the macroscopic incident light coordinate system, is synthesized into a term M, and the result is calculated; Step 3: Use a spherical Gaussian function with the normal of the activated micro-facet as the central axis to approximate the normal distribution function, perform normalization, and take the lobe sharpness r1 of the spherical Gaussian function as the macro material roughness parameter; Step 4: Use a normalized spherical Gaussian function with the micro-surface normal as the central axis to represent the micro-surface material, and take the lobe sharpness r2 of the spherical Gaussian function as the roughness parameter of the micro-surface material; Step 5: Use the properties of the spherical Gaussian function to obtain the product of the normal distribution function in step 3 and the spherical Gaussian function representing the microsurface material in step 4, and multiply it with the result in step 2 to obtain the calculation result of the BRDF considering the microsurface material properties under single scattering; The step 1 is specifically as follows: according to the incident light i, the angle of incidence o and the normal direction n of the macroscopic surface, the normal direction m of the corresponding activated surface micro-facet is calculated. k , the active surface is provided for the lighting result; the specific method is: when it is the first scattering, then Otherwise, according to the practical multiple scattering algorithm for rough surfaces, based on the multiple scattering method in the V-shaped groove, the opening size of the V-shaped groove corresponding to the kth scattering is calculated; The step 2 is specifically as follows: based on the Cook-Torrance BRDF model, the Fresnel term F and the geometric attenuation factor G, as well as the Jacobian determinant for converting the coordinate system from the local microfacet coordinate system to the macroscopic incident light coordinate system, are synthesized by multiplying Where: V-groove assumption corresponds to the geometric attenuation factor The commonly used Schlick approximation Fresnel term F = lerp ((1-(n·o) 5 ),1,F0), F0 is the Fresnel coefficient; The step 3 is specifically as follows: use a spherical Gaussian function with the micro-facet normal of the activated surface as the central axis to approximate the normal distribution function, perform normalization, and take the lobe sharpness r1 of the spherical Gaussian function as the macro material roughness parameter, that is: Among them: Sg(v;p,λ,μ)=μe λ(v·p-1) , that is, the spherical Gaussian function Sg or lobe with p as the symmetry axis, λ is the lobe sharpness, μ is the lobe amplitude, and v is a vector on the sphere; The step 4 is specifically as follows: using a normalized spherical Gaussian function with the micro-surface normal as the central axis to represent the micro-surface material, taking the lobe sharpness r2 of the spherical Gaussian function as the roughness parameter of the micro-surface material The step 5 is specifically: using the properties of the spherical Gaussian function to obtain the product of the normal distribution function in step 2 and the spherical Gaussian function representing the microsurface material in step 3 Where: d m =||λ1p1+λ2p2||, and multiply it with the result in step 2 to get the calculation result of BRDF considering the micro-facet material properties under single scattering When it is necessary to calculate the energy to be compensated in multiple scattering, the normal direction of the microfacet in the kth reflection is obtained according to the practical multiple scattering algorithm, and steps 1-5 are repeated, and the kth result is accumulated to the final result until all the results of the set scattering times are included in the calculation.
2. The rendering method of BRDF based on directional scattering micro-facet material according to claim 1 is characterized in that: Adjust the macro material roughness parameter r1 to control the overall highlight range of the material, and then adjust the micro surface material roughness r2 to control the performance of the highlight edge tailing part; thereby achieving more precise control of material performance and obtaining a rendering effect that is closer to physical reality.
