Hi Sukender, I've just reviewed these changes but find the logic a bit awkward (double negatives are never good) and potentially breaking of client applications - since the default for the write has changed.
As a background to the flip issue, OpenGL's texture coordinates have the original at the bottom left which is consistent with the rest of the OpenGL coordinates systems. While traditional 2D applications and image format have the origin at the top left. I believe Direct3D followed the 2D traditions and has the origin at the top left. Now whether a dds files need to be flipped or not will depend up models they are associated with and the art path they have gone through. On write what you'll want to do will again depend upon what models it's associated with and what tools will be reading it. For instance one of the common usage write of dds file in the context of the OSG will be using VPB where the dds files are directly associated with the OSG, as things stand everything works as far as I know. This will have to remain the case without any external changes required. I think we need to nail down clear rules on when and when not to flip, and the use of the Origin needs to be done consistently as well i.e. not just when the flip is done. However, one problem is that there are dds files that have the origin in different places just by local convention of a particular tool, without any data about this stored in the dds file so it's all a bit messy when it comes to defaults. This would be a good topic to raise on osg-users. Robert. On Fri, Feb 11, 2011 at 9:17 AM, Sukender <[email protected]> wrote: > Hi Robert, > > I guess I already sent you a modified DDS readerwriter, but it was never > integrated... Or maybe I really really thought about sending it without doing > it really :-D ? Anyway I've cleaned a few little things and it's now worth > integrating, if you agree. > > - Vertically flipping DDS files upon reading (with the corresponding string > option) now also sets the origin of the image (Image::setOrigin()) > accordingly. > - Writing DDS files now uses image's origin to automatically vertically flip > if needed. This can be avoided using the "ddsNoAutoFlipWrite" option. > > Actually, it seems the vertical flip should be the "standard" reading way (at > least for multiple 3rd-party software I use) but this would break code, so I > didn't change the default behaviour (I only "standardized" the option name as > you'll see). > > File BASE rev = 11941. > > Cheers, > > Sukender > PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
