首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >各向异性滤波通常是如何在现代GPU中实现的?

各向异性滤波通常是如何在现代GPU中实现的?
EN

Computer Graphics用户
提问于 2015-09-04 06:14:31
回答 2查看 6.4K关注 0票数 16

各向异性滤波“保留贴图纹理的锐度,通常由MIP贴图纹理试图避免混叠而丢失”。维基百科的文章给出了如何实现它的提示(“探测任何各向异性方向的纹理(.)”,但我读得不太清楚。

似乎有各种实现,如演示文稿备注 of 基于物理绘制的近似模型中所示的测试所建议的那样:

当使用各向异性滤波时,(现代)GPU执行哪些具体计算来选择正确的MIP级别?

EN

回答 2

Computer Graphics用户

发布于 2015-09-04 09:18:52

纹理滤波硬件需要不同mipmap级别的多个样本(样本的最大数量由各向异性滤波级别表示,尽管在给定的滤波操作中获取的样本的确切数量将取决于碎片上的导数之间的比例)。如果你投影锥在一个斜角上观察一个表面的纹理空间,它将导致大约一个椭圆形的投影,这是更长的更多的斜角度。额外的样本是沿着这个椭圆形的轴(从正确的mip水平,以利用他们提供的预过滤),并结合,以提供一个更清晰的纹理样本。

另一种名为撕裂映射的技术(在维基百科关于混合映射的文章中提到)是在当代GPU中不常见的,它使用纹理的预过滤。与mips相比,纹理不是均匀地缩小,而是使用不同的高度-宽度比(直到取决于您所选择的各向异性滤波级别的比率)。然后,根据曲面的角度选择纹理的变体--如果使用三线性滤波,则可能是两个变体--以尽量减少失真。像素值是使用默认滤波技术(双线性或三线性)获取的。我所知道的任何硬件都不使用Rip映射,因为它们的大小令人望而却步:当mipmap使用额外的33%存储空间时,ripmaps使用300%。这可以通过注意纹理使用需求在使用AF时不会增加,而只是带宽增加来验证。

为了进一步阅读,您可能需要查看分机_纹理_过滤器_各向异性 OpenGL扩展的规范。详细介绍了用各向异性滤波计算样本的公式,以及如何组合它们。

票数 16
EN

Computer Graphics用户

发布于 2015-09-04 21:38:10

API需求可以在任何规范或扩展中找到。这里有一个:https://www.opengl.org/registry/specs/EXT/texture_过滤器_anisotropic.txt

所有GPU供应商都可能偏离规范,因为AF质量曾经是许多基准的一部分。随着新的工作负载强调现有的近似,当前的实现将继续发展。不幸的是,要确切地知道这两种方法都是什么,你需要成为其中一家公司的一员。但是,您可以从下列文件中估计出各种可能性,并按质量和实施成本的增加顺序列出:

  • TexRam
  • 猫科动物
  • 埃瓦

引用规范的话:

代码语言:javascript
复制
 Anisotropic texture filtering substantially changes Section 3.8.5.
 Previously a single scale factor P was determined based on the
 pixel's projection into texture space.  Now two scale factors,
 Px and Py, are computed.

   Px = sqrt(dudx^2 + dvdx^2)
   Py = sqrt(dudy^2 + dvdy^2)

   Pmax = max(Px,Py)
   Pmin = min(Px,Py)

   N = min(ceil(Pmax/Pmin),maxAniso)
   Lamda' = log2(Pmax/N)

 where maxAniso is the smaller of the texture's value of
 TEXTURE_MAX_ANISOTROPY_EXT or the implementation-defined value of
 MAX_TEXTURE_MAX_ANISOTROPY_EXT.

 It is acceptable for implementation to round 'N' up to the nearest
 supported sampling rate.  For example an implementation may only
 support power-of-two sampling rates.

 It is also acceptable for an implementation to approximate the ideal
 functions Px and Py with functions Fx and Fy subject to the following
 conditions:

   1.  Fx is continuous and monotonically increasing in |du/dx| and |dv/dx|.
       Fy is continuous and monotonically increasing in |du/dy| and |dv/dy|.

   2.  max(|du/dx|,|dv/dx|} <= Fx <= |du/dx| + |dv/dx|.
       max(|du/dy|,|dv/dy|} <= Fy <= |du/dy| + |dv/dy|.

 Instead of a single sample, Tau, at (u,v,Lamda), 'N' locations in the mipmap
 at LOD Lamda, are sampled within the texture footprint of the pixel.

 Instead of a single sample, Tau, at (u,v,lambda), 'N' locations in
 the mipmap at LOD Lamda are sampled within the texture footprint of
 the pixel.  This sum TauAniso is defined using the single sample Tau.
 When the texture's value of TEXTURE_MAX_ANISOTROPHY_EXT is greater
 than 1.0, use TauAniso instead of Tau to determine the fragment's
 texture value.

                i=N
                ---
 TauAniso = 1/N \ Tau(u(x - 1/2 + i/(N+1), y), v(x - 1/2 + i/(N+1), y)),  Px > Py
                /
                ---
                i=1

                i=N
                ---
 TauAniso = 1/N \ Tau(u(x, y - 1/2 + i/(N+1)), v(x, y - 1/2 + i/(N+1))),  Py >= Px
                /
                ---
                i=1


 It is acceptable to approximate the u and v functions with equally spaced
 samples in texture space at LOD Lamda:

                i=N
                ---
 TauAniso = 1/N \ Tau(u(x,y)+dudx(i/(N+1)-1/2), v(x,y)+dvdx(i/(N+1)-1/2)), Px > Py
                /
                ---
                i=1

                i=N
                ---
 TauAniso = 1/N \ Tau(u(x,y)+dudy(i/(N+1)-1/2), v(x,y)+dvdy(i/(N+1)-1/2)), Py >= Px
                /
                ---
                i=1 
票数 9
EN
页面原文内容由Computer Graphics提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://computergraphics.stackexchange.com/questions/1432

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档