Jump to content
  • Advertisement
Sign in to follow this  
ccanan

OpenGL What's the corresponding format in d3d?

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

I am reading some source code written in opengl, it create texture with the following format: GL_COMPRESSED_RGBA_S3TC_DXT1_EXT GL_COMPRESSED_RGBA_S3TC_DXT3_EXT GL_COMPRESSED_RGB_S3TC_DXT1_EXT I want to write a similar one in directx,but not sure about the corresponding data format. I guess I should use the format like D3DFMT_DXT1|D3DFMT_A8R8G8B8 or D3DFMT_DXT1|D3DFMT_8R8G8B8, is that right? thx in advance!

Share this post


Link to post
Share on other sites
Advertisement
You can't combine formats like you suggested, so you'll have to pick just one.

I'm no OpenGL expert, but from a guess it'll be one of the DXTn formats. The difference between RGB_DXT1 and RGBA_DXT1 could be a bit misleading though - I can't remember off the top of my head, but I think D3DFORMAT_DXT1 is just RGB and it might be DXT2/3/4/5 that has a proper (pre-multiplied) alpha channel...

The SDK documentation has a section on the DXTn formats, have a read through that and see where you get. Bare in mind that it is possible there is no direct correlation between OpenGL and D3D...

hth
Jack

Share this post


Link to post
Share on other sites
There is a correlation.
DXT comes from S3's S3TC
The format is the same no matter what API you use because that's what the GPU needs.

Also, the ccanan forgot to mention GL_COMPRESSED_RGBA_S3TC_DXT5_EXT

Share this post


Link to post
Share on other sites
sorry that: I can't visit the url.
So you mean: when GL_COMPRESSED_RGBA_S3TC_DXT3_EXT is used in opengl, it's just ok to use D3DFMT_DXT3?
and both the GL_COMPRESSED_RGBA_S3TC_DXT1_EXT and GL_COMPRESSED_RGB_S3TC_DXT1_EXT both corresspond to D3DFMT_DXT1

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!