Sign in to follow this  
jdyyx1984

how does <MinFilter=Linear> work in DirectX?

Recommended Posts

jdyyx1984    148

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~~

Edited by jdyyx1984

Share this post


Link to post
Share on other sites
cozzie    5029
I believe the minfilter is used when a texture gets "zoomed out" (minified) and magfilter for when it needs to be "zoomed in" (magnified). Based on the resulting size of the ploygon being rendered, with the texture.

Share this post


Link to post
Share on other sites
jdyyx1984    148

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

Share this post


Link to post
Share on other sites
cozzie    5029

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

Share this post


Link to post
Share on other sites
Tom KQT    1704

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this