PBRT_V2 总结记录 VolumeIntegrator

class VolumeIntegrator : public Integrator {
public:
    // VolumeIntegrator Interface
    virtual Spectrum Li(const Scene *scene, const Renderer *renderer,
        const RayDifferential &ray, const Sample *sample, RNG &rng,
        Spectrum *transmittance, MemoryArena &arena) const = 0;
    virtual Spectrum Transmittance(const Scene *scene,
        const Renderer *renderer, const RayDifferential &ray,
        const Sample *sample, RNG &rng, MemoryArena &arena) const = 0;
};

作用:

Just as SurfaceIntegrators are the meeting point of scene geometry, materials, and lights,
applying sophisticated algorithms to solve the light transport equation and determine the
distribution of radiance in the scene, VolumeIntegrators are responsible for incorporating(合并)
the effect of participating media (as described by VolumeRegions) into this process
and determining how it affects the distribution of radiance.

1. virtual Spectrum Li(const Scene *scene, const Renderer *renderer,
        const RayDifferential &ray, const Sample *sample, RNG &rng,
        Spectrum *transmittance, MemoryArena &arena) const = 0;

作用:

(Li 方法 会返回 radiance along the given ray,这个radiance表示的就是 additional radiance from participating media ,也就是 emission and in-scattered 的radiance,Li方法同时也会返回 Tr到参数 transmittance,那么

PBRT_V2 总结记录 <103> The Equation Of Transfer》 中的 公式所需要的参数就齐全了)

VolumeIntegrator adds a Li() method that is similar to the surface integrator version
in that it returns the radiance along the given ray; volume integrators should assume
that if the given ray does intersect a surface in the scene, then its Ray::maxt value will
have been set to be at the intersection point. As such, the volume integrator should
only compute the effect of volume scattering from the parametric range [mint, maxt]
along the ray. The VolumeIntegrator’s version of Li() doesn’t include the Intersection
parameter that SurfaceIntegrator has, and it adds an output Spectrum parameter to
return the transmittance from the start of the ray to the end of the ray. This returned
transmittance value is used to compute the attenuation of outgoing radiance from the
intersected surface. Like SurfaceIntegrator::Li(), the Sample pointer may be NULL, in
which case the implementation should use the provided RNG for any random sampling it
performs.

2. virtual Spectrum Transmittance(const Scene *scene,
        const Renderer *renderer, const RayDifferential &ray,
        const Sample *sample, RNG &rng, MemoryArena &arena) const = 0;

作用:

(计算Tr)

The VolumeIntegrator interface adds an additional method that implementations must
provide, Transmittance(), which is responsible for computing the beam transmittance
along the given ray from Ray::mint to Ray::maxt. This method is used to compute attenuation
along shadow rays traced for direct lighting, for example.

With this background, the SamplerRenderer::Li() method can be fully understood. It is
a direct implementation of Equation (16.1). The surface integrator computes outgoing
radiance Lo at the ray’s intersection point
, ignoring attenuation back to the ray origin.
The volume integrator’s Li() method gives the radiance along the ray due to participating
media and also returns the beam transmittance Tr to the point on the surface.
The sum
of LoTr and the additional radiance from participating media gives the total radiance
arriving at the ray origin.

(surface integrator 计算 Lo,  volume integrator’s Li() 计算 radiance(emission and in-scattered ) 和计算  Tr

Equation (16.1):

猜你喜欢

转载自blog.csdn.net/aa20274270/article/details/86216696
今日推荐