Jump to content
  • Advertisement
Sign in to follow this  
jor1980

Creation of png files with alpha layer from directx

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

Hi i would like to know if it is possible to create png files with alpha layer from a texture in directx or slimdx, I am exporting textures as png as using basemesh.tofile but the textures which originally was dds only exports the part of the dds that in the alpha channel is white, and the new png doesn´t have alpha layer

Share this post


Link to post
Share on other sites
Advertisement
sorry i think i didn´t express myself well

Waht i try to mean is that i have dds textures allocated in directx.direct3d.textures, this dds has an alpha channel and when i try to save to a png file this texture i lost the alpha channel and it saves the texture like a png without alpha layer?

How can i conserve the alpha layer when i save dds texture to png using texture.tofile?

Share this post


Link to post
Share on other sites
Are you loading the DDS into a texture that doesn't have an alpha channel? What format is the texture that you're saving?

Share this post


Link to post
Share on other sites
the original texture is a dxt5 with alpha channel and i am trying to save it as png.Aren´t there png with alpha channel?

Share this post


Link to post
Share on other sites
Quote:
Original post by jor1980
the original texture is a dxt5 with alpha channel and i am trying to save it as png.Aren´t there png with alpha channel?
PNG has alpha, yes. But the IDirect3DTexture9 you loaded the DXT5-format into might not. If you load an image with alpha into a texture that has no alpha, you'll lose the alpha information.

Share this post


Link to post
Share on other sites
Quote:
Original post by jor1980
Thank's for your answer, could i save it as png with alpha in anyway?or it is impossible
Nope, the alpha channel is lost. Just as if you take a 32 byte file and save the first 24 bytes it's not possible to get the missing 8 bytes back.

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!