Jump to content
  • Advertisement
Sign in to follow this  
SGStino

Texture format convertion.

This topic is 2384 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'm trying to do something that, i guess, is fairly simple. But yet i can't get any working result.

I'm to loading an image (jpg, png, bmp,..., dds) into a Texture2D.
then i do some operations on it like creating a normalmap, or generating mip maps etc.
and after those operations i want to show output in a WPF application
when the user then accepts the final image, it gets saved as a dds file.

and everything works, except the outputting.

I tried a few different methods:

  • D3DImage interop
  • Texture2D.ToStream(texture.Device.ImmediateContext, texture, ImageFileFormat.Bmp, stream);
  • Texture2D.SaveToFile(texture.Device.ImmediateContext, texture, ImageFileFormat.Bmp, "tmp.bmp");

    results: it works, but only for R8B8G8A8_UNorm formats, not for BC*_UNorm

    i've also tried with LoadTextureFromTexture to convert it first to R8B8G8A8, but that doesn't seem to be working either.

    is there any way i can set this up without having to create a render target, a fullscreen quad and issue some(/one) drawcalls?

Share this post


Link to post
Share on other sites
Advertisement
You could try making use of squish to compress the texture. It might be simpler than going via D3D, although you'll need to sort out your own DDS file header.

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!