Sign in to follow this  

Texture filters trilinear filtering?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was thinking I have anti aliasing and I can use anistrophic mapping and mipmap textures with the three mip mapping levels.

MipMapping
Point
Linear
Anistrophic

So I am wondering when you see these settings in a game engine like in UT2004. They refer to these filtering mechanisms.

Filtering?
Linear
BiLinear
TriLinear

Where do you come accross those in DX?

Share this post


Link to post
Share on other sites
While they do refer to the technique of Bilinear texture filtering. Defining it theres no reference as to where you can control it.

"Where do you come accross those in DX?" being the key point.

typedef enum D3DSAMPLERSTATETYPE {
D3DSAMP_ADDRESSU = 1,
D3DSAMP_ADDRESSV = 2,
D3DSAMP_ADDRESSW = 3,
D3DSAMP_BORDERCOLOR = 4,
D3DSAMP_MAGFILTER = 5,
D3DSAMP_MINFILTER = 6,
D3DSAMP_MIPFILTER = 7,
D3DSAMP_MIPMAPLODBIAS = 8,
D3DSAMP_MAXMIPLEVEL = 9,
D3DSAMP_MAXANISOTROPY = 10,
D3DSAMP_SRGBTEXTURE = 11,
D3DSAMP_ELEMENTINDEX = 12,
D3DSAMP_DMAPOFFSET = 13,
D3DSAMP_FORCE_DWORD = 0x7fffffff
} D3DSAMPLERSTATETYPE, *LPD3DSAMPLERSTATETYPE;

typedef enum D3DTEXTUREFILTERTYPE {
D3DTEXF_NONE = 0,
D3DTEXF_POINT = 1,
D3DTEXF_LINEAR = 2,
D3DTEXF_ANISOTROPIC = 3,
D3DTEXF_PYRAMIDALQUAD = 6,
D3DTEXF_GAUSSIANQUAD = 7,
D3DTEXF_CONVOLUTIONMONO = 8,
D3DTEXF_FORCE_DWORD = 0x7fffffff
} D3DTEXTUREFILTERTYPE, *LPD3DTEXTUREFILTERTYPE;

There is no mention of Bilinear filtering or Trilinear filtering in reference to implementation. So unless it is a shader based procedure which seems somewhat improbable as it would be a reinvent the wheel sort of deal. Where is it based?

sampler BlendMapSampler = sampler_state
{
Texture = (BlendMap);
MIPFILTER = TRILINEAR; //That just is not going to fly :p
MAGFILTER = LINEAR;
MINFILTER = LINEAR;
};

Implementation is what I am after demonstrating Trilinear filtering. Based on their description I expected a D3DPRESENT_PARAMETERS value for it but its not in there like anti aliasing...

Share this post


Link to post
Share on other sites
Quote:
sampler BlendMapSampler = sampler_state
{
...
MIPFILTER = LINEAR;//trilinear
MAGFILTER = LINEAR;
MINFILTER = LINEAR;
};

Setting the Min/Mag filters to 'linear' enables bi-linear filtering (4 texels are sampled and blended together).
Setting the Mip filter to 'linear' *as well* enables tri-linear filtering (bi-linear samples are blended from different mip-levels).

So setting the MIPFILTER to something other than NONE/POINT, and MIN/MAGFILTER to something other than POINT is what you're looking for here.

To quote the MSDN:
Quote:
D3DTEXF_LINEAR
...
When used with D3DSAMP_MIPFILTER, enables mipmapping and trilinear filtering; it specifies that the rasterizer interpolates between the two nearest mip levels.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

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