## class OSGFX_EXPORT osgFX::BumpMapping

> This effect makes surfaces appear bumpy.

## Inheritance:

### Public Methods

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")
void prepareGeometry(osg::Geometry* geo)
  prepare a Geometry for bump lighting.
void prepareNode(osg::Node* node)
  prepare a Node for bump lighting, calling prepareGeometry() for each Geometry
void prepareChildren()
  prepare children for bump lighting.
void setUpDemo()
  set up a demo environment with predefined diffuse and normal maps, as well as texture coordinates
inline int getLightNumber() const
  get the OpenGL light number
inline void setLightNumber(int n)
  set the OpenGL light number that will be used in lighting computations
inline int getDiffuseTextureUnit() const
  get the texture unit that contains diffuse color texture.
inline void setDiffuseTextureUnit(int n)
  set the texture unit that contains diffuse color texture.
inline int getNormalMapTextureUnit() const
  get the texture unit that contains normal map texture.
inline void setNormalMapTextureUnit(int n)
  set the texture unit that contains normal map texture.
inline osg::Texture2D* getOverrideDiffuseTexture()
  get the diffuse color texture that overrides children's texture
inline const osg::Texture2D* getOverrideDiffuseTexture() const
  get the const diffuse color texture that overrides children's texture
inline void setOverrideDiffuseTexture(osg::Texture2D* texture)
  set the diffuse color texture that overrides children's texture
inline osg::Texture2D* getOverrideNormalMapTexture()
  get the normal map texture that overrides children's texture
inline const osg::Texture2D* getOverrideNormalMapTexture() const
  get the const normal map texture that overrides children's texture
inline void setOverrideNormalMapTexture(osg::Texture2D* texture)
  set the normal map texture that overrides children's texture

### Protected Methods

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

### Inherited from Effect:

### Public Methods

virtual inline bool isSameKindAs(const osg::Object* obj) const
virtual inline const char* libraryName() const
virtual inline const char* className() const
virtual const char* effectName() const
virtual const char* effectDescription() const
virtual const char* effectAuthor() const
virtual void traverse(osg::NodeVisitor &nv)
inline bool getEnabled() const
inline void setEnabled(bool v)
inline int getNumTechniques() const
inline Technique* getTechnique(int i)
inline const Technique* getTechnique(int i) const
inline int getSelectedTechnique() const
inline void selectTechnique(int i)
inline void addTechnique(Technique* tech)
inline void dirtyTechniques()
inline void inherited_traverse(osg::NodeVisitor &nv)

### Public Members

enum TechniqueSelection

## Documentation

> 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.

`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")`

`void 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 prepareNode(osg::Node* node)`
  prepare a Node for bump lighting, calling prepareGeometry() for each Geometry

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

`void setUpDemo()`
  set up a demo environment with predefined diffuse and normal maps, as well as texture coordinates

`virtual ~BumpMapping()`

`BumpMapping& operator=(const BumpMapping &)`

`bool define_techniques()`

`inline int getLightNumber() const`
  get the OpenGL light number

`inline void setLightNumber(int n)`
  set the OpenGL light number that will be used in lighting computations

`inline int getDiffuseTextureUnit() const`
  get the texture unit that contains diffuse color texture. Default is 1

`inline void setDiffuseTextureUnit(int n)`
  set the texture unit that contains diffuse color texture. Default is 1

`inline int getNormalMapTextureUnit() const`
  get the texture unit that contains normal map texture. Default is 0

`inline void setNormalMapTextureUnit(int n)`
  set the texture unit that contains normal map texture. Default is 0

`inline osg::Texture2D* getOverrideDiffuseTexture()`
  get the diffuse color texture that overrides children's texture

`inline const osg::Texture2D* getOverrideDiffuseTexture() const`
  get the const diffuse color texture that overrides children's texture

`inline void setOverrideDiffuseTexture(osg::Texture2D* texture)`
  set the diffuse color texture that overrides children's texture

`inline osg::Texture2D* getOverrideNormalMapTexture()`
  get the normal map texture that overrides children's texture

`inline const osg::Texture2D* getOverrideNormalMapTexture() const`
  get the const normal map texture that overrides children's texture

`inline void setOverrideNormalMapTexture(osg::Texture2D* texture)`
  set the normal map texture that overrides children's texture

This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java

This page was generated with the help of DOC++.