.TH "SoBumpMap" 3 "Sat Oct 12 2013" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoBumpMap \- .PP The \fBSoBumpMap\fP class is used to map a bump map onto subsequent shapes\&. .PP \fBSoBumpMap\fP has support for two types of maps\&. If the image is a three component (RGB) image, it will be treated as a normal map, where the red image component equals the X normal component, green equals Y, and blue is Z\&. See http://www.paulsprojects.net/tutorials/simplebump/simplebump.html for a nice introduction about bump mapping and normal maps\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoNode\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBWrap\fP { \fBREPEAT\fP = SoMultiTextureImageElement::REPEAT, \fBCLAMP\fP = SoMultiTextureImageElement::CLAMP }" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .RI "\fIReturns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. \fP" .ti -1c .RI "\fBSoBumpMap\fP (void)" .br .ti -1c .RI "virtual void \fBdoAction\fP (\fBSoAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRender\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBcallback\fP (\fBSoCallbackAction\fP *action)" .br .ti -1c .RI "virtual void \fBrayPick\fP (\fBSoRayPickAction\fP *action)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .RI "\fIThis static method returns the \fBSoType\fP object associated with objects of this class\&. \fP" .ti -1c .RI "static void \fBinitClass\fP (void)" .br .RI "\fISets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system\&. \fP" .in -1c .SS "Public Attributes" .in +1c .ti -1c .RI "\fBSoSFString\fP \fBfilename\fP" .br .ti -1c .RI "\fBSoSFImage\fP \fBimage\fP" .br .ti -1c .RI "\fBSoSFEnum\fP \fBwrapS\fP" .br .ti -1c .RI "\fBSoSFEnum\fP \fBwrapT\fP" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const \fBSoFieldData\fP * \fBgetFieldData\fP (void) const " .br .ti -1c .RI "virtual \fB~SoBumpMap\fP ()" .br .ti -1c .RI "virtual SbBool \fBreadInstance\fP (\fBSoInput\fP *in, unsigned short flags)" .br .ti -1c .RI "virtual void \fBnotify\fP (\fBSoNotList\fP *list)" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static const \fBSoFieldData\fP ** \fBgetFieldDataPtr\fP (void)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoBumpMap\fP class is used to map a bump map onto subsequent shapes\&. .PP \fBSoBumpMap\fP has support for two types of maps\&. If the image is a three component (RGB) image, it will be treated as a normal map, where the red image component equals the X normal component, green equals Y, and blue is Z\&. See http://www.paulsprojects.net/tutorials/simplebump/simplebump.html for a nice introduction about bump mapping and normal maps\&. If the image is a grayscale image, it will be treated as a height map, and automatically converted to a normal map\&. .PP For bump mapping to work with extension nodes for Coin, the \fBSoShape::generatePrimitives()\fP method must be correctly implemented for the shape\&. This is needed since tangent space coordinates needs to be calculated for each vertex in the shape\&. All shape nodes which are a standard part of Coin meets this criteria\&. .PP Bump mapping in Coin requires OpenGL 1\&.3, or the following OpenGL extensions: GL_ARB_multitexture, GL_ARB_texture_cube_map, GL_ARB_texture_env_combine and GL_ARB_texture_env_dot3 (or the corresponding EXT extensions)\&. If the run-time system doesn't meet these requirements, Coin will post a warning and the bump map will simply be ignored\&. .PP GL_ARB_vertex_program and GL_ARB_fragment_program is required to get specular lighting on the bumps\&. If these extensions are not available, the bumps will be rendered with diffuse lighting only\&. .PP Bump mapped objects will be rendered with multiple rendering passes\&. One extra pass per light source for diffuse only bumps, and two extra passes per light source for diffuse and specular bumps\&. You can turn off specular lighting on the bumps by setting specularColor to (0\&.0, 0\&.0, 0\&.0)\&. .PP \fBFILE FORMAT/DEFAULTS:\fP .PP .nf BumpMap { filename '' image 0 0 0 wrapS REPEAT wrapT REPEAT } .fi .PP .PP \fBSince:\fP .RS 4 Coin 2\&.2 .RE .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBSoBumpMap::Wrap\fP" Enumeration of wrapping strategies which can be used when the bump map doesn't cover the full extent of the geometry\&. .PP \fBEnumerator: \fP .in +1c .TP \fB\fIREPEAT \fP\fP Repeat bump map when coordinate is not between 0 and 1\&. .TP \fB\fICLAMP \fP\fP Clamp coordinate between 0 and 1\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoBumpMap::SoBumpMap (void)" Constructor\&. .SS "SoBumpMap::~SoBumpMap ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. Frees up internal resources used to store texture image data\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoBumpMap::getTypeId (void) const\fC [virtual]\fP" .PP Returns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. Usage example: .PP .PP .nf void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } } .fi .PP .PP For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in \fIall\fP subclasses\&. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance \fBInventor/nodes/SoSubNode\&.h\fP (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine\&.h (for engine classes) and so on\&. .PP For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups\&. .PP Implements \fBSoBase\fP\&. .SS "const \fBSoFieldData\fP ** SoBumpMap::getFieldDataPtr (void)\fC [static]\fP, \fC [protected]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .PP Reimplemented from \fBSoNode\fP\&. .SS "const \fBSoFieldData\fP * SoBumpMap::getFieldData (void) const\fC [protected]\fP, \fC [virtual]\fP" Returns a pointer to the class-wide field data storage object for this instance\&. If no fields are present, returns \fCNULL\fP\&. .PP Reimplemented from \fBSoFieldContainer\fP\&. .SS "void SoBumpMap::doAction (\fBSoAction\fP *action)\fC [virtual]\fP" This function performs the typical operation of a node for any action\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoBumpMap::GLRender (\fBSoGLRenderAction\fP *action)\fC [virtual]\fP" Action method for the \fBSoGLRenderAction\fP\&. .PP This is called during rendering traversals\&. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoBumpMap::callback (\fBSoCallbackAction\fP *action)\fC [virtual]\fP" Action method for \fBSoCallbackAction\fP\&. .PP Simply updates the state according to how the node behaves for the render action, so the application programmer can use the \fBSoCallbackAction\fP for extracting information about the scene graph\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoBumpMap::rayPick (\fBSoRayPickAction\fP *action)\fC [virtual]\fP" Action method for \fBSoRayPickAction\fP\&. .PP Checks the ray specification of the \fIaction\fP and tests for intersection with the data of the node\&. .PP Nodes influencing relevant state variables for how picking is done also overrides this method\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "SbBool SoBumpMap::readInstance (\fBSoInput\fP *in, unsigned shortflags)\fC [protected]\fP, \fC [virtual]\fP" This method is mainly intended for internal use during file import operations\&. .PP It reads a definition of an instance from the input stream \fIin\fP\&. The input stream state points to the start of a serialized / persistant representation of an instance of this class type\&. .PP \fCTRUE\fP or \fCFALSE\fP is returned, depending on if the instantiation and configuration of the new object of this class type went ok or not\&. The import process should be robust and handle corrupted input streams by returning \fCFALSE\fP\&. .PP \fIflags\fP is used internally during binary import when reading user extension nodes, group nodes or engines\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoBumpMap::notify (\fBSoNotList\fP *l)\fC [protected]\fP, \fC [virtual]\fP" Notifies all auditors for this instance when changes are made\&. .PP Reimplemented from \fBSoNode\fP\&. .SH "Member Data Documentation" .PP .SS "\fBSoSFString\fP SoBumpMap::filename" Bump map (or normal map) filename, referring to a file on disk in a supported image bitmap format\&. See \fBSoBumpMap::filename\fP for more information\&. .SS "\fBSoSFImage\fP SoBumpMap::image" Inline image data\&. Defaults to contain an empty bump map\&. .SS "\fBSoSFEnum\fP SoBumpMap::wrapS" Wrapping strategy for the S coordinate when the bump map is narrower than the object to map onto\&. .PP Default value is \fBSoBumpMap::REPEAT\fP\&. .SS "\fBSoSFEnum\fP SoBumpMap::wrapT" Wrapping strategy for the T coordinate when the bump map is shorter than the object to map onto\&. .PP Default value is \fBSoBumpMap::REPEAT\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.