Skip to main content
gamedev.net
🔒 Locked

Direct3D format

Started by The C modest god 6 replies 850+ views
Original Post
The C modest god
The C modest god
What format should I choose for using Direct3D with sprites? I saw the format X8R8G8B8 is it a common format that will be available for most platforms? what does the X stands for?
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower. Quote: Original post by Toolmaker Quote:
Oluseyi
Oluseyi
X = unused.

As for what format to use, enumerate and select the highest compatible one.
Namethatnobodyelsetook
Namethatnobodyelsetook
Yes, X is unused. The reason for it's existance is that it's actually faster for the card to waste a little space and store a 24 bit color in 32 bits. Many cards today don't even support the 24 bit version of the format, and only offer the 32 bit version with the wasted 8 bits.
The C modest god
The C modest god
How would I choose the most compatible format?
Should I make a list of formats with the first the highest priority to the last with the lowest priority?
I will not have any problem with supporting different formats, in terms of loading images into texture and blitting? In other words, will it be simple to have a loading image into texture mexhanisem that supports all the formats and to blitting as well?
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower. Quote: Original post by Toolmaker Quote:
The C modest god
The C modest god
Ok, there are several types of formats.
Which ones from the formats should I check?
I guess I wouldnt want to use such a format:
D3DFMT_A8 8-bit alpha only
How can I use that kind of format?
Or should I check all the formats including the weird 8-bit alpha only format?
Or should I check for only formats with at least 8bit for each RGB?
What is the difference between a format with alpha and one without in respect to sprites? Does in the format without the alpha I wouldnt be able to have transculerancy in sprites? for example I want to have a pixel that will blend 50% with the background color and 50% from its own color.
So what formats should I check?
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower. Quote: Original post by Toolmaker Quote:
The C modest god
The C modest god
I think I would want X8R8G8B8 format for the screen and A8R8G8B8 for the textures so I could do alpha blending to the sprites. I cant seen any other formats that would be suitable, then why should I check for more formats?
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower. Quote: Original post by Toolmaker Quote:
Muhammad Haggag
Muhammad Haggag
Quote:
Original post by The C modest god
I think I would want X8R8G8B8 format for the screen and A8R8G8B8 for the textures so I could do alpha blending to the sprites. I cant seen any other formats that would be suitable, then why should I check for more formats?

Because some cards may not support them. You might save memory with 16-bit textures if you don't need 32-bit ones, and hence run on lower-end systems, ...etc
For the back-buffer/texture, you can have things like:
X1R5G6B5
X4R4G4B4
A1R5G6B5
A4R4G4B4
...etc (lookup D3DFORMAT)

Topic Locked

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

Sign in to reply to this topic.