15#ifndef OSGFX_BUMPMAPPING_
16#define OSGFX_BUMPMAPPING_
49 "This effect makes surfaces appear bumpy. Children nodes must use two textures, "
50 "one for diffuse color and one for the normal map (which can be created "
51 "from a height map with tools like nVIDIA's normal map generator). Furthermore, "
52 "tangent-space basis vectors must be created and assigned to each Geometry; this "
53 "can be done quickly by calling BumpMapping::prepareChildren(). Note that both "
54 "diffuse and normal map textures must have corresponding UV maps defined in "
56 "This effect defines a preferred technique which uses ARB vertex & fragment "
57 "programs, and a fallback technique which doesn't use fragment programs. The "
58 "latter is more limited though since it can't handle ambient and specular "
144 return _diffuse_unit;
166 return _diffuse_tex.get();
171 return _diffuse_tex.get();
176 _diffuse_tex = texture;
182 return _normal_tex.get();
187 return _normal_tex.get();
192 _normal_tex = texture;
The osgFX library is a NodeKit that extends the core scene graph to provide a special effects framewo...
Definition AnisotropicLighting:25
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Base class for all internal nodes in the scene graph.
Definition Node:72
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Encapsulates OpenGL 2D texture functionality.
Definition Texture2D:25
void setDiffuseTextureUnit(int n)
set the texture unit that contains diffuse color texture.
Definition BumpMapping:147
BumpMapping(const BumpMapping ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
void setLightNumber(int n)
set the OpenGL light number that will be used in lighting computations
Definition BumpMapping:136
int getDiffuseTextureUnit() const
get the texture unit that contains diffuse color texture.
Definition BumpMapping:142
BumpMapping & operator=(const BumpMapping &)
Definition BumpMapping:117
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")
osg::Texture2D * getOverrideNormalMapTexture()
get the normal map texture that overrides children's texture
Definition BumpMapping:180
void prepareChildren()
prepare children for bump lighting.
void setOverrideNormalMapTexture(osg::Texture2D *texture)
set the normal map texture that overrides children's texture
Definition BumpMapping:190
osg::Texture2D * getOverrideDiffuseTexture()
get the diffuse color texture that overrides children's texture
Definition BumpMapping:164
void setUpDemo()
set up a demo environment with predefined diffuse and normal maps, as well as texture coordinates
void setOverrideDiffuseTexture(osg::Texture2D *texture)
set the diffuse color texture that overrides children's texture
Definition BumpMapping:174
int getLightNumber() const
get the OpenGL light number
Definition BumpMapping:131
virtual ~BumpMapping()
Definition BumpMapping:116
bool define_techniques()
abstract method to be implemented in derived classes; its purpose if to create the techniques that ca...
void setNormalMapTextureUnit(int n)
set the texture unit that contains normal map texture.
Definition BumpMapping:158
void prepareNode(osg::Node *node)
prepare a Node for bump lighting, calling prepareGeometry() for each Geometry
void prepareGeometry(osg::Geometry *geo)
prepare a Geometry for bump lighting.
int getNormalMapTextureUnit() const
get the texture unit that contains normal map texture.
Definition BumpMapping:153
void dirtyTechniques()
force rebuilding of techniques on next traversal
Definition Effect:207
#define OSGFX_EXPORT
Definition Export:27