1. 程式人生 > >PBRT_V2 總結記錄 BSSRDF

PBRT_V2 總結記錄 BSSRDF

BSSRDF 概述

(BSSRDF 的 意義 參考下面的圖,比較好理解,S 函式 從了考慮 方向 wi,wo之外,還會考慮 位置 p0,p1)

Many materials exhibit a significant amount of subsurface(表面下的) light transport: light that
enters them at one point may exit quite far away(可能離得很遠).
In general, subsurface light transport is
one of the key mechanisms that gives objects like wax, candles, marble, skin, and many
biological tissues their characteristic appearances.

The bidirectional scattering-surface reflectance distribution function (BSSRDF) is the formalism
that describes these kinds of scattering processes. It is a distribution function
S(po, ωo, pi , ωi) that describes the ratio of exitant differential radiance at point po in
direction ωo to the differential irradiance at pi from direction ωi:

The generalization of the scattering equation for the BSSRDF requires integration over
surface area and incoming direction, turning the 2D scattering Equation (5.8) into a 4D
integral.With two more dimensions to integrate over, it is substantially more complex to
use in rendering algorithms.

However, as the distance between points pi and po increases, the value of S generally diminishes(減少).
This fact can be a substantial help in implementations of subsurface scattering
algorithms.

 

Light transport beneath(在...之下) a surface is described by the same principles as volume light
transport in participating media and is described by the equation of transfer, which is
introduced in Section 16.1. Subsurface scattering is thus based on the same effects as light
scattering in clouds and smoke, just at a smaller scale.
The DipoleSubsurfaceIntegrator
in Section 16.5 implements an algorithm that applies an approximation to efficiently
approximate this integral.

volume light transport in participating media 也可以用BSSRDF來計算效果

 

Figure 5.19: The bidirectional scattering-surface reflectance distribution function generalizes the
BSDF to account for light that exits the surface at a point other than where it enters. It is often
more difficult to evaluate than the BSDF, although subsurface(表面下的) light transport can make a substantial
contribution to the appearance of many real-world objects.

(BSSRDF : 光線從表示一個點 射入,但是從其他的點 射出,而且光線在表面下的進行傳輸 )

 

BSSRDF 類

class BSSRDF {
public:
    // BSSRDF Public Methods
    BSSRDF(const Spectrum &sa, const Spectrum &sps, float et)
        : e(et), sig_a(sa), sigp_s(sps) { }
    float eta() const { return e; }
    Spectrum sigma_a() const { return sig_a; }
    Spectrum sigma_prime_s() const { return sigp_s; }
private:
    // BSSRDF Private Data
    float e;
    Spectrum sig_a, sigp_s;
};

類的作用:

(BSSRDF : 光線從表示一個點 射入,但是從其他的點 射出,而且光線在表面下的進行傳輸 )

The BSSRDF class plays a role similar to that of the BSDF in pbrt. While the BSDF describes
scattering from a surface due to illumination at a single point, the BSSRDF describes the
scattering properties for illumination that arrives at many points on the surface and
undergoes(經歷) subsurface(表面下的) scattering before exiting at the point being shaded.
During the
shading process, BSSRDF pointers are returned by the Primitive::GetBSSRDF() method
if the object’s material exhibits subsurface scattering.

 

1. 建構函式

BSSRDF(const Spectrum &sa, const Spectrum &sps, float et)
        : e(et), sig_a(sa), sigp_s(sps) { }



float e;
Spectrum sig_a, sigp_s;

作用:

(BSSRDF 儲存的屬性,都是一些 低階的participating medium 散射屬性,integrator 計算 表面下的散射效果,在他們的演算法裡面 傳入 一對點和一對方向 給 BSSRDF ,BSSRDF  利用這些 散射的屬性,就可以計算出 對應的值出來。

It’s up to the integrator that computes the effect of subsurface scattering  (to use these properties in whichever algorithm it uses to compute the value of the BSSRDF for given pairs of incident and exitant locations and directions ).

BSSRDF會儲存:the index of refraction of the medium η,absorption coefficient σa, 

reduced scattering coefficient σ‘s = (1− g)σs, 

Unlike the BSDF class, which provides methods to evaluate the value of the BSDF given
pairs of angles, the BSSRDF only describes the lower-level scattering properties of the
participating medium.
It’s up to the integrator that computes the effect of subsurface
scattering to use these properties in whichever algorithm it uses to compute the value of
the BSSRDF for given pairs of incident and exitant locations and directions. (For example,
the DipoleSubsurfaceIntegrator of Section 16.5 uses them to compute a BSSRDF
approximation based on a closed-form solution for a semi-infinite slab.)

The properties that define the BSSRDF here are the index of refraction of the medium
η, its absorption coefficient σa, and its reduced scattering coefficient, which is defined as
σ‘s = (1− g)σs, where g is the medium’s anisotropy parameter and σs is the scattering
coefficient.
The reduced scattering coefficient is discussed further in Section 16.5.3.

 

2. 

 float eta() const { return e; }
    Spectrum sigma_a() const { return sig_a; }
    Spectrum sigma_prime_s() const { return sigp_s; }

作用:

The BSSRDF provides methods to get the values of the three properties. Note that the
abstraction here implicitly treats(處理) these 3D properties of the medium as properties that
only vary on the surface, since the Material returns a BSSRDF, and the BSSRDF doesn’t
represent any spatial variation(空間變化) of the scattering properties. Effectively, the entire medium
is treated as if it were homogeneous(均勻), with the scattering properties computed at the point
being shaded. This limitation is fine for homogeneous scattering media, but is inaccurate
for highly inhomogeneous media.