From 3722f46aff6f96723f076a6d159ee21015c3c73a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 28 May 2013 15:43:12 +0000 Subject: [PATCH] From Farshid Lashkari, "The logic for handling opacity maps in the 3ds reader seems to be incorrect. It checks whether the diffuse texture contains transparency, instead of the opacity texture. If the diffuse does not contain an alpha channel it outputs the warning: The plugin does not support images without alpha channel for opacity This seems to indicate that the check for alpha should be against the opacity map. I've attached the updated file. " --- src/osgPlugins/3ds/ReaderWriter3DS.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/3ds/ReaderWriter3DS.cpp b/src/osgPlugins/3ds/ReaderWriter3DS.cpp index e0c27cb03..c5616a66e 100644 --- a/src/osgPlugins/3ds/ReaderWriter3DS.cpp +++ b/src/osgPlugins/3ds/ReaderWriter3DS.cpp @@ -1264,10 +1264,10 @@ ReaderWriter3DS::StateSetInfo ReaderWriter3DS::ReaderObject::createStateSet(Lib3 } // opacity - osg::Texture* opacity_map = createTexture(&(mat->opacity_map),"opacity_map", textureTransparency); - if (opacity_map && texture1_map) + osg::Texture2D* opacity_map = createTexture(&(mat->opacity_map),"opacity_map", textureTransparency); + if (opacity_map) { - if(texture1_map->getImage()->isImageTranslucent()) + if(opacity_map->getImage()->isImageTranslucent()) { transparency = true;