Real-Time Rendering——6.2.3 Volume Textures体积纹理6.2.4 Cube Maps立方体贴图

A direct extension of image textures is three-dimensional image data that is accessed by (u, v,w) (or (s, t, r) values). For example, medical imaging data can be generated as a three-dimensional grid; by moving a polygon through this grid, one may view two-dimensional slices of these data. A related idea is to represent volumetric lights in this form. The illumination on a point on a surface is found by finding the value for its location inside this volume, combined with a direction for the light.

图像纹理的直接扩展是由(u,v,w)(或(s,t,r)值)访问的三维图像数据。例如,医学成像数据可以被生成为三维网格;通过移动一个多边形穿过这个网格,人们可以看到这些数据的二维切片。一个相关的想法是以这种形式表示体积光。曲面上某点的照明是通过找到该点在该体积内的位置值,并结合光线的方向来找到的。

Most GPUs support mipmapping for volume textures. Since filtering inside a single mipmap level of a volume texture involves trilinear interpolation, filtering between mipmap levels requires quadrilinear interpolation. Since this involves averaging the results from 16 texels, precision problems may result, which can be solved by using a higher-precision volume texture. Sigg and Hadwiger [1638] discuss this and other problems relevant to volume textures and provide efficient methods to perform filtering and other operations.

大多数GPU支持体纹理的mipmapping。由于在体纹理的单个小中见大贴图层内的滤波涉及三线性插值,所以在小中见大贴图层之间的滤波需要四线性插值。由于这涉及到平均16个纹理元素的结果,可能会导致精度问题,这可以通过使用更高精度的体积纹理来解决。Sigg和Hadwiger [1638]讨论了这一问题以及与体纹理相关的其他问题,并提供了执行过滤和其他操作的有效方法。

Although volume textures have significantly higher storage requirements and are more expensive to filter, they do have some unique advantages. The complex process of finding a good two-dimensional parameterization for the three-dimensional mesh can be skipped, since three-dimensional locations can be used directly as texture coordinates. This avoids the distortion and seam problems that commonly occur with two-dimensional parameterizations. A volume texture can also be used to represent the volumetric structure of a material such as wood or marble. A model textured with such a texture will appear to be carved from this material.

虽然体积纹理有明显更高的存储要求,并且过滤成本更高,但它们确实有一些独特的优势。可以跳过为三维网格寻找良好的二维参数化的复杂过程,因为三维位置可以直接用作纹理坐标。这避免了二维参数化通常出现的失真和接缝问题。体积纹理也可以用于表示木材或大理石等材质的体积结构。用这种纹理制作的模型看起来像是用这种材料雕刻的。

Using volume textures for surface texturing is extremely inefficient, since the vast majority of samples are not used. Benson and Davis [133] and DeBry et al. [334] discuss storing texture data in a sparse octree structure. This scheme fits well with interactive three-dimensional painting systems, as the surface does not need explicit texture coordinates assigned to it at the time of creation, and the octree can hold texture detail down to any level desired. Lefebvre et al. [1017] discuss the details of implementing octree textures on the modern GPU. Lefebvre and Hoppe [1018] discuss a method of packing sparse volume data into a significantly smaller texture.

使用体积纹理进行表面纹理是非常低效的,因为绝大多数的样本都没有被使用。Benson和Davis [133]以及DeBry等人[334]讨论了在稀疏八叉树结构中存储纹理数据。该方案非常适合交互式三维绘画系统,因为表面不需要在创建时分配给它的显式纹理坐标,并且八叉树可以将纹理细节保持到任何期望的级别。Lefebvre等人[1017]讨论了在现代GPU上实现八叉树纹理的细节。Lefebvre和Hoppe [1018]讨论了一种将稀疏体数据打包成更小纹理的方法。

Another type of texture is the cube texture or cube map, which has six square textures,each of which is associated with one face of a cube. A cube map is accessed with a three-component texture coordinate vector that specifies the direction of a ray pointing from the center of the cube outward. The point where the ray intersects the cube is found as follows. The texture coordinate with the largest magnitude selects the corresponding face (e.g., the vector (−3.2, 5.1,−8.4) selects the −z face). The remaining two coordinates are divided by the absolute value of the largest magnitude coordinate, i.e., 8.4. They now range from −1 to 1, and are simply remapped to [0, 1] in order to compute the texture coordinates. For example, the coordinates (−3.2, 5.1) are mapped to ((−3.2/8.4+1)/2, (5.1/8.4+1)/2) ≈ (0.31, 0.80). Cube maps are useful for representing values which are a function of direction; they are most commonly used for environment mapping (Section 10.4.3).

另一种类型的纹理是立方体纹理或立方体贴图,它有六个正方形纹理,每个纹理都与立方体的一个面相关联。使用三分量纹理坐标向量访问立方体贴图,该向量指定从立方体中心向外指向的光线方向。射线与立方体相交的点如下所示。幅度最大的纹理坐标选择相应的面(例如,向量(3.2,5.1,8.4)选择z面)。剩下的两个坐标除以最大幅度坐标的绝对值,即8.4。它们现在的范围从1到1,并且简单地重新映射到[0,1]以便计算纹理坐标。例如,坐标(3.2,5.1)映射到(3.2/8.4+1)/2,(5.1/8.4+1)/2) ≈ (0.31,0.80)。立方体贴图对于表示作为方向函数的值很有用;它们最常用于环境映射(第10.4.3节)。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

椰子糖莫莫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值