Jump to content
  • Advertisement
Sign in to follow this  
Headkaze

Internal texture format?

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

What is the internal texture format of DirectX 9? I want to prepare the raw bitmap data before uploading it to the video card.

This is what I want to do:

1. Read the width and height of the image using a fast image header reader
2. Create an empty texture using the width and height and internal format of DX9
3. Load the bitmap on a thread using GDI+ and copy the bitmap data (swizzling if necessary) into a buffer using the width/height/pitch of texture
4. During a render frame use D3DXLoadSurfaceFromMemory to copy the buffer into the texture

What I'm attempting to achieve is the fastest image loading system I can.

Share this post


Link to post
Share on other sites
Advertisement

There's many internal formats, which you can choose from using the D3DFORMAT parameter when you create the texture.

 

If you're aiming for the fastest possible loading scheme, then don't use GDI+ as an intermediate at runtime, and don't do any swizzling at runtime either (do that offline, if required).

 

Usually, loading times are dependent on the amount of data that has to be loaded. You can use compressed texture data with the D3DFMT_DXT# formats. As above, you'll want to convert from raw bitmap data to compressed DXT data offline (because it is a slow process), using a library like "nvidia texture tools", etc...

Share this post


Link to post
Share on other sites
Unfortunately I cannot use compressed or pre-processed DXT's. All the graphics will be in png or jpg format. Since I'm loading the images on a thread the most performance critical part is uploading the bitmap data to the texture.

Is D3DXLoadSurfaceFromMemory the fastest way to get bitmap data to the video card?

What is the best uncompressed 32-bit texture format (D3DFMT_A8R8G8B8? D3DFMT_A8B8G8R8?) or doesn't it matter?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!