Added support for <image blending="ON" or blending="OFF"> to allow user definition of when to enable OpenGL blending for an image or not.
This commit is contained in:
@@ -246,7 +246,8 @@ public:
|
||||
duration(-1.0),
|
||||
imageSequence(false),
|
||||
imageSequencePagingMode(osg::ImageSequence::PAGE_AND_DISCARD_USED_IMAGES),
|
||||
imageSequenceInteractionMode(PLAY_AUTOMATICALLY_LIKE_MOVIE)
|
||||
imageSequenceInteractionMode(PLAY_AUTOMATICALLY_LIKE_MOVIE),
|
||||
blendingHint(USE_IMAGE_ALPHA)
|
||||
{}
|
||||
|
||||
std::string options;
|
||||
@@ -271,7 +272,16 @@ public:
|
||||
USE_MOUSE_Y_POSITION
|
||||
};
|
||||
ImageSequenceInteractionMode imageSequenceInteractionMode;
|
||||
|
||||
enum BlendingHint
|
||||
{
|
||||
USE_IMAGE_ALPHA,
|
||||
OFF,
|
||||
ON
|
||||
};
|
||||
|
||||
BlendingHint blendingHint;
|
||||
|
||||
};
|
||||
|
||||
struct VolumeData
|
||||
|
||||
@@ -935,6 +935,16 @@ bool ReaderWriterP3DXML::getProperties(osgDB::XmlNode*cur, osgPresentation::Slid
|
||||
OSG_NOTIFY(_notifyLevel)<<"read imageSequencePagingMode \""<<value.imageSequenceInteractionMode<<"\""<<std::endl;
|
||||
}
|
||||
|
||||
if (getProperty(cur, "blending", str))
|
||||
{
|
||||
propertiesRead = true;
|
||||
|
||||
if (str=="ON" || str=="On" || str=="on" || str=="enable" ) value.blendingHint = osgPresentation::SlideShowConstructor::ImageData::ON;
|
||||
else if (str=="OFF" || str=="Off" || str=="off" || str=="disable" ) value.blendingHint = osgPresentation::SlideShowConstructor::ImageData::OFF;
|
||||
|
||||
OSG_NOTIFY(_notifyLevel)<<"read blendingHint \""<<value.blendingHint<<"\""<<std::endl;
|
||||
}
|
||||
|
||||
/*
|
||||
if (getProperty(cur, "texcoord_offset", value.texcoord_offset))
|
||||
{
|
||||
|
||||
@@ -1115,6 +1115,16 @@ void SlideShowConstructor::addImage(const std::string& filename, const PositionD
|
||||
isImageTranslucent = image->isImageTranslucent();
|
||||
}
|
||||
|
||||
if (imageData.blendingHint==ImageData::ON)
|
||||
{
|
||||
isImageTranslucent = true;
|
||||
}
|
||||
else if (imageData.blendingHint==ImageData::OFF)
|
||||
{
|
||||
isImageTranslucent = false;
|
||||
}
|
||||
|
||||
|
||||
float s = image->s();
|
||||
float t = image->t();
|
||||
|
||||
@@ -1274,6 +1284,15 @@ void SlideShowConstructor::addStereoImagePair(const std::string& filenameLeft, c
|
||||
isImageTranslucent = imageRight->isImageTranslucent();
|
||||
}
|
||||
|
||||
if (imageDataLeft.blendingHint==ImageData::ON || imageDataRight.blendingHint==ImageData::ON)
|
||||
{
|
||||
isImageTranslucent = true;
|
||||
}
|
||||
else if (imageDataLeft.blendingHint==ImageData::OFF || imageDataRight.blendingHint==ImageData::OFF)
|
||||
{
|
||||
isImageTranslucent = false;
|
||||
}
|
||||
|
||||
|
||||
float s = imageLeft->s();
|
||||
float t = imageLeft->t();
|
||||
|
||||
Reference in New Issue
Block a user