osgFX::BumpMapping Class Reference

Inheritance diagram for osgFX::BumpMapping:

osgFX::Effect osg::Group osg::Node osg::Object osg::Referenced List of all members.

Public Member Functions

 BumpMapping ()
 BumpMapping (const BumpMapping &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 META_Effect (osgFX, BumpMapping,"Bump Mapping","This effect makes surfaces appear bumpy. Children nodes must use two textures, ""one for diffuse color and one for the normal map (which can be created ""from a height map with tools like nVIDIA's normal map generator). Furthermore, ""tangent-space basis vectors must be created and assigned to each Geometry; this ""can be done quickly by calling BumpMapping::prepareChildren(). Note that both ""diffuse and normal map textures must have corresponding UV maps defined in ""Geometry objects.\n""This effect defines a preferred technique which uses ARB vertex & fragment ""programs, and a fallback technique which doesn't use fragment programs. The ""latter is more limited though since it can't handle ambient and specular ""components.","Marco Jez")
int getLightNumber () const
void setLightNumber (int n)
int getDiffuseTextureUnit () const
void setDiffuseTextureUnit (int n)
int getNormalMapTextureUnit () const
void setNormalMapTextureUnit (int n)
osg::Texture2DgetOverrideDiffuseTexture ()
const osg::Texture2DgetOverrideDiffuseTexture () const
void setOverrideDiffuseTexture (osg::Texture2D *texture)
osg::Texture2DgetOverrideNormalMapTexture ()
const osg::Texture2DgetOverrideNormalMapTexture () const
void setOverrideNormalMapTexture (osg::Texture2D *texture)
void prepareGeometry (osg::Geometry *geo)
void prepareNode (osg::Node *node)
void prepareChildren ()
void setUpDemo ()

Protected Member Functions

virtual ~BumpMapping ()
BumpMappingoperator= (const BumpMapping &)
bool define_techniques ()

Detailed Description

This effect makes surfaces appear bumpy. Children nodes must use two textures, one for diffuse color and one for the normal map (which can be created from a height map with tools like nVIDIA's normal map generator). Furthermore, tangent-space basis vectors must be created and assigned to each Geometry; this can be done quickly by calling BumpMapping::prepareChildren(). Note that both diffuse and normal map textures must have corresponding UV maps defined in Geometry objects. This effect defines a preferred technique which uses ARB vertex & fragment programs, and a fallback technique which doesn't use fragment programs. The latter is more limited though since it can't handle ambient and specular components.


Constructor & Destructor Documentation

osgFX::BumpMapping::BumpMapping (  ) 

osgFX::BumpMapping::BumpMapping ( const BumpMapping copy,
const osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY 
)

virtual osgFX::BumpMapping::~BumpMapping (  )  [inline, protected, virtual]


Member Function Documentation

bool osgFX::BumpMapping::define_techniques (  )  [protected, virtual]

abstract method to be implemented in derived classes; its purpose if to create the techniques that can be used for obtaining the desired effect. You will usually call addTechnique() inside this method.

Implements osgFX::Effect.

int osgFX::BumpMapping::getDiffuseTextureUnit (  )  const [inline]

get the texture unit that contains diffuse color texture. Default is 1

int osgFX::BumpMapping::getLightNumber (  )  const [inline]

get the OpenGL light number

int osgFX::BumpMapping::getNormalMapTextureUnit (  )  const [inline]

get the texture unit that contains normal map texture. Default is 0

const osg::Texture2D * osgFX::BumpMapping::getOverrideDiffuseTexture (  )  const [inline]

get the const diffuse color texture that overrides children's texture

osg::Texture2D * osgFX::BumpMapping::getOverrideDiffuseTexture (  )  [inline]

get the diffuse color texture that overrides children's texture

const osg::Texture2D * osgFX::BumpMapping::getOverrideNormalMapTexture (  )  const [inline]

get the const normal map texture that overrides children's texture

osg::Texture2D * osgFX::BumpMapping::getOverrideNormalMapTexture (  )  [inline]

get the normal map texture that overrides children's texture

osgFX::BumpMapping::META_Effect ( osgFX  ,
BumpMapping  ,
"Bump Mapping"  ,
"This effect makes surfaces appear bumpy. Children nodes must use two   textures,
""one for diffuse color and one for the normal map(which can be created""from a height map with tools like nVIDIA's normal map generator).  Furthermore,
""tangent-space basis vectors must be created and assigned to each Geometry;this""can be done quickly by calling BumpMapping::prepareChildren().Note that both""diffuse and normal map textures must have corresponding UV maps defined in""Geometry objects.\n""This effect defines a preferred technique which uses ARB vertex &fragment""  programs,
and a fallback technique which doesn't use fragment programs.The""latter is more limited though since it can't handle ambient and specular""components."  ,
"Marco Jez"   
)

BumpMapping& osgFX::BumpMapping::operator= ( const BumpMapping  )  [inline, protected]

void osgFX::BumpMapping::prepareChildren (  ) 

prepare children for bump lighting. Actually calls prepareNode() for each child

void osgFX::BumpMapping::prepareGeometry ( osg::Geometry geo  ) 

prepare a Geometry for bump lighting. Tangent-space basis vectors are generated and attached to the geometry as vertex attribute arrays.

void osgFX::BumpMapping::prepareNode ( osg::Node node  ) 

prepare a Node for bump lighting, calling prepareGeometry() for each Geometry

void osgFX::BumpMapping::setDiffuseTextureUnit ( int  n  )  [inline]

set the texture unit that contains diffuse color texture. Default is 1

void osgFX::BumpMapping::setLightNumber ( int  n  )  [inline]

set the OpenGL light number that will be used in lighting computations

void osgFX::BumpMapping::setNormalMapTextureUnit ( int  n  )  [inline]

set the texture unit that contains normal map texture. Default is 0

void osgFX::BumpMapping::setOverrideDiffuseTexture ( osg::Texture2D texture  )  [inline]

set the diffuse color texture that overrides children's texture

void osgFX::BumpMapping::setOverrideNormalMapTexture ( osg::Texture2D texture  )  [inline]

set the normal map texture that overrides children's texture

void osgFX::BumpMapping::setUpDemo (  )  [virtual]

set up a demo environment with predefined diffuse and normal maps, as well as texture coordinates

Reimplemented from osgFX::Effect.


The documentation for this class was generated from the following file:
Generated on Sun Oct 1 13:17:09 2006 for openscenegraph by  doxygen 1.4.7