Realtime Rendering 5

Real Time Rendering 5

1、In radiometry, the function that is used to describe how a surface reflects light is called the bidirectional reflectance distribution function (BRDF).

  As its name implies, it is a function that describes how light is reflected from a surface given two directions—the incoming light direction l and outgoing view direction v.

  BRDF是出射光和入射光(radiance)的比。即有百分之几的入射光被反射出surface。

      Realtime Rendering 5

  This illumination is measured at the surface as irradiance dE.  The surface then reflects this light in various directions. In any given outgoing direction v, the radiance dLo is proportional to the irradiance dE.

  The ratio between the two, which depends on l and v, is the BRDF.

  definition can be expressed in a non-differential form:

    Realtime Rendering 5

  a general shading equation with n non-area lights:

    Realtime Rendering 5

  Since the incoming and outgoing directions each have two degrees of freedom (a common parameterization is to use two angles: elevation θ relative to the surface normal and rotation φ about the normal), the BRDF is a function of four scalar variables in the general case.

  Isotropic BRDFS are an important special case. Such BRDFs remain the same when the incoming and outgoing direction are rotated around the surface normal (keeping the same relative angles between them). Isotropic BRDFs are functions of three scalar variables.

    Realtime Rendering 5

2、The light transmitted into the object may undergo absorption and additional scattering, eventually causing some of it to exit the surface—a phenomena called subsurface scattering.

  传播入物体内的光线,一部分被吸收,一部分会经过内部传播后再次散射出来,这种现象叫次表面散射。

    Realtime Rendering 5
  对于红圈的情况,This equation is the bidirectional surface scattering reflectance distribution function (BSSRDF).  The general BSSRDF encompasses large-scale subsurface scattering by adding incoming and outgoing locations as inputs to the function.  The BSSRDF describes the relative amount of light that travels along the incoming direction, then from one point to the other of the surface, then along the outgoing direction.

  Whether a BRDF can be used depends both on the surface material and on the scale of observation。 A function that captures BRDF variation based on spatial location is called a spatially varying BRDF (SVBRDF) or spatial BRDF (SBRDF).

  Also, transmission of light through a surface is not handled, only reflection [409]. To handle transmission, two BRDFs and two BTDFs (“T” for “transmittance”) are defined for the surface, one for each side, and so make up the BSDF (“S” for “scattering”). In practice, these more complex functions are rarely needed, and a BRDF or SVBRDF is sufficient to model most surface behavior.

  BRDF + BT(Transmittance)DF = BSDF

3、BRDF two constraint:

  1)Helmholtz reciprocity。 which means that the input and output angles can be switched and the function value will be the same:

    Realtime Rendering 5

  2)conservation of energy。The outgoing energy cannot be greater than the incoming energy。

4、directional-hemispherical reflectance。 It measures the amount of light coming from a given direction that is reflected at all, regardless of out going
direction。Essentially, it measures energy loss for a given incoming direction.

  Directional Hemispherical Reflectance:给定输入光,有多少能量能被输出 。

  The input to this function is the incoming direction vector l, and its definition is the ratio between differential exitance and differential irradiance, as shown in Equation 7.23:

    Realtime Rendering 5

  simpler, non-differential definition can be used,M is the resulting exitance:

    Realtime Rendering 5

  The value of the directional-hemispherical reflectance R(l) must always be between 0 and 1.

  The directional-hemispherical reflectance is closely related to the BRDF:

    Realtime Rendering 5

  Equation 7.25 says that the directional-hemispherical reflectance for a given incoming direction l is equal to the BRDF times the cosine of the angle between n and v, integrated over all possible outgoing directions in the hemisphere.

  Evaluating Equation 7.25 for a constant value of f(l, v) gives us the following constant value for the directional-hemispherical reflectance as a function of the BRDF:

    Realtime Rendering 5

5、The constant reflectance value of a Lambertian BRDF is commonly referred to as the diffuse color cdiff.  The 1/π factor results from the fact that integrating a cosine factor over the hemisphere yields a value of π.

    Realtime Rendering 5

    Realtime Rendering 5

6、When using BRDF representations, surface phenomena are simulated as surface reflectance, and interior phenomena are modeled as body reflectance (the term volume reflectance is also sometimes used).

  Absorption occurs under the surface, perhaps very close to it, but never at the surface itself.

  Surface reflectance is typically modeled with specular BRDF terms—body reflectance is modeled with diffuse terms.

7、Fresnel Reflectance.

  In practice, any irregularities much smaller than the smallest light wavelength (about 400 nanometers in the case of visible light) have no effect on the light.

  Note that Fresnel reflectanc is strictly a surface reflectance phenomenon, independent of any body reflectance
phenomena such as absorption.

  An optically planar interface  between two substances is a special case, which scatters each ray of incoming light into exactly two directions: the ideal reflection direction and the ideal refraction direction.

    Realtime Rendering 5

    The ideal refraction or transmission vector t forms a different angle (θt) with the negated surface normal −n.  

    

    Both the Fresnel reflectance RF and the transmission angle θt depend not only on the incoming angle θi, but also on an optical property of the two substances called the refractive index or index of refraction.

    折射指数(率)。

    The symbol n is commonly used to denote refractive index. In this case n1 is the refractive index of the substance “above” the interface (where the light is initially propagating) and n2 is the refractive index of the substance “below” the interface (where the refracted light propagates).

    The dependence of θt on θi, n1, and n2 obeys a simple equation, known as Snell’s Law

       Realtime Rendering 5

    Snell’s Law combined with Equation 7.29 yields a different form for transmitted radiance:

      Realtime Rendering 5      

8、The amount of light reflected is described by the Fresnel reflectanc RF, which depends on the incoming angle θi.

  Light not reflected is transmitted, so the proportion of transmitted flux to incoming flux is 1 − RF.

  The proportion of transmitted-to-incident radiance, however, is different,the relationship between the incident and transmitted radiance is:

    Realtime Rendering 5

  The reflection vector ri can be computed from n and l:

    Realtime Rendering 5

    Realtime Rendering 5

9、External Reflection

  External reflection is the case where light reflects from an object’s external surface; in other words, light is in transition from air to the object’s substance (the opposite transition, from object to air, is called internal reflection

  The function RF (θi) has the following characteristics:

    As θi increases (the surface is viewed at increasingly glancing angles), the value of RF (θi) will tend to increase, reaching a value of 1 for all frequencies (white) at θi = 90◦.

  

  Figure 7.19 shows RF (θi) curves for external reflection from a variety of substances. The curves are highly nonlinear—they barely change until θi = 60◦ or so, and then quickly go to 1.

    Realtime Rendering 5

  Schlick [1128] gives an approximation of Fresnel reflectance that is fairly accurate for most substances:

    Realtime Rendering 5

  This is a simple RGB interpolation between white and RF (0◦).  下图是 7.33 公式的模拟效果:

    Realtime Rendering 5

   When using the Schlick approximation, RF (0.) is the only parameter that controls Fresnel reflectance

    

   The refractive index can also be used to compute RF (0◦). It is common to assume that n1 = 1 (a close approximation for the refractive index of air), and to simply use n instead of n2 for the refractive index of the object. This gives the following equation:

      Realtime Rendering 5

   Insulators have fairly low values for RF (0.)?usually 0.05 or lower. 

10、Internal Reflection

  Internal reflection
occurs when light is traveling in the interior of a transparent object 
and encounters the object抯 surface ”from the inside“。

    Realtime Rendering 5

    

    External reflection is a transition from a low refractive index to a higher one; internal reflection is the opposite case. 

    There is no θt—when θi > θc, no transmission occurs, and all the incoming light is reflected. This phenomenon is known as total internal reflection.

    on average, reflectance is higher in the case of internal reflection.  This is why (for example) air bubbles seen underwater have a highly reflective, silvery appearance.

            Realtime Rendering 5

  Internal reflection only occurs in insulators (metals and semiconductors quickly absorb any light propagating inside them).

    Realtime Rendering 5

11、Local Subsurface Scattering

  If the insulator is homogeneous with few internal discontinuities to scatter light then it is transparent.

  Light is re-emitted from the same point at which it entered. We will call this case local subsurface scattering.

      

  Local subsurface scattering is most often modeled as a Lambertian diffuse term in the BRDF. In this case the directional-hemispherical reflectance of the diffuse term Rdiff is set to a constant value, referred to as the diffuse color cdiff, yielding the following diffuse BRDF term:

    Realtime Rendering 5

  The scattering albedo ρ of a heterogeneous insulator is the ratio between the energy of the light that escapes a surface compared to the energy of the light entering into the interior of the material.  The value of ρ is between 0 (all light is absorbed) and 1 (no light is absorbed). 

  反照率,次表面散射中,有多少光被吸收。剩下的即为逃出的scattering。

  

  Since insulators transmit most incoming light rather than reflecting it at the surface, the scattering albedo ρ is usually more visually important than the Fresnel reflectance RF (θi).

  对于 insulator, scattering 比 Fresnel现象更明显。

  If the directional-hemispherical reflectance Rspec of the BRDF’s specular term happens to have a constant value cspec, then it makes sense to set: cdiff = (1 − cspec)ρ.

  The Fresnel effect implies that the surface-body reflectance tradeoff mentioned above changes with incoming light angle θi. As the specular reflectance increases at glancing angles, the diffuse reflectance will decrease:

    Realtime Rendering 5

  The BRDF value does not depend on the outgoing direction v.

  Shirley proposed a diffuse term that addresses the Fresnel effect and the surface-body reflectance tradeoff, while supporting both energy conser vation
and Helmholtz reciprocity:

      Realtime Rendering 5

   A generalized version that can be used to compute a reciprocal, energy-conserving diffuse term to match any specular term was proposed by Ashikhmin and Shirley:

      Realtime Rendering 5

12、Microgeometry

  Surface detail modeled by a BRDF is microscale—smaller than the visible scale or, in other words, smaller than a single pixel.  whether surface structures are considered to be microscale depends on the scale of observation as much as on the size of the structures themselves.

  Since we cannot see that the microgeometry surface normals and their directions are somewhat random, it makes sense to model them statistically

  For most surfaces, the distribution of microgeometry surface normals is a continuous distribution with a strong peak at the macroscopic surface normal. 

  microgeometry在macroscopic处会有一个波峰。

    Realtime Rendering 5

  Some surfaces have highly structured microgeometry, resulting in interesting microscale normal distributions and surface appearance.

  Shadowing & Masking & interreflection

    Realtime Rendering 5

  microgeometry的顶部很光滑,而底部很粗糙。(这符合Fresnel反射)

    Realtime Rendering 5

  

13、retro-reflection effect

  If the scale of the microgeometry is large relative to the scale of subsurface scattering.  then shadowing and masking can cause a retro-reflection effect, where light is preferentially reflected back toward the incoming direction.

      Realtime Rendering 5

14、Many BRDF models are based on a mathematical analysis of the effects of microgeometry on reflectance called microfacet theory.  This theory is based on the modeling of microgeometry as a collection of microfacets. Eachmicrofacet is a tiny, flat Fresnel mirror on the surface.

  

  Surface’s normal distribution function, or NDF. We will use p() to refer to the NDF in equations.  The microfacets are likely to be oriented similarly to the overall macroscopic surface.  

  p(),法线分布函数。

  Microfacet theory focuses on modeling the first bounce
specular reflection and does not model multiple bounces or body 
reflectance. For this reason, microfacet-derived BRDF terms are paired with a diffuse (usually Lambertian) term.

  Microfacet模拟第一次弹射(specular reflection),不模拟多次弹射。

   

15、Shadowing and masking are accounted for by introducing a geometry factor or geometrical attenuation factor - G(l, v).  It represents how much light remains after shad owing
and masking are applied. 

  G(l,v),考虑 Shadowing、 Masking后,还剩多少光。

    Realtime Rendering 5

  This paper derives the following BRDF term from first principles using microfacet theory:

    Realtime Rendering 5

  where kp is calculated thus:

    Realtime Rendering 5

  The NDF p() is usually isotropic,the angle θh between n and h. This simplifies the BRDF slightly by replacing p(h) with p(θh):

    Realtime Rendering 5

16、 Original Phong BRDF。

    Realtime Rendering 5

      Realtime Rendering 5

    The non-normalized version of the BRDF, changing m changed both the amount and distribution of outgoing light.

    With non-normalized BRDFs, adjusting the surface roughness changes the reflectance as a side effect.

    Realtime Rendering 5

    

    

17、Normalized Phong BRDF。reflection-vector-based。

    Realtime Rendering 5

     important effect of normalization is that now the m parameter
is independent of reflectance and only controls surface roughness. 

    Realtime Rendering 5

    

    The normalized Phong BRDF show the highlight becoming brighter as it narrows, which is both physically correct and visually convincing.

      Realtime Rendering 5

18、Blinn-Phong BRDF。half-vector-based。

    Realtime Rendering 5

  Note that to get a similar highlight, the value of m used in the Blinn-Phong BRDF should be about four times that used for the Phong BRDF.

19、Microfacet BRDF。

    1)cosine power term can be interpreted as a normal distribution function。(NDF)

    2)BRDF can be extended to include the Fresnel effect by simply replacing C(spec) with RF(αh)

  Realtime Rendering 5

    The BRDF in Equation 7.49 is often sufficient for most real-time rendering
needs. 

17、

18、

19、

20、

上一篇:Xcode开发工具问题


下一篇:Solr In Action 笔记(3) 之 SolrCloud基础