The MSDN says: D3DTEXF_LINEAR Bilinear interpolation filtering used as a texture magnification or minification filter. A weighted average of a 2 x 2 area of texels surrounding the desired pixel is used. http://msdn.microsoft.com/en-us/library/windows/desktop/bb322811(v=vs.85).aspx
Is the weight of each texel is always 0.25 when MinFilter=Linear is set and the pixel is larger than the projected texel? If not ,how does DX calculate the weight of each texel? thanks~~
how does <MinFilter=Linear> work in DirectX?
There's a fairly comprehensive explanation along with some sample code at http://en.wikipedia.org/wiki/Bilinear_filtering
Essentially the weights are chosen based on the distance of the sample point from the centre of the nearest 4 texels.
the
There's a fairly comprehensive explanation along with some sample code at http://en.wikipedia.org/wiki/Bilinear_filtering
Essentially the weights are chosen based on the distance of the sample point from the centre of the nearest 4 texels.
thanks, so both magfilter and minfilter use bilinear filtering,the weight calculating algorithm is the same between them
The filtering method that's used depends on how you set it.
For exampled, if you set (pseudo code)
MIN_FILTER = point
MAG_FILTER = linear
Then the type of filtering for minifying and magnifying are different
The term bilinear texture filtering is often used to say that both min and mag filters are linear. It's very common in graphics settings dialogs in games, you usually can choose from three options
Texture filtering: Bilinear / Trilinear / Anisotropic.
And in the code, the first option (bilinear) means:
MIN_FILTER = linear
MAG_FILTER = linear
MIP_FILTER = point
And the second option (trilinear) means:
MIN_FILTER = linear
MAG_FILTER = linear
MIP_FILTER = linear