Sign in to follow this  

D3DXCreateTextureFromFileEx & Texture Detail

Recommended Posts

Nexian    118
Hello all,

This is just a pretty basic question, but I feel I'd get a straight forward answer here.

I am using D3DXCreateTextureFromFileEx in DX9 to load my textures and I am wanting to use the setting provided by the function for Texture Detail options within the game.

The function at present:

[CODE]D3DXCreateTextureFromFileEx(pd3dDevice, file, 512, 512, 0, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0x00000000, NULL, NULL, &tex);[/CODE]

Basically I would be wanting to use a Texture Detail option to manipulate the Width, Height and Mip levels of the function.

All my current textures are powers of 2 and right now my plan would be to make all my textures 1024x1024 with the exception being UI textures that will be loaded using their actual (much smaller) size. (I am also wondering if 512x512 would be acceptable as "high detail". I picked 1024x1024 because I feel it is as high as I can go without quickly using up 256mb of video memory, estimating that I could load about 500 textures of this size)

From here my Texture Detail option would define Very High, High, Medium, Low and Very Low settings with the following Width, Height and Mip settings:

Very High 1024x1024 : All Mip Levels
High 1024x1024 : 7 Mip Levels
Medium 512x512 : 6 Mip Levels
Low 256x256 : 5 Mip Levels
Very Low 256x256 : 2 Mip Levels

What I am currently curious about is that I often hear people saying that for texture detail you generally have multiple copies of the same texture in your assets for different levels of detail. This makes me think that the method I am considering is inherently flawed in a way I am not seeing.

Right now I am going on the following assumptions:
- Just having the one texture in large detail will take up less hard drive space than having multiple detail levels stored
- Loading a texture as, for example, a 512x512 size from a 1024x1024 image takes longer than loading from a 512x512 image but both resulting textures take the same amount of video memory in their final 512x512 state. This one I am not sure of, but I can't see why it wouldn't be so.
- The width and height options of D3DXCreateTextureFromFileEx will work on all video cards the D3DX_DEFAULT option works on so long as the images being loaded and the parameters entered are powers of 2. Again, not sure of this. Edited by Nexian

Share this post

Link to post
Share on other sites

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