Jump to content
  • Advertisement
Sign in to follow this  

DDS files !!

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

hello all, can i know the internal format of DDS files. like incase of JPEG files....the image array can be manipulated as width * height * number of channels. i am trying to flip the images in the way i want, upside down !!....but i can't figure out the internal image array format for DDS files....Is there a pattern followed in the image array of DDS files....that is exactly i want to know to manipulate the contents. all i have is 2 variables that control the imageBufferSize...dwPitchorLinearSize if mipMapCount = 1 or imageBufferSize = dwPitchorLinearSize * factor if mipMapCount > 1. help me out !! .kavitha p.s:: am doing this just coz i am getting the image flipped upside down or mirrored along x-plane; my reader seems to be fine....any inputs on this !!

Share this post


Link to post
Share on other sites
Advertisement
hi,

am actually using DIRECTX texture tool to view .DDS files;

i downloaded a program to read .dds files and the way, the downloaded program and DIRECTX tool displays the .dds files are horizontally mirrored. or the image is flipped upside down along the horizontal plane.

any help on that ?. anybody tried reading .dds files and show me a link to a sample that reads in the proper way.

.kavitha

Share this post


Link to post
Share on other sites
You can download the tools from nvidia and you'll find an example with full sources there. So you may try to understand the format.

Share this post


Link to post
Share on other sites
i used the code from codesampler site only. and i find the textures need to be flipped vertically.

any idea of how to configure the loader to flip the images vertically.

thanks,

kavitha

Share this post


Link to post
Share on other sites
Load them backwards --- start at the end of the 2D array and move toward the top.

Share this post


Link to post
Share on other sites
have you tried that and got it working !!...I tried that but i don't seem to get them rendered.

2D array, u meant an array going width * height. could u elaborate on this ?

thanks,

kavitha

Share this post


Link to post
Share on other sites
Well, since DDS images are compressed, you cannot load them backwards directly from the file, but I guess you know that?
You need to decompress them into width*height*channels array and then swap the height rows (lower to upper all the way) to get a flipped image - that would be the generel way to flip an image vertically. Then you can compress them again and load it like you want to.
I'm almost sure that it can be done faster using DDS's compression algorithms, but since I haven't looked at them yet (I have the same problem as you, so I need to find a solution anyways) I can't tell you much more other than I will be follwing this topic :-P

Share this post


Link to post
Share on other sites
hey nife,

did you look @ Nvidia SDK, it seems they do flip the image on the fly. i don't know how it is possible, check out their DDS files,you can infer from them. let me know if you find any interesting clues.

thanks,

kavitha

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!