1. 程式人生 > >PBRT_V2 總結記錄 <27> Fresnel equations

PBRT_V2 總結記錄 <27> Fresnel equations

1. 

In addition to the reflected and transmitted directions, it is also necessary to compute the fraction of incoming light that is reflected or transmitted. In simple ray tracers, these fractions are typically just given as “reflectivity” or “transmissiveness” values, which are uniform over the entire surface. For physical reflection or refraction, however, these terms are directionally dependent and cannot be captured by constant per-surface scaling amounts. The Fresnel equations describe the amount of light reflected from a surface; they are the solution to Maxwell’s equations at smooth surfaces.

There are two sets of Fresnel equations: one for dielectric(絕緣體) media (objects that don’t conduct electricity, like glass) and one for conductors(導體) (like metals). For each of these cases, the Fresnel equations have two forms, depending on the polarization of the incident light. Properly accounting for polarization in rendering is a complex task, and so in pbrt we will make the common assumption that light is unpolarized; that is, it is randomly oriented with respect to the light wave. With this simplifying assumption, the Fresnel reflectance is the average of the squares of the parallel and perpendicular polarization terms.

(Fresnel equations 可以描述從一個表面可以反射多少光 , Fresnel equations 分為 dielectric(絕緣體) 和 conductors(導體)

2. 

To compute the Fresnel reflectance of a dielectric, we need to know the indices of refraction for the two media. Table 8.1 has the indices of refraction for a number of dielectric materials. A close approximation to the Fresnel reflectance formulae for dielectrics is

where r|| is the Fresnel reflectance for parallel polarized light and r⊥ is the reflectance for perpendicular polarized light. ηi and ηt are the indices of refraction for the incident and transmitted media, and ωi and ωt are the incident and transmitted directions, where ωt was computed with Snell’s law.

The cosine terms should all be greater than or equal to zero; for the purposes of computing these values, the geometric normal should be flipped to be on the same side as ωi and then ωt.

For unpolarized light, the Fresnel reflectance is

Due to conservation of energy, the energy transmitted by a dielectric is 1− Fr.

Spectrum FrDiel(float cosi, float cost, const Spectrum &etai,
                const Spectrum &etat) {
    Spectrum Rparl = ((etat * cosi) - (etai * cost)) /
                     ((etat * cosi) + (etai * cost));
    Spectrum Rperp = ((etai * cosi) - (etat * cost)) /
                     ((etai * cosi) + (etat * cost));
    return (Rparl*Rparl + Rperp*Rperp) / 2.f;
}

(以上的就是怎麼計算 dielectric(絕緣體) 的 Fresnel reflectance 和 transmitted)

3. 

Unlike dielectrics, conductors don’t transmit light, but some of the incident light is absorbed by the material and turned into heat. The Fresnel formula for conductors tells how much is reflected—the amount depends on the additional quantities η, the index of refraction of the conductor, and k, its absorption coefficient.

A widely used approximation to the Fresnel reflectance for conductors is

Spectrum FrCond(float cosi, const Spectrum &eta, const Spectrum &k) {
    Spectrum tmp = (eta*eta + k*k) * cosi*cosi;
    Spectrum Rparl2 = (tmp - (2.f * eta * cosi) + 1) /
                      (tmp + (2.f * eta * cosi) + 1);
    Spectrum tmp_f = eta*eta + k*k;
    Spectrum Rperp2 =
        (tmp_f - (2.f * eta * cosi) + cosi*cosi) /
        (tmp_f + (2.f * eta * cosi) + cosi*cosi);
    return (Rparl2 + Rperp2) / 2.f;
}

(以上的就是怎麼計算 conductors (導體) 的 Fresnel reflectance,conductors (導體) don’t transmit light,所以 沒有 transmitted)