| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/bumpmap.h>

Public Member Functions | |
| Bumpmap (Image *heightField, Light *light, double roughness=1.0) | |
| void | setHeightField (Image *image) |
| sets the heightfield of the bumpmap | |
| Image * | getHeightField () const |
| gets the heightfield of the bumpmap | |
| Iterator< SO< Light > > * | getLight () const |
| gets the light sources which are considered when rendering the bumpmap | |
| void | appendLight (Light *light) |
| adds a light to the list of light sources which are considered when rendering the bumpmap | |
| void | removeLight (Light *light) |
| removes a light from the list of light sources which are considered when rendering the bumpmap | |
| void | setRoughness (double roughness) |
| sets the roughness of the bumpmap | |
| double | getRoughness () const |
| gets the roughness of the bumpmap | |
| VRS_TYPEINFO (Bumpmap, MonoAttribute) | |
| VRS_SERIALIZABLE (Bumpmap) | |
Static Public Member Functions | |
| static const SO < VertexAttributeMap > | getVertexAttributes () |
Protected Member Functions | |
| Bumpmap () | |
A Bumpmap attribute indicates that shapes are rendered with small-sized intensity changes which imitate a rough surface. The height changes of the surface are provided by a heightfield that is represented by a grey-scaled image, with low values indicating pits and high values indicating lands. roughness indicates the steepness of the lands and pits of the bumped surface. A roughness of 0 indicates no bumps at all; and the higher the roughness, the steeper lands and pits are. Negative values invert pits and lands. Note that changing roughness is likely to be an expensive calculation since internal textures must be possibly recalculated.
A bumpmap is evaluated with respect to one (or several) light sources. One light must be specified in the constructor, additional lights can be provided by the interface of the class.
Theoretically, the average light emission of a shape does not depend whether it is rendered with a bumpmap or not. The bumpmap only modifies local intensities. In real-time rendering this goal is currently difficult to achieve, and it is currently (2003) impossible to do in a portable way (older hardware without support for multitexturing likely can not render bumpmaps at all). For more details about implementation details and limitations for differing graphics hardware using OpenGL, see the BumpmapShaderGL comments.
| VRS::Bumpmap::Bumpmap | ( | ) | [protected] |
| void VRS::Bumpmap::setHeightField | ( | Image * | image | ) |
sets the heightfield of the bumpmap
| Image* VRS::Bumpmap::getHeightField | ( | ) | const |
gets the heightfield of the bumpmap
gets the light sources which are considered when rendering the bumpmap
| void VRS::Bumpmap::appendLight | ( | Light * | light | ) |
adds a light to the list of light sources which are considered when rendering the bumpmap
| void VRS::Bumpmap::removeLight | ( | Light * | light | ) |
removes a light from the list of light sources which are considered when rendering the bumpmap
| void VRS::Bumpmap::setRoughness | ( | double | roughness | ) |
sets the roughness of the bumpmap
| double VRS::Bumpmap::getRoughness | ( | ) | const |
gets the roughness of the bumpmap
| static const SO<VertexAttributeMap> VRS::Bumpmap::getVertexAttributes | ( | ) | [static] |
Rendering a Bumpmap requires additional per-vertex information than is normally provided, i.e., additional tangents (and, possibly, binormals). When rendering analytical VRS-shapes, these are determined automatically during the simplification process. But if you have PolygonSets to render, you must ensure that these also provide tangent information. If you create PolygonSets using the PolygonSetBuilder class, provide this VertexAttributeMap as argument of the create-functions, and you will get tangents and binormals. If you have an arbitrary PolygonSet, try PolygonSetTool::computeTangents()
| VRS::Bumpmap::VRS_TYPEINFO | ( | Bumpmap | , | |
| MonoAttribute | ||||
| ) |
| VRS::Bumpmap::VRS_SERIALIZABLE | ( | Bumpmap | ) |