version 3.3

VRS::BackgroundGL Class Reference

#include <vrs/opengl/backgroundgl.h>

Inheritance diagram for VRS::BackgroundGL:

VRS::TechniqueGL VRS::Technique VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Types

enum  Direction { TopToBottom, LeftToRight }

Public Member Functions

 VRS_SERIALIZABLE_CLASS_ENUM (Direction)
 BackgroundGL (double intensity=1)
 BackgroundGL (double r, double g, double b, double a=1.0)
 BackgroundGL (const Color &color)
 BackgroundGL (const Color &c0, const Color &c1, Direction direction=BackgroundGL::TopToBottom)
 BackgroundGL (TextureGL *backgroundTexture)
void setColor (const Color &color, int index)
 index must be 0 or 1
Color getColor (int index) const
 index must be 0 or 1
void setDirection (BackgroundGL::Direction direction)
 TopToBottom or LeftToRight.
BackgroundGL::Direction getDirection () const
 TopToBottom or LeftToRight.
void setTexture (TextureGL *backgroundTexture)
 set background texture
TextureGLgetTexture () const
 get background texture
virtual bool preparePass (Engine *)
virtual void finishPass (Engine *)
 Empty implementation.
virtual bool prepareEval (Engine *, const Shape *)
 Irrelevant for CameraTechnique.
virtual void finishEval (Engine *, const Shape *)
 Irrelevant for CameraTechnique.
bool renderBackground (Engine *engine)
 'renderBackground' is called automatically when the technique is active.
 VRS_TYPEINFO (BackgroundGL, TechniqueGL)
 VRS_SERIALIZABLE (BackgroundGL)


Member Enumeration Documentation

Enumerator:
TopToBottom 
LeftToRight 


Constructor & Destructor Documentation

VRS::BackgroundGL::BackgroundGL ( double  intensity = 1  ) 

VRS::BackgroundGL::BackgroundGL ( double  r,
double  g,
double  b,
double  a = 1.0 
)

VRS::BackgroundGL::BackgroundGL ( const Color color  ) 

VRS::BackgroundGL::BackgroundGL ( const Color c0,
const Color c1,
Direction  direction = BackgroundGL::TopToBottom 
)

VRS::BackgroundGL::BackgroundGL ( TextureGL backgroundTexture  ) 

Specifies an OpenGL Background. The first constructor is for specifying an uniform Background color, the second takes two colors specifying the top and bottom's color (resp. left and right's color, depending of the direction. These colors are interpolated. If backgroundTexture is a cubemap, 3D texture coordinates are computed per frame dependend on view-direction and up-vector, so that the cubemap appears as environment. Note: A background cubemap is only supported for perspective projection.


Member Function Documentation

VRS::BackgroundGL::VRS_SERIALIZABLE_CLASS_ENUM ( Direction   ) 

void VRS::BackgroundGL::setColor ( const Color color,
int  index 
)

index must be 0 or 1

Color VRS::BackgroundGL::getColor ( int  index  )  const

index must be 0 or 1

void VRS::BackgroundGL::setDirection ( BackgroundGL::Direction  direction  ) 

TopToBottom or LeftToRight.

BackgroundGL::Direction VRS::BackgroundGL::getDirection (  )  const

TopToBottom or LeftToRight.

void VRS::BackgroundGL::setTexture ( TextureGL backgroundTexture  ) 

set background texture

TextureGL* VRS::BackgroundGL::getTexture (  )  const

get background texture

virtual bool VRS::BackgroundGL::preparePass ( Engine  )  [virtual]

If a multi-color background is specified, a quad covering the viewport with the background is drawn.

Implements VRS::Technique.

virtual void VRS::BackgroundGL::finishPass ( Engine  )  [inline, virtual]

Empty implementation.

Implements VRS::Technique.

virtual bool VRS::BackgroundGL::prepareEval ( Engine ,
const Shape  
) [inline, virtual]

Irrelevant for CameraTechnique.

Implements VRS::Technique.

virtual void VRS::BackgroundGL::finishEval ( Engine ,
const Shape  
) [inline, virtual]

Irrelevant for CameraTechnique.

Implements VRS::Technique.

bool VRS::BackgroundGL::renderBackground ( Engine engine  ) 

'renderBackground' is called automatically when the technique is active.

It can be useful, however, to make this functionality available from outside to allow other techniques for rendering the background, e.g., in an additional reflection rendering pass. The method does not work for single-colored backgrounds because these are handled by setting the gl-clearcolor. The return value is true if the background could be rendered properly, i.e, either a texture or two different colors have been set.

VRS::BackgroundGL::VRS_TYPEINFO ( BackgroundGL  ,
TechniqueGL   
)

VRS::BackgroundGL::VRS_SERIALIZABLE ( BackgroundGL   ) 


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

Generated on Fri May 18 06:00:21 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact