View Full Version : DDS Inverted - How to flip over the texture?

02-21-2007, 02:45 AM
Hi, I implemented DDS on my game but the textures show up inverted in the Y axis (as it seems to me). How can I flip them over or better yet, load them correctly?.

I tried flipping the UVs on my quads but its nothing else than a dirty hack.

I recall a source showing how to flip DDS, anyone know about this?, is there any better way?.


02-21-2007, 06:17 AM
A bit cleaner fix : you can add a scale -1 to the texture matrix stack.

Anyway, fix your texture loading : while you load your raw data from disk, instead of filling the texture array like this :

for (int i=0;i++;i<ARRAY_SIZE) {...}do it like this :

for (int i=ARRAY_SIZE-1;i--;i>=0) {...}

02-22-2007, 02:20 AM
It's something like Zbuffer said, but you need to flip the blocks and reorder things in the blocks.
I would use some free online tool or the photoshop DDS plugin

02-23-2007, 12:56 PM
First flip the image blockline for Blockline, than flip the indices in the blocks.
Or save flipped DDS images.

02-24-2007, 03:01 AM
Does the nvidia photoshop plugin have this flip option? I haven't seen it.

Anyway I don't load to an array nor I load in such a way (with a for loop...)

I would invert the texture matrix stack which is clean to me, at least if only dds is used. if not, it wouldn't be clean at all to invert the stack all the time.

However I want to avoid the overhead of inverting the blocks as well..