About Mipmap

Started by
6 comments, last by jollyjeffers 17 years, 4 months ago
hi, i read that direct3d handle mipmap automatically direct3d loads a picture and multiply it step by step which "D3DXCreateTextureFromFile" command. When does it stop? example : i load a 128x256 picture the last picture is 2x4 right?
Advertisement
The last image will be 1x1 by default.

If you use the Ex version of the texture loading functions you can specify how many mip levels you'd like, or just pass 0 to mean "make them all".
thanks
and there is one thing

the book that i read says:"if the device supports mipmap" how can i check that device supporting and today's devices are generally supporting mipmap right?
Assuming you can find a card that doesn't support mipmapping, you won't want to support it unless you're making a simple 2D puzzle game or something. Mip maps have been standard for a long, long time.
Quote:Original post by Namethatnobodyelsetook
Assuming you can find a card that doesn't support mipmapping, you won't want to support it unless you're making a simple 2D puzzle game or something. Mip maps have been standard for a long, long time.
I think that if he can find a card that doesn't support mip mapping, it's likely to be running Windows 95 or something, and probably unable to run his application anyway.

So yeah, you can pretty much assume that all cards support mip mapping.
There's also the difference between those cards that support mip-mapping (which is, as mentioned, basically all of them), and those that support auto-mip-map generation for textures (of which I have no idea what the support coverage is). There's a cap bit that can be queried for that, though.
It's IDirect3D9::CheckDeviceFormat() with D3DCAPS2_CANAUTOGENMIPMAP for automatic generation of Mip-Maps. The 'cardcaps.xls' spreadsheet indicates this as lowest common denominator for DX9 only.

D3DPTEXTURECAPS_MIPMAP in D3DCAPS9::TextureCaps for more general usage of Mip-Mapping. The 'cardcaps.xls' spreadsheet indicates this as lowest common denominator since DX6. If you can find ANY hardware that isn't base-level DX6 (which is probably DDI5 or DDI-3) then you deserve a medal [lol]

Quote:i load a 128x256 picture
the last picture is 2x4 right?
If you'd looked through the SDK documentation you'd of found this note in 'Texture Filtering with Mipmaps':
Quote:Note Each surface in a mipmap chain has dimensions that are one-half that of the previous surface in the chain. If the top-level mipmap has dimensions of 256x128, the dimensions of the second-level mipmap are 128x64, the third-level are 64x32, and so on, down to 1x1. You cannot request a number of mipmap levels in Levels that would cause either the width or height of any mipmap in the chain to be smaller than 1. In the simple case of a 4x2 top-level mipmap surface, the maximum value allowed for Levels is three. The top-level dimensions are 4x2, the second-level dimensions are 2x1, and the dimensions for the third level are 1x1. A value larger than 3 in Levels results in a fractional value in the height of the second-level mipmap, and is therefore disallowed.


hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

This topic is closed to new replies.

Advertisement