From 921d10a636041cbc3b565064c2002f1afd99e4d3 Mon Sep 17 00:00:00 2001 From: flashk Date: Fri, 1 Nov 2019 09:26:28 -0700 Subject: [PATCH] Support reading RGB float DDS images The DDS plugin is not able to load floating point RGB images saved out by itself. There doesn't appear to be a fourcc code for RGB float/half-float data, so I added the appropriate entries to the RGBFormat table so the images can be loaded properly. --- src/osgPlugins/dds/ReaderWriterDDS.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osgPlugins/dds/ReaderWriterDDS.cpp b/src/osgPlugins/dds/ReaderWriterDDS.cpp index c4658a5e0..03d998352 100644 --- a/src/osgPlugins/dds/ReaderWriterDDS.cpp +++ b/src/osgPlugins/dds/ReaderWriterDDS.cpp @@ -854,6 +854,10 @@ osg::Image* ReadDDSFile(std::istream& _istream, bool flipDDSRead) GL_RGBA, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV }, { "G16R16", 32, 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000, GL_RGB, UNSUPPORTED, GL_UNSIGNED_SHORT }, + { "B16G16R16", 48, 0x0000ff, 0x00ff00, 0xff0000, 0x000000, + GL_RGB16F_ARB , GL_RGB , GL_HALF_FLOAT }, + { "B32G32R32", 96, 0x0000ff, 0x00ff00, 0xff0000, 0x000000, + GL_RGB32F_ARB , GL_RGB , GL_FLOAT }, }; bool found = false;