Fix #32837: DDS images flipped in viewport compared to render. This happened
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 23 Oct 2012 15:46:44 +0000 (15:46 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 23 Oct 2012 15:46:44 +0000 (15:46 +0000)
after adding compressed DDS texture loading.

DDS images can be flipped compared to the Blender standard, however we do not
unflip them because we also don't flip compressed textures. If we would flip
those we'd need to uncompress, flip and recompress them, and so losing the
speed benefit that you get from using them. Users are expected to save DDS
image in OpenGL compatible format.

source/blender/imbuf/intern/dds/dds_api.cpp

index 7aacbf20baef8a5601b719b8739a0a1883a03a20..68b7013c31fc6f23e744115af13a05ea8c941068 100644 (file)
@@ -169,7 +169,13 @@ struct ImBuf *imb_load_dds(unsigned char *mem, size_t size, int flags, char colo
                        ibuf->dds_data.size = 0;
                }
 
-               IMB_flipy(ibuf);
+               /* DDS images can be flipped compared to the Blender standard, however we
+                * do not unflip them because we also don't flip compressed textures. If
+                * we would flip those we'd need to uncompress, flip and recompress them,
+                * and so losing the speed benefit that you get from using them. Users are
+                * expected to save DDS image in OpenGL compatible format. */
+
+               /* IMB_flipy(ibuf); */
        }
 
        return(ibuf);