# how does <MinFilter=Linear> work in DirectX?

This topic is 1751 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 on other sites

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.

##### Share on other sites
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 on other sites

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 on other sites

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 on other sites

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

1. 1
Rutin
44
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632997
• Total Posts
3009791
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!