Skip to main content
gamedev.net
🔒 Locked

Selecting mipmaps

Started by sipickles 4 replies 1.1k views
Original Post
sipickles
sipickles
Hi, I have created textures using D3DXCreateTextureFromFileEx, and specified a complete mipmap chain. I am using DX8.1 Is there a way I can manually select which level of mipmap is displayed on a textured poly rather than it being automatically selected by DX8 based on distance. I want to be able to flick between different levels of detail you see. Thanks for all your help....... Si
Nik02
Nik02
With anything except newest cards, you can't directly specify which mip level gets chosen, but you do have some control over it. See sampler states "mipmaplodbias" and "maxmiplevel". In addition, with pixel shader >= 2 you can use texldb to control the mipmap level bias per-pixel, and in ps3 you do have the option to choose a specific level with texldl.
Niko Suni
conman
conman
I don't know if it is possible to select a specific mipmap but I wouldn't be surprised if it's not possible. The usage of mipmaps is that you want to display a texture (the highest mipmap level). The problem is that you get aliasing artefacts form sampling the texture if you are viewing it form far away. So you build a pyramid of mipmaps to conform the sampling theorem.

There is no sense in selecting the mipmaps manually. The only thing you can do is to select another texture (which will have it's own mipmaps so you woun't get aliasing)

Or you disable the automatic generation of mipmaps for you textures, then you can provide your own generated mipmaps or you don't use mipmaps at all - which can result in aliasing artefacts.

-- Constantin
Promit
Promit
You can bias the mip map choice in either direction, but you can't force a choice. I've seen various presentations that strongly urge you to avoid mucking around with mipmap lod bias if at all possible.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Syranide
Syranide
Three modes I believe that are native

- No mipmaping
- "Lowered" mipmaping, as in only allowing mipmaps below a certain level
- Normal mipmaping

These should be enough? Because you don't want to handle the mipmaping on rotated/slightly visible vertices as that would be all to costful also it would likely need you to draw multiple times as you define a LOD state for a single vertice etc, but only for a texture.

Am I wrong?

EDIT: The only thing I would ever like to do is to adjust the threshold for changing mipmap level, which is done using BIAS right? Or limiting the best mipmap level to speed up rendering by things that you know won't be seen much, or lowering the overall quality.


Supernat02
Supernat02
If you want to speed up the game, perhaps you could have a slider bar that adjusts the base mipmap texture size. For example, highest detail loads 1280x1024 textures and mipmaps them all the way down to 1x1. Lowest detail loads 300x200 textures instead.

Chris
Chris ByersMicrosoft DirectX MVP - 2005

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.