Creation of png files with alpha layer from directx

Started by
5 comments, last by Evil Steve 14 years ago
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
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?
Are you loading the DDS into a texture that doesn't have an alpha channel? What format is the texture that you're saving?
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?
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.
Thank's for your answer, could i save it as png with alpha in anyway?or it is impossible
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.

This topic is closed to new replies.

Advertisement