Bugzilla – Bug 22
<mipfilter> should be moved from <sampler> to <surface>
Last modified: 2008-06-28 06:04:56 PDT
The <mipfilter> element currently inside <sampler*> controls how mipmaps are generated when automatic mipmap generation is requested. Unlike <minfilter> and <magfilter>, which just control how the texture is sampled, <mipfilter> actually affects how the texture is created and initialized. For that reason <mipfilter> should probably be inside the <surface> element instead.
Instead of moving <mipfilter>, another option is to drop the element entirely. The only possible values are Nearest and Linear, and I'm sure that everyone will be using Linear, so <mipfilter> could probably just be removed.
Since making any of these changes will break backward-compatibility, I understand that nothing can be done about this for a while. It's a minor issue anyway.
See the following thread for more details:
Daniel can you comment on this one?
From the DirectX 9 documents, I found at the texldl docs next pseudocode that seems to state the interrelationships between the filters.
LOD = src0.w + LODBIAS;
if (LOD <= 0 )
LOD = 0;
Filter = MagFilter;
tex = Lookup( MAX(MAXMIPLEVEL, LOD), Filter );
Filter = MinFilter;
LOD = MAX( MAXMIPLEVEL, LOD);
tex = Lookup( Floor(LOD), Filter );
if( MipFilter == LINEAR )
tex1 = Lookup( Ceil(LOD), Filter );
tex = (1 - frac(src0.w))*tex + frac(src0.w)*tex1;
From this pseudocode, it seems that if you don't use a mipfilter, then only
one miplevel is the basis for a fetch.
If you use mipfilter == LINEAR, then apparently the linear interpolation between
two neighbouring miplevels form the basis for a fetch.
Still, it does not explain what I would like to know myself:
What does MipFilter == POINT and MipFilter == NONE do?
From my experiences, my first guess was that MipFilter == POINT
behaves like in the pseudocode above (in case it does not equeal LINEAR),
while MipFilter == NONE seems to make sure that only the first miplevel is used.