PBRT_V2 总结记录 <48> Texture 和 ConstantTexture 和 ScaleTexture 和 MixTexture 和 BilerpTexture

本文详细介绍了PBRT中的Texture类,包括ConstantTexture(常量纹理)用于提供恒定值,ScaleTexture(缩放纹理)计算两个纹理的乘积,MixTexture(混合纹理)线性插值混合两个纹理,以及BilerpTexture(双线性插值纹理)实现纹理空间四角值的双线性插值。
摘要由CSDN通过智能技术生成

Texture 类

template <typename T> class Texture : public ReferenceCounted {
public:
    // Texture Interface
    virtual T Evaluate(const DifferentialGeometry &) const = 0;
    virtual ~Texture() { }
};

作用:

(Texture 是一个 模板类,evaluation 函数返回的值得类型就可以多样化,目前 pbrt 中,evaluation 返回的类型主要是 float 和 Spectrum)

Texture is a template class parameterized by the return type of its evaluation function.
This design makes it possible to reuse almost all of the texturing code between textures
that return different types.
pbrt currently uses only float and Spectrum textures.

 

1. virtual T Evaluate(const DifferentialGeometry &) const = 0;

作用:

(Evaluate 函数 主要的就是 利用 1个 DifferentialGeometry  作为参数,计算图片中 一个 模板类型T的值)

The key to Texture’s interface is its evaluation function; it returns a value of the template
type T.
The only information it has access to in order to evaluate its value is the
DifferentialGeometry at the point being shaded. Different textures in this chapter will
use different parts of this structure to drive their evaluation.

 

 

ConstantTexture 类

template <typename T> class ConstantTexture : public Texture<T> {
public:
    // ConstantTexture Public Methods
    Constant
左手坐标系和右手坐标系是空间中用于指定方向和位置的坐标系统。在左手坐标系中,X轴指向右侧,Y轴指向上方,Z轴指向观察者的前方;而在右手坐标系中,X轴指向右侧,Y轴指向上方,Z轴指向远离观察者的方向。这两种坐标系的区别在于Z轴的指向,左手坐标系Z轴指向观察者,右手坐标系Z轴指向远离观察者。 可以使用简单的手势判断一个坐标系是左手坐标系还是右手坐标系。伸出左手,让拇指和食指成“L”形,大拇指指向右侧,食指指向上方,其余手指指向前方。这样建立的坐标系就是左手坐标系。如果中指能指向Z轴的正方向,则这个坐标系是左手坐标系;反之,如果中指指向Z轴的负方向,则这个坐标系是右手坐标系。 不同的应用领域和软件使用不同的坐标系。例如,Maya和OpenGL使用右手坐标系,而DirectX、pbrt和PRMan使用左手坐标系。这是因为在不同的应用中,对于坐标轴的定义和使用有所不同。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [左手坐标系和右手坐标系详解](https://blog.csdn.net/weixin_42398658/article/details/106054760)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值