Archived

This topic is now archived and is closed to further replies.

Higher mipmap quality

This topic is 5500 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

The best way to fix this problem is by using anisotropic filtering instead of trilinear filtering.

However, on some older hardware, anisotropic isn''t worth the performance loss. With Radeon 8500, GF4 Ti4200 and higher the loss is almost negligible for the quality gained.

Radeon are especially good at that because they are turning off anisotropic filtering on faces within a certain angular threshold to the eye ray. That way you are not loosing performance on faces that don''t need it.

nVidia call it cheating, I call it brilliant since there is no quality loss.

______________________________
Oooh, you found the horadric cube!

Share this post


Link to post
Share on other sites
Lupin, if you got the bias working,
please tell me what''s wrong with my

float bias = 3.0f;
device->SetTextureStageState(0, D3DTSS_MIPMAPLODBIAS, *( (LPDWORD) (&bias) ) );

It has no effect at all !

Share this post


Link to post
Share on other sites
bratsj, this code should be correct, you should use an value like -2 or -3 to get mipmaps with higher quality

since I''m using VB my code is looking an little bit different, but I think it''s doing the same as yours bratsj, I''m using an function from dx4vb.da.ru to get my float into an long:


D3Ddevice.SetTextureStageState 0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR
D3Ddevice.SetTextureStageState 0, D3DTSS_MINFILTER, D3DTEXF_LINEAR
D3Ddevice.SetTextureStageState 0, D3DTSS_MIPFILTER, D3DTEXF_LINEAR

D3Ddevice.SetTextureStageState 1, D3DTSS_MAGFILTER, D3DTEXF_LINEAR
D3Ddevice.SetTextureStageState 1, D3DTSS_MINFILTER, D3DTEXF_LINEAR
D3Ddevice.SetTextureStageState 1, D3DTSS_MIPFILTER, D3DTEXF_LINEAR


Dim fBias As Single
fBias = -1#
D3Ddevice.SetTextureStageState 0, D3DTSS_MIPMAPLODBIAS, FloatToDWord(fBias)
D3Ddevice.SetTextureStageState 1, D3DTSS_MIPMAPLODBIAS, FloatToDWord(fBias)


Public Function FloatToDWord(ByVal f As Single) As Long
''this function packs a 32bit floating point number
''into a 32bit integer number; quite slow - dont overuse.
''DXCopyMemory or CopyMemory() (win32 api) would ''probably be faster...
Dim buf As D3DXBuffer
Dim l As Long
Set buf = D3DX.CreateBuffer(4)
D3DX.BufferSetData buf, 0, 4, 1, f
D3DX.BufferGetData buf, 0, 4, 1, l
FloatToDWord = l
End Function


these are all my settings for mipmaping-stuff

Share this post


Link to post
Share on other sites