PBRT_V2 总结记录 <31> Lambertian

Lambertian 类:

class Lambertian : public BxDF {
public:
    // Lambertian Public Methods
    Lambertian(const Spectrum &reflectance)
        : BxDF(BxDFType(BSDF_REFLECTION | BSDF_DIFFUSE)), R(reflectance) { }
    Spectrum f(const Vector &wo, const Vector &wi) const;
    Spectrum rho(const Vector &, int, const float *) const { return R; }
    Spectrum rho(int, const float *, const float *) const { return R; }
private:
    // Lambertian Private Data
    Spectrum R;
};

类的作用:

(模拟无光泽的材质)

One of the simplest BRDFs is the Lambertian model. It models a perfect diffuse surface
that scatters incident illumination equally in all directions. Although this reflection
model is not physically plausible, it is a good approximation to many real-world surfaces
such as matte paint.

 

1. 代码

Spectrum Lambertian::f(const Vector &wo, const Vector &wi) const {
    return R * INV_PI;
}

Spectrum rho(const Vector &, int, const float *) const { return R; }

Spectrum rho(int, const float *, const float *) const { return R; }

作用:

(这里的 R 直接表示了 the fraction of incident light that is scattered,也就是 有百分之多少的 入射光 是散射的,注意的是

f 返回的值 是R/π,这个是可以证明)

The Lambertian constructor takes a reflectance spectrum R, which gives the fraction of
incident light that is scattered.

The reflection distribution function for Lambertian is quite straightforward, since its
value is constant. However, the value R/π must be returned, rather than R: the constructor
takes the BRDF’s reflectance; equating this to the earlier ρhd integral and solving
for the BRDF’s value demonstrates why this is the correct value to return for the BRDF
.

The directional-hemispherical and hemispherical-hemispherical reflectance values for a
Lambertian BRDF are trivial to compute analytically, so the derivations are omitted here.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值