From 37258df59cc8a9ebed2e269e4a4867057cb74fe8 Mon Sep 17 00:00:00 2001 From: Marcin Hajder Date: Tue, 31 May 2016 12:45:28 +0100 Subject: [PATCH] Fix for nvtt plugin to support RGTC1/RGTC2 pixel format. Thanks to this simple fix it's possible to compress red/red-green channel of RGB/RGBA image to GL_COMPRESSED_RED_RGTC1_EXT/GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT pixel format. --- src/osgPlugins/nvtt/NVTTImageProcessor.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/osgPlugins/nvtt/NVTTImageProcessor.cpp b/src/osgPlugins/nvtt/NVTTImageProcessor.cpp index 7b89fe362..b11000a21 100644 --- a/src/osgPlugins/nvtt/NVTTImageProcessor.cpp +++ b/src/osgPlugins/nvtt/NVTTImageProcessor.cpp @@ -119,6 +119,12 @@ bool NVTTProcessor::OSGImageOutputHandler::assignImage(osg::Image& image) case nvtt::Format_DXT5: pixelFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; + case nvtt::Format_BC4: + pixelFormat = GL_COMPRESSED_RED_RGTC1_EXT; + break; + case nvtt::Format_BC5: + pixelFormat = GL_COMPRESSED_RED_GREEN_RGTC2_EXT; + break; default: OSG_WARN<<" Invalid or not supported format"<