Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


D3DXCreateTextureFromFileEx & Texture Detail


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Nexian   Members   -  Reputation: 118

Like
0Likes
Like

Posted 19 August 2012 - 02:59 PM

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:

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

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, 19 August 2012 - 03:54 PM.


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS