OpenSceneGraph
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
osg::CullSettings Class Reference
Inheritance diagram for osg::CullSettings:
Inheritance graph
[legend]
Collaboration diagram for osg::CullSettings:
Collaboration graph
[legend]

Classes

struct  ClampProjectionMatrixCallback
 Callback for overriding the CullVisitor's default clamping of the projection matrix to computed near and far values. More...
 

Public Types

enum  VariablesMask {
  COMPUTE_NEAR_FAR_MODE = (0x1 << 0), CULLING_MODE = (0x1 << 1), LOD_SCALE = (0x1 << 2), SMALL_FEATURE_CULLING_PIXEL_SIZE = (0x1 << 3),
  CLAMP_PROJECTION_MATRIX_CALLBACK = (0x1 << 4), NEAR_FAR_RATIO = (0x1 << 5), IMPOSTOR_ACTIVE = (0x1 << 6), DEPTH_SORT_IMPOSTOR_SPRITES = (0x1 << 7),
  IMPOSTOR_PIXEL_ERROR_THRESHOLD = (0x1 << 8), NUM_FRAMES_TO_KEEP_IMPOSTORS_SPRITES = (0x1 << 9), CULL_MASK = (0x1 << 10), CULL_MASK_LEFT = (0x1 << 11),
  CULL_MASK_RIGHT = (0x1 << 12), CLEAR_COLOR = (0x1 << 13), CLEAR_MASK = (0x1 << 14), LIGHTING_MODE = (0x1 << 15),
  LIGHT = (0x1 << 16), DRAW_BUFFER = (0x1 << 17), READ_BUFFER = (0x1 << 18), NO_VARIABLES = 0x00000000,
  ALL_VARIABLES = 0x7FFFFFFF
}
 
enum  InheritanceMaskActionOnAttributeSetting { DISABLE_ASSOCIATED_INHERITANCE_MASK_BIT, DO_NOT_MODIFY_INHERITANCE_MASK }
 
enum  ComputeNearFarMode { DO_NOT_COMPUTE_NEAR_FAR = 0, COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES, COMPUTE_NEAR_FAR_USING_PRIMITIVES, COMPUTE_NEAR_USING_PRIMITIVES }
 
enum  CullingModeValues {
  NO_CULLING = 0x0, VIEW_FRUSTUM_SIDES_CULLING = 0x1, NEAR_PLANE_CULLING = 0x2, FAR_PLANE_CULLING = 0x4,
  VIEW_FRUSTUM_CULLING, SMALL_FEATURE_CULLING = 0x8, SHADOW_OCCLUSION_CULLING = 0x10, CLUSTER_CULLING = 0x20,
  DEFAULT_CULLING, ENABLE_ALL_CULLING
}
 
typedef int InheritanceMask
 
typedef int CullingMode
 

Public Member Functions

 CullSettings (ArgumentParser &arguments)
 
 CullSettings (const CullSettings &cs)
 
CullSettingsoperator= (const CullSettings &settings)
 
virtual void setDefaults ()
 
void setInheritanceMask (InheritanceMask mask)
 Set the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object. More...
 
InheritanceMask getInheritanceMask () const
 Get the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object. More...
 
void setCullSettings (const CullSettings &settings)
 Set the local cull settings values from specified CullSettings object. More...
 
virtual void inheritCullSettings (const CullSettings &settings)
 Inherit the local cull settings variable from specified CullSettings object, according to the inheritance mask. More...
 
virtual void inheritCullSettings (const CullSettings &settings, unsigned int inheritanceMask)
 Inherit the local cull settings variable from specified CullSettings object, according to the inheritance mask. More...
 
void readEnvironmentalVariables ()
 read the environmental variables. More...
 
void readCommandLine (ArgumentParser &arguments)
 read the commandline arguments. More...
 
void setInheritanceMaskActionOnAttributeSetting (InheritanceMaskActionOnAttributeSetting action)
 
InheritanceMaskActionOnAttributeSetting getInheritanceMaskActionOnAttributeSetting () const
 
void applyMaskAction (unsigned int maskBit)
 Apply the action, specified by the InheritanceMaskActionOnAttributeSetting, to apply to the inheritance bit mask. More...
 
void setImpostorsActive (bool active)
 Switch the creation of Impostors on or off. More...
 
bool getImpostorsActive () const
 Get whether impostors are active or not. More...
 
void setImpostorPixelErrorThreshold (float numPixels)
 Set the impostor error threshold. More...
 
float getImpostorPixelErrorThreshold () const
 Get the impostor error threshold. More...
 
void setDepthSortImpostorSprites (bool doDepthSort)
 Set whether ImpostorSprite's should be placed in a depth sorted bin for rendering. More...
 
bool getDepthSortImpostorSprites () const
 Get whether ImpostorSprite's are depth sorted bin for rendering. More...
 
void setNumberOfFrameToKeepImpostorSprites (int numFrames)
 Set the number of frames that an ImpostorSprite is kept whilst not being beyond, before being recycled. More...
 
int getNumberOfFrameToKeepImpostorSprites () const
 Get the number of frames that an ImpostorSprite is kept whilst not being beyond, before being recycled. More...
 
void setComputeNearFarMode (ComputeNearFarMode cnfm)
 
ComputeNearFarMode getComputeNearFarMode () const
 
void setNearFarRatio (double ratio)
 
double getNearFarRatio () const
 
void setCullingMode (CullingMode mode)
 Set the culling mode for the CullVisitor to use. More...
 
CullingMode getCullingMode () const
 Returns the current CullingMode. More...
 
void setCullMask (osg::Node::NodeMask nm)
 
osg::Node::NodeMask getCullMask () const
 
void setCullMaskLeft (osg::Node::NodeMask nm)
 
osg::Node::NodeMask getCullMaskLeft () const
 
void setCullMaskRight (osg::Node::NodeMask nm)
 
osg::Node::NodeMask getCullMaskRight () const
 
void setLODScale (float scale)
 Set the LOD bias for the CullVisitor to use. More...
 
float getLODScale () const
 Get the LOD bias. More...
 
void setSmallFeatureCullingPixelSize (float value)
 Threshold at which small features are culled. More...
 
float getSmallFeatureCullingPixelSize () const
 Get the Small Feature Culling Pixel Size. More...
 
void setClampProjectionMatrixCallback (ClampProjectionMatrixCallback *cpmc)
 set the ClampProjectionMatrixCallback. More...
 
ClampProjectionMatrixCallbackgetClampProjectionMatrixCallback ()
 get the non const ClampProjectionMatrixCallback. More...
 
const ClampProjectionMatrixCallbackgetClampProjectionMatrixCallback () const
 get the const ClampProjectionMatrixCallback. More...
 
void write (std::ostream &out)
 Write out internal settings of CullSettings. More...
 

Protected Attributes

InheritanceMask _inheritanceMask
 
InheritanceMaskActionOnAttributeSetting _inheritanceMaskActionOnAttributeSetting
 
ComputeNearFarMode _computeNearFar
 
CullingMode _cullingMode
 
float _LODScale
 
float _smallFeatureCullingPixelSize
 
ref_ptr< ClampProjectionMatrixCallback_clampProjectionMatrixCallback
 
double _nearFarRatio
 
bool _impostorActive
 
bool _depthSortImpostorSprites
 
float _impostorPixelErrorThreshold
 
int _numFramesToKeepImpostorSprites
 
Node::NodeMask _cullMask
 
Node::NodeMask _cullMaskLeft
 
Node::NodeMask _cullMaskRight
 

Member Function Documentation

◆ applyMaskAction()

void osg::CullSettings::applyMaskAction ( unsigned int  maskBit)
inline

Apply the action, specified by the InheritanceMaskActionOnAttributeSetting, to apply to the inheritance bit mask.

This method is called by CullSettings::set*() parameter methods to ensure that CullSettings inheritance mechanisms doesn't overwrite the local parameter settings.

◆ getClampProjectionMatrixCallback() [1/2]

ClampProjectionMatrixCallback* osg::CullSettings::getClampProjectionMatrixCallback ( )
inline

get the non const ClampProjectionMatrixCallback.

◆ getClampProjectionMatrixCallback() [2/2]

const ClampProjectionMatrixCallback* osg::CullSettings::getClampProjectionMatrixCallback ( ) const
inline

◆ getCullingMode()

CullingMode osg::CullSettings::getCullingMode ( ) const
inline

Returns the current CullingMode.

◆ getDepthSortImpostorSprites()

bool osg::CullSettings::getDepthSortImpostorSprites ( ) const
inline

Get whether ImpostorSprite's are depth sorted bin for rendering.

◆ getImpostorPixelErrorThreshold()

float osg::CullSettings::getImpostorPixelErrorThreshold ( ) const
inline

Get the impostor error threshold.

◆ getImpostorsActive()

bool osg::CullSettings::getImpostorsActive ( ) const
inline

Get whether impostors are active or not.

◆ getInheritanceMask()

InheritanceMask osg::CullSettings::getInheritanceMask ( ) const
inline

Get the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object.

◆ getLODScale()

float osg::CullSettings::getLODScale ( ) const
inline

Get the LOD bias.

◆ getNumberOfFrameToKeepImpostorSprites()

int osg::CullSettings::getNumberOfFrameToKeepImpostorSprites ( ) const
inline

Get the number of frames that an ImpostorSprite is kept whilst not being beyond, before being recycled.

◆ getSmallFeatureCullingPixelSize()

float osg::CullSettings::getSmallFeatureCullingPixelSize ( ) const
inline

Get the Small Feature Culling Pixel Size.

◆ inheritCullSettings() [1/2]

virtual void osg::CullSettings::inheritCullSettings ( const CullSettings settings)
inlinevirtual

Inherit the local cull settings variable from specified CullSettings object, according to the inheritance mask.

Reimplemented in osgUtil::SceneView.

◆ inheritCullSettings() [2/2]

virtual void osg::CullSettings::inheritCullSettings ( const CullSettings settings,
unsigned int  inheritanceMask 
)
virtual

Inherit the local cull settings variable from specified CullSettings object, according to the inheritance mask.

Reimplemented in osg::Camera, and osgUtil::SceneView.

◆ readCommandLine()

void osg::CullSettings::readCommandLine ( ArgumentParser arguments)

read the commandline arguments.

◆ readEnvironmentalVariables()

void osg::CullSettings::readEnvironmentalVariables ( )

read the environmental variables.

◆ setClampProjectionMatrixCallback()

void osg::CullSettings::setClampProjectionMatrixCallback ( ClampProjectionMatrixCallback cpmc)
inline

◆ setCullingMode()

void osg::CullSettings::setCullingMode ( CullingMode  mode)
inline

Set the culling mode for the CullVisitor to use.

◆ setCullSettings()

void osg::CullSettings::setCullSettings ( const CullSettings settings)

Set the local cull settings values from specified CullSettings object.

◆ setDepthSortImpostorSprites()

void osg::CullSettings::setDepthSortImpostorSprites ( bool  doDepthSort)
inline

Set whether ImpostorSprite's should be placed in a depth sorted bin for rendering.

◆ setImpostorPixelErrorThreshold()

void osg::CullSettings::setImpostorPixelErrorThreshold ( float  numPixels)
inline

Set the impostor error threshold.

Used in calculation of whether impostors remain valid.

◆ setImpostorsActive()

void osg::CullSettings::setImpostorsActive ( bool  active)
inline

Switch the creation of Impostors on or off.

Setting active to false forces the CullVisitor to use the Impostor LOD children for rendering. Setting active to true forces the CullVisitor to create the appropriate pre-rendering stages which render to the ImpostorSprite's texture.

◆ setInheritanceMask()

void osg::CullSettings::setInheritanceMask ( InheritanceMask  mask)
inline

Set the inheritance mask used in inheritCullSettings to control which variables get overwritten by the passed in CullSettings object.

◆ setLODScale()

void osg::CullSettings::setLODScale ( float  scale)
inline

Set the LOD bias for the CullVisitor to use.

◆ setNumberOfFrameToKeepImpostorSprites()

void osg::CullSettings::setNumberOfFrameToKeepImpostorSprites ( int  numFrames)
inline

Set the number of frames that an ImpostorSprite is kept whilst not being beyond, before being recycled.

◆ setSmallFeatureCullingPixelSize()

void osg::CullSettings::setSmallFeatureCullingPixelSize ( float  value)
inline

Threshold at which small features are culled.

Parameters
valueBounding volume size in screen space. Default is 2.0.

◆ write()

void osg::CullSettings::write ( std::ostream &  out)

Write out internal settings of CullSettings.


The documentation for this class was generated from the following file: