Added support in DisplaySettings and OscCameraGroup for requesting accumulator buffer.
This commit is contained in:
@@ -156,11 +156,17 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
|
||||
unsigned int getMinimumNumAlphaBits() const { return _minimumNumberAlphaBits; }
|
||||
bool getAlphaBuffer() const { return _minimumNumberAlphaBits!=0; }
|
||||
|
||||
|
||||
void setMinimumNumStencilBits(unsigned int bits) { _minimumNumberStencilBits = bits; }
|
||||
unsigned int getMinimumNumStencilBits() const { return _minimumNumberStencilBits; }
|
||||
bool getStencilBuffer() const { return _minimumNumberStencilBits!=0; }
|
||||
|
||||
void setMinimumNumAccumBits(unsigned int red, unsigned int green, unsigned int blue, unsigned int alpha);
|
||||
unsigned int getMinimumNumAccumRedBits() const { return _minimumNumberAccumRedBits; }
|
||||
unsigned int getMinimumNumAccumGreenBits() const { return _minimumNumberAccumGreenBits; }
|
||||
unsigned int getMinimumNumAccumBlueBits() const { return _minimumNumberAccumBlueBits; }
|
||||
unsigned int getMinimumNumAccumAlphaBits() const { return _minimumNumberAccumAlphaBits; }
|
||||
bool getAccumBuffer() const { return (_minimumNumberAccumRedBits+_minimumNumberAccumGreenBits+_minimumNumberAccumBlueBits+_minimumNumberAccumAlphaBits)!=0; }
|
||||
|
||||
|
||||
void setMaxNumberOfGraphicsContexts(unsigned int num) { _maxNumOfGraphicsContexts = num; }
|
||||
unsigned int getMaxNumberOfGraphicsContexts() const { return _maxNumOfGraphicsContexts; }
|
||||
@@ -190,6 +196,10 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
|
||||
bool _depthBuffer;
|
||||
unsigned int _minimumNumberAlphaBits;
|
||||
unsigned int _minimumNumberStencilBits;
|
||||
unsigned int _minimumNumberAccumRedBits;
|
||||
unsigned int _minimumNumberAccumGreenBits;
|
||||
unsigned int _minimumNumberAccumBlueBits;
|
||||
unsigned int _minimumNumberAccumAlphaBits;
|
||||
|
||||
unsigned int _maxNumOfGraphicsContexts;
|
||||
|
||||
|
||||
@@ -108,10 +108,22 @@ void DisplaySettings::setDefaults()
|
||||
_depthBuffer = true;
|
||||
_minimumNumberAlphaBits = 0;
|
||||
_minimumNumberStencilBits = 0;
|
||||
_minimumNumberAccumRedBits = 0;
|
||||
_minimumNumberAccumGreenBits = 0;
|
||||
_minimumNumberAccumBlueBits = 0;
|
||||
_minimumNumberAccumAlphaBits = 0;
|
||||
|
||||
_maxNumOfGraphicsContexts = 3;
|
||||
}
|
||||
|
||||
void DisplaySettings::setMinimumNumAccumBits(unsigned int red, unsigned int green, unsigned int blue, unsigned int alpha)
|
||||
{
|
||||
_minimumNumberAccumRedBits = red;
|
||||
_minimumNumberAccumGreenBits = green;
|
||||
_minimumNumberAccumBlueBits = blue;
|
||||
_minimumNumberAccumAlphaBits = alpha;
|
||||
}
|
||||
|
||||
static ApplicationUsageProxy DisplaySetting_e0(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_DISPLAY_TYPE <type>","MONITOR | POWERWALL | REALITY_CENTER | HEAD_MOUNTED_DISPLAY");
|
||||
static ApplicationUsageProxy DisplaySetting_e1(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_STEREO_MODE <mode>","QUAD_BUFFER | ANAGLYPHIC | HORIZONTAL_SPLIT | VERTICAL_SPLIT | LEFT_EYE | RIGHT_EYE | VERTICAL_INTERLACE | HORIZONTAL_INTERLACE");
|
||||
static ApplicationUsageProxy DisplaySetting_e2(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_STEREO <mode>","OFF | ON");
|
||||
@@ -289,6 +301,8 @@ void DisplaySettings::readCommandLine(ArgumentParser& arguments)
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--stereo <mode>","ANAGLYPHIC | QUAD_BUFFER | HORIZONTAL_SPLIT | VERTICAL_SPLIT | LEFT_EYE | RIGHT_EYE | ON | OFF ");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--rgba","Request a RGBA color buffer visual");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--stencil","Request a stencil buffer visual");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--accum-rgb","Request a rgb acummulator buffer visual");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--accum-rgba","Request a rgb acummulator buffer visual");
|
||||
}
|
||||
|
||||
std::string str;
|
||||
@@ -326,4 +340,14 @@ void DisplaySettings::readCommandLine(ArgumentParser& arguments)
|
||||
{
|
||||
_minimumNumberStencilBits = 1;
|
||||
}
|
||||
|
||||
while (arguments.read("--accum-rgb"))
|
||||
{
|
||||
setMinimumNumAccumBits(8,8,8,0);
|
||||
}
|
||||
|
||||
while (arguments.read("--accum-rgba"))
|
||||
{
|
||||
setMinimumNumAccumBits(8,8,8,8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,6 +537,14 @@ bool OsgCameraGroup::realize()
|
||||
|
||||
rs_vc->setDepthSize(24);
|
||||
|
||||
if (_ds->getAccumBuffer())
|
||||
{
|
||||
rs_vc->setAccumRedSize(_ds->getMinimumNumAccumRedBits());
|
||||
rs_vc->setAccumGreenSize(_ds->getMinimumNumAccumGreenBits());
|
||||
rs_vc->setAccumBlueSize(_ds->getMinimumNumAccumBlueBits());
|
||||
rs_vc->setAccumAlphaSize(_ds->getMinimumNumAccumAlphaBits());
|
||||
}
|
||||
|
||||
if (numMultiSamples)
|
||||
{
|
||||
#if defined( GLX_SAMPLES_SGIS )
|
||||
|
||||
Reference in New Issue
Block a user