|
Public Member Functions |
| BumpMapping () |
| BumpMapping (const BumpMapping ©, const osg::CopyOp ©op=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 |
| get the OpenGL light number
|
void | setLightNumber (int n) |
| set the OpenGL light number that will be used in lighting computations
|
int | getDiffuseTextureUnit () const |
| get the texture unit that contains diffuse color texture.
|
void | setDiffuseTextureUnit (int n) |
| set the texture unit that contains diffuse color texture.
|
int | getNormalMapTextureUnit () const |
| get the texture unit that contains normal map texture.
|
void | setNormalMapTextureUnit (int n) |
| set the texture unit that contains normal map texture.
|
osg::Texture2D * | getOverrideDiffuseTexture () |
| get the diffuse color texture that overrides children's texture
|
const osg::Texture2D * | getOverrideDiffuseTexture () const |
| get the const diffuse color texture that overrides children's texture
|
void | setOverrideDiffuseTexture (osg::Texture2D *texture) |
| set the diffuse color texture that overrides children's texture
|
osg::Texture2D * | getOverrideNormalMapTexture () |
| get the normal map texture that overrides children's texture
|
const osg::Texture2D * | getOverrideNormalMapTexture () const |
| get the const normal map texture that overrides children's texture
|
void | setOverrideNormalMapTexture (osg::Texture2D *texture) |
| set the normal map texture that overrides children's texture
|
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
|
Protected Member Functions |
virtual | ~BumpMapping () |
BumpMapping & | operator= (const BumpMapping &) |
bool | define_techniques () |
| abstract method to be implemented in derived classes; its purpose if to create the techniques that can be used for obtaining the desired effect.
|
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.