Answers:
纹理过滤硬件会提取各种mipmap级别的几个样本(最大采样量由各向异性过滤级别指示,尽管在给定过滤操作中获取的样本的确切数量将取决于片段上导数之间的比例。 )如果将圆锥体以倾斜角度观察表面投影到纹理空间上,则将产生近似椭圆形的投影,该投影会随着倾斜角度的增加而延长。沿此椭圆的轴抽取额外的样本(从正确的Mip级别获取,以利用它们提供的预过滤),然后合并以提供更清晰的纹理样本。
另一种技术称为rip-mapping(在有关Mipmapping的Wikipedia文章中提到),但并非通常在当代GPU中发现,它使用纹理的预过滤。与mips相比,纹理并不是均匀地按比例缩小,而是使用各种高度-宽度-比例(最大比例取决于您选择的各向异性过滤级别)。然后根据表面的角度选择纹理的变形(如果使用三线性过滤,则可能是两个变形),以使变形最小化。使用默认过滤技术(双线性或三线性)获取像素值。我不知道Rip-map在任何已知的硬件中都不会使用,因为它们的尺寸过大:虽然Mipmaps使用额外的33%存储空间,但Ripmaps使用300%的存储空间。可以通过注意到使用AF时纹理使用要求不会增加,而只有带宽会增加来验证这一点。
为了进一步阅读,您可能想看看EXT_texture_filter_anisotropic OpenGL扩展的规范。它详细介绍了用于计算样本的公式以及使用各向异性过滤时如何将它们组合在一起。
可以在任何规范或扩展中找到API要求。这是一个:https : //www.opengl.org/registry/specs/EXT/texture_filter_anisotropic.txt
所有GPU供应商都可能偏离规格,因为AF质量曾经是许多基准测试的一部分。随着新的工作量强调现有的近似值,当前的实现将继续发展。不幸的是,要确切地知道两者的作用,您将需要成为其中一家公司的一部分。但是您可以从以下论文中评估可能的范围,这些论文以质量和实施成本的升序排列:
引用规范:
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
GL_EXT_texture_filter_anisotropic
非常详细。也许它可以帮助您更好地了解该过程。