# osgUtil::RenderStage Class Reference

RenderStage base class. More...

Inheritance diagram for osgUtil::RenderStage:

[legend]
List of all members.

## Public Member Functions

| RenderStage (SortMode mode=SORT_BY_STATE)
| RenderStage (const RenderStage &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual osg::Object * | cloneType () const
| Clone the type of an object, with Object* return type.
virtual osg::Object * | clone (const osg::CopyOp &copyop) const
virtual bool | isSameKindAs (const osg::Object *obj) const
virtual const char * | className () const
| return the name of the object's class type.
virtual void | reset ()
void | setViewport (osg::Viewport *viewport)
| Set the viewport.
const osg::Viewport * | getViewport () const
| Get the const viewport.
osg::Viewport * | getViewport ()
| Get the viewport.
void | setClearMask (GLbitfield mask)
| Set the clear mask used in glClear(..).
GLbitfield | getClearMask () const
| Get the clear mask.
void | setColorMask (osg::ColorMask *cm)
osg::ColorMask * | getColorMask ()
const osg::ColorMask * | getColorMask () const
void | setClearColor (const osg::Vec4 &color)
| Set the clear color used in glClearColor(..).
const osg::Vec4 & | getClearColor () const
| Get the clear color.
void | setClearAccum (const osg::Vec4 &color)
| Set the clear accum used in glClearAccum(..).
const osg::Vec4 & | getClearAccum () const
| Get the clear accum.
void | setClearDepth (double depth)
| Set the clear depth used in glClearDepth(..).
double | getClearDepth () const
| Get the clear depth.
void | setClearStencil (int stencil)
| Set the clear stencil value used in glClearStencil().
int | getClearStencil () const
| Get the clear color.
void | setRenderStageLighting (RenderStageLighting *rsl)
RenderStageLighting * | getRenderStageLighting () const
virtual void | addPositionedAttribute (osg::RefMatrix *matrix, const osg::StateAttribute *attr)
virtual void | addPositionedTextureAttribute (unsigned int textureUnit, osg::RefMatrix *matrix, const osg::StateAttribute *attr)
virtual void | drawPreRenderStages (osg::State &state, RenderLeaf *&previous)
virtual void | draw (osg::State &state, RenderLeaf *&previous)
virtual void | drawImplementation (osg::State &state, RenderLeaf *&previous)
void | addToDependencyList (RenderStage *rs)
bool | getStats (Statistics *primStats)
| Extract stats for current draw list.

## Protected Types

typedef std::vector< osg::ref_ptr< RenderStage > > | DependencyList

## Protected Member Functions

virtual | ~RenderStage ()

## Protected Attributes

bool | _stageDrawnThisFrame
DependencyList | _dependencyList
osg::ref_ptr< osg::Viewport > | _viewport
GLbitfield | _clearMask
osg::ref_ptr< osg::ColorMask > | _colorMask
osg::Vec4 | _clearColor
osg::Vec4 | _clearAccum
double | _clearDepth
int | _clearStencil
osg::ref_ptr< RenderStageLighting > | _renderStageLighting

## Detailed Description

RenderStage base class.

Used for encapsulate a complete stage in rendering - setting up of viewport, the projection and model matrices and rendering the RenderBin's enclosed with this RenderStage. RenderStage also has a dependency list of other RenderStages, each of which must be called before the rendering of this stage. These 'pre' rendering stages are used for advanced rendering techniques like multistage pixel shading or impostors.

## Member Typedef Documentation

typedef std::vector< osg::ref_ptr<RenderStage> > osgUtil::RenderStage::DependencyList `[protected]`

## Constructor & Destructor Documentation

RenderStage::RenderStage | ( | SortMode | mode = `SORT_BY_STATE` | ) |

RenderStage::RenderStage | ( | const RenderStage & | rhs,
|  | const osg::CopyOp & | copyop = `osg::CopyOp::SHALLOW_COPY`
| ) |

RenderStage::~RenderStage | ( |  | ) | `[protected, virtual]`

## Member Function Documentation

virtual void osgUtil::RenderStage::addPositionedAttribute | ( | osg::RefMatrix * | matrix,
|  | const osg::StateAttribute * | attr
| ) | `[inline, virtual]`

virtual void osgUtil::RenderStage::addPositionedTextureAttribute | ( | unsigned int | textureUnit,
|  | osg::RefMatrix * | matrix,
|  | const osg::StateAttribute * | attr
| ) | `[inline, virtual]`

void RenderStage::addToDependencyList | ( | RenderStage * | rs | ) |

virtual const char* osgUtil::RenderStage::className | ( |  | ) | const`[inline, virtual]`

| return the name of the object's class type. Must be defined by derived classes. Reimplemented from osgUtil::RenderBin. Reimplemented in osgUtil::RenderToTextureStage.

virtual osg::Object* osgUtil::RenderStage::clone | ( | const osg::CopyOp & | copyop | ) | const`[inline, virtual]`

| Reimplemented from osgUtil::RenderBin. Reimplemented in osgUtil::RenderToTextureStage.

virtual osg::Object* osgUtil::RenderStage::cloneType | ( |  | ) | const`[inline, virtual]`

| Clone the type of an object, with Object* return type. Must be defined by derived classes. Reimplemented from osgUtil::RenderBin. Reimplemented in osgUtil::RenderToTextureStage.

void RenderStage::draw | ( | osg::State & | state,
|  | RenderLeaf *& | previous
| ) | `[virtual]`

| Reimplemented from osgUtil::RenderBin. Reimplemented in osgUtil::RenderToTextureStage.

void RenderStage::drawImplementation | ( | osg::State & | state,
|  | RenderLeaf *& | previous
| ) | `[virtual]`

| Reimplemented from osgUtil::RenderBin.

void RenderStage::drawPreRenderStages | ( | osg::State & | state,
|  | RenderLeaf *& | previous
| ) | `[virtual]`

const osg::Vec4& osgUtil::RenderStage::getClearAccum | ( |  | ) | const`[inline]`

| Get the clear accum.

const osg::Vec4& osgUtil::RenderStage::getClearColor | ( |  | ) | const`[inline]`

| Get the clear color.

double osgUtil::RenderStage::getClearDepth | ( |  | ) | const`[inline]`

| Get the clear depth.

GLbitfield osgUtil::RenderStage::getClearMask | ( |  | ) | const`[inline]`

| Get the clear mask.

int osgUtil::RenderStage::getClearStencil | ( |  | ) | const`[inline]`

| Get the clear color.

const osg::ColorMask* osgUtil::RenderStage::getColorMask | ( |  | ) | const`[inline]`

osg::ColorMask* osgUtil::RenderStage::getColorMask | ( |  | ) | `[inline]`

RenderStageLighting* osgUtil::RenderStage::getRenderStageLighting | ( |  | ) | const`[inline]`

bool RenderStage::getStats | ( | Statistics * | primStats | ) |

| Extract stats for current draw list. Reimplemented from osgUtil::RenderBin.

osg::Viewport* osgUtil::RenderStage::getViewport | ( |  | ) | `[inline]`

| Get the viewport.

const osg::Viewport* osgUtil::RenderStage::getViewport | ( |  | ) | const`[inline]`

| Get the const viewport.

virtual bool osgUtil::RenderStage::isSameKindAs | ( | const osg::Object * | obj | ) | const`[inline, virtual]`

| Reimplemented from osgUtil::RenderBin. Reimplemented in osgUtil::RenderToTextureStage.

void RenderStage::reset | ( |  | ) | `[virtual]`

| Reimplemented from osgUtil::RenderBin. Reimplemented in osgUtil::RenderToTextureStage.

void osgUtil::RenderStage::setClearAccum | ( | const osg::Vec4 & | color | ) | `[inline]`

| Set the clear accum used in glClearAccum(..). glClearAcumm is only called if mask & GL_ACCUM_BUFFER_BIT is true.

void osgUtil::RenderStage::setClearColor | ( | const osg::Vec4 & | color | ) | `[inline]`

| Set the clear color used in glClearColor(..). glClearColor is only called if mask & GL_COLOR_BUFFER_BIT is true

void osgUtil::RenderStage::setClearDepth | ( | double | depth | ) | `[inline]`

| Set the clear depth used in glClearDepth(..). Defaults to 1.0 glClearDepth is only called if mask & GL_DEPTH_BUFFER_BIT is true.

void osgUtil::RenderStage::setClearMask | ( | GLbitfield | mask | ) | `[inline]`

| Set the clear mask used in glClear(..). Defaults to GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT.

void osgUtil::RenderStage::setClearStencil | ( | int | stencil | ) | `[inline]`

| Set the clear stencil value used in glClearStencil(). Defaults to 0; glClearStencil is only called if mask & GL_STENCIL_BUFFER_BIT is true

void osgUtil::RenderStage::setColorMask | ( | osg::ColorMask * | cm | ) | `[inline]`

void osgUtil::RenderStage::setRenderStageLighting | ( | RenderStageLighting * | rsl | ) | `[inline]`

void osgUtil::RenderStage::setViewport | ( | osg::Viewport * | viewport | ) | `[inline]`

| Set the viewport.

## Member Data Documentation

osg::Vec4 osgUtil::RenderStage::_clearAccum `[protected]`

osg::Vec4 osgUtil::RenderStage::_clearColor `[protected]`

double osgUtil::RenderStage::_clearDepth `[protected]`

GLbitfield osgUtil::RenderStage::_clearMask `[protected]`

int osgUtil::RenderStage::_clearStencil `[protected]`

osg::ref_ptr<osg::ColorMask> osgUtil::RenderStage::_colorMask `[protected]`

DependencyList osgUtil::RenderStage::_dependencyList `[protected]`

osg::ref_ptr<RenderStageLighting> osgUtil::RenderStage::_renderStageLighting `[mutable, protected]`

bool osgUtil::RenderStage::_stageDrawnThisFrame `[protected]`

osg::ref_ptr<osg::Viewport> osgUtil::RenderStage::_viewport `[protected]`

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

- RenderStage
- RenderStage.cpp