PBRT_V2 总结记录 <56> VolumeRegion 和 HomogeneousVolumeDensity

本文介绍了PBRT_V2中描述体积散射的VolumeRegion抽象类,包括其WorldBound、IntersectP等方法,以及用于描述均匀散射属性的HomogeneousVolumeDensity类,该类直接接受吸收、散射和发射参数,并能精确计算光学厚度。
摘要由CSDN通过智能技术生成

VolumeRegion 类

class VolumeRegion {
public:
    // VolumeRegion Interface
    virtual ~VolumeRegion();
    virtual BBox WorldBound() const = 0;
    virtual bool IntersectP(const Ray &ray, float *t0, float *t1) const = 0;

    virtual Spectrum sigma_a(const Point &, const Vector &,
                             float time) const = 0;
    virtual Spectrum sigma_s(const Point &, const Vector &,
                             float time) const = 0;
    virtual Spectrum Lve(const Point &, const Vector &,
                         float time) const = 0;
    virtual float p(const Point &, const Vector &,
                    const Vector &, float time) const = 0;

    virtual Spectrum sigma_t(const Point &p, const Vector &wo, float time) const;

    virtual Spectrum tau(const Ray &ray, float step = 1.f,
                         float offset = 0.5) const = 0;
};

类的作用:

(这个类 简单理解就是 一块体积散射区域)

The key abstraction for describing volume scattering in pbrt is the abstract VolumeRegion
class—the interface to describe volume scattering in a region of the scene. Multiple
VolumeRegions of different types can be used to describe different kinds of scattering in
different parts of the scene. In this section, we will describe the basic interface.

 

1. virtual BBox WorldBound() const = 0;

作用:

(世界空间的包围盒)

All VolumeRegions must be able to compute their axis-aligned world space bounding
box, which is returned by the VolumeRegion::WorldBound() method. As with Shapes and
Primitives, this bound can be used to place VolumeRegions into acceleration structures.

 

2. virtual bool IntersectP(const Ray &ray, float *t0, float *t1) const = 0;

作用:

(假如 与 Ray 相交,计算返回 Ray 穿过这个 volume 的交点 t0 和 t1)

Because VolumeIntegrators need to know the parametric range of a world space ray that
passes through a volume regi

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值