SoBumpMap(3)
๐ SoBumpMap(3) โ Library Functions Manual ๐
โจ Part 1 of 2, bestie. Part 2 is coming, so don't go anywhere. ๐
๐ NAME ๐
SoBumpMap โ the class that maps a bump map onto subsequent shapes. It's giving "I'm about to make everything after me look bumpy and textured" energy. No cap.
โจ SYNOPSIS โจ
#include <Inventor/nodes/SoBumpMap.h>
Inherits SoNode.
๐ซถ Public Types ๐ซถ
enum Wrap { REPEAT = SoTextureImageElement::REPEAT, CLAMP = SoTextureImageElement::CLAMP }
๐ธ Public Types inherited from SoNode ๐ธ
enum NodeType { INVENTOR = 0x0000, VRML1 = 0x0001, VRML2 = 0x0002,
INVENTOR_1 = 0x0004, INVENTOR_2_0 = 0x0008, INVENTOR_2_1 = 0x0010,
INVENTOR_2_5 = 0x0020, INVENTOR_2_6 = 0x0040, COIN_1_0 = 0x0080,
COIN_2_0 = 0x0100, EXTENSION = 0x0200, COIN_2_2 = 0x0400, COIN_2_3 =
0x0800, COIN_2_4 = 0x1000, INVENTOR_5_0 = 0x2000, COIN_2_5 = 0x4000
}
๐ Public Member Functions ๐
virtual SoType getTypeId (void) constSoBumpMap (void)virtual void doAction (SoAction *action)virtual void GLRender (SoGLRenderAction *action)virtual void callback (SoCallbackAction *action)virtual void rayPick (SoRayPickAction *action)
๐ Public Member Functions inherited from SoNode ๐
void setOverride (const SbBool state)SbBool isOverride (void) constvoid setNodeType (const NodeType type)NodeType getNodeType (void) constvirtual SoNode * copy (SbBool copyconnections=0) constvirtual SbBool affectsState (void) constvirtual void GLRenderBelowPath (SoGLRenderAction *action)virtual void GLRenderInPath (SoGLRenderAction *action)virtual void GLRenderOffPath (SoGLRenderAction *action)virtual void getBoundingBox (SoGetBoundingBoxAction *action)virtual void getMatrix (SoGetMatrixAction *action)virtual void handleEvent (SoHandleEventAction *action)virtual void pick (SoPickAction *action)virtual void search (SoSearchAction *action)virtual void write (SoWriteAction *action)virtual void audioRender (SoAudioRenderAction *action)virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)virtual void grabEventsSetup (void)virtual void grabEventsCleanup (void)virtual void startNotify (void)uint32_t getNodeId (void) constvirtual SoChildList * getChildren (void) constvirtual void writeInstance (SoOutput *out)virtual SoNode * addToCopyDict (void) constvirtual void copyContents (const SoFieldContainer *from, SbBool copyconnections)virtual SoFieldContainer * copyThroughConnection (void) const
๐ฆ Public Member Functions inherited from SoFieldContainer ๐ฆ
void setToDefaults (void)SbBool hasDefaultValues (void) constSbBool fieldsAreEqual (const SoFieldContainer *container) constvoid copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=0)SbBool set (const char *const fielddata)void get (SbString &fielddata)virtual int getFields (SoFieldList &l) constvirtual int getAllFields (SoFieldList &l) constvirtual SoField * getField (const SbName &name) constvirtual SoField * getEventIn (const SbName &name) constvirtual SoField * getEventOut (const SbName &name) constSbBool getFieldName (const SoField *const field, SbName &name) constSbBool enableNotify (const SbBool flag)SbBool isNotifyEnabled (void) constSbBool set (const char *fielddata, SoInput *in)void get (SbString &fielddata, SoOutput *out)virtual SbBool validateNewFieldValue (SoField *field, void *newval)virtual void addWriteReference (SoOutput *out, SbBool isfromfield=0)SbBool getIsBuiltIn (void) constvoid setUserData (void *userdata) constvoid * getUserData (void) const
๐ Public Member Functions inherited from SoBase ๐
void ref (void) constvoid unref (void) constvoid unrefNoDelete (void) constint32_t getRefCount (void) constvoid touch (void)SbBool isOfType (SoType type) constvirtual SbName getName (void) constvirtual void setName (const SbName &newname)void addAuditor (void *const auditor, const SoNotRec::Type type)void removeAuditor (void *const auditor, const SoNotRec::Type type)const SoAuditorList & getAuditors (void) constSbBool shouldWrite (void)void assertAlive (void) const
๐ Static Public Member Functions ๐
static SoType getClassTypeId (void)static void initClass (void)static SbBool readImage (const SbString &fname, int &w, int &h, int &nc, unsigned char *&bytes)
โญ Static Public Member Functions inherited from SoNode โญ
static uint32_t getCompatibilityTypes (const SoType &nodetype)static SoType getClassTypeId (void)static SoNode * getByName (const SbName &name)static int getByName (const SbName &name, SoNodeList &l)static void initClass (void)static void initClasses (void)static uint32_t getNextNodeId (void)static int getActionMethodIndex (const SoType type)static void getBoundingBoxS (SoAction *action, SoNode *node)static void GLRenderS (SoAction *action, SoNode *node)static void callbackS (SoAction *action, SoNode *node)static void getMatrixS (SoAction *action, SoNode *node)static void handleEventS (SoAction *action, SoNode *node)static void pickS (SoAction *action, SoNode *node)static void rayPickS (SoAction *action, SoNode *node)static void searchS (SoAction *action, SoNode *node)static void writeS (SoAction *action, SoNode *node)static void audioRenderS (SoAction *action, SoNode *node)static void getPrimitiveCountS (SoAction *action, SoNode *node)
๐ซ Static Public Member Functions inherited from SoFieldContainer ๐ซ
static void initClass (void)static SoType getClassTypeId (void)static void initCopyDict (void)static void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy)static SoFieldContainer * checkCopy (const SoFieldContainer *orig)static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections)static void copyDone (void)
๐ซง Static Public Member Functions inherited from SoBase ๐ซง
static void initClass (void)static SoType getClassTypeId (void)static void addName (SoBase *const base, const char *const name)static void removeName (SoBase *const base, const char *const name)static void incrementCurrentWriteCounter (void)static void decrementCurrentWriteCounter (void)static SoBase * getNamedBase (const SbName &name, SoType type)static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type)static SbBool read (SoInput *in, SoBase *&base, SoType expectedtype)static void setInstancePrefix (const SbString &c)static void setTraceRefs (SbBool trace)static SbBool getTraceRefs (void)static SbBool connectRoute (SoInput *in, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname)static SbBool readRoute (SoInput *in)
๐ Public Attributes ๐
SoSFString filenameSoSFImage imageSoSFEnum wrapSSoSFEnum wrapT
๐ Protected Member Functions ๐
virtual const SoFieldData * getFieldData (void) constvirtual ~SoBumpMap ()virtual SbBool readInstance (SoInput *in, unsigned short flags)virtual void notify (SoNotList *list)
๐ง Protected Member Functions inherited from SoNode ๐ง
SoNode (void)virtual ~SoNode ()
๐ Protected Member Functions inherited from SoFieldContainer ๐
SoFieldContainer (void)~SoFieldContainer ()
๐ฆ Protected Member Functions inherited from SoBase ๐ฆ
SoBase (void)virtual ~SoBase ()virtual void destroy (void)SbBool hasMultipleWriteRefs (void) constSbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) constvoid writeFooter (SoOutput *out) constvirtual const char * getFileFormatName (void) const
๐ฎ Static Protected Member Functions ๐ฎ
static const SoFieldData ** getFieldDataPtr (void)
๐ธ Static Protected Member Functions inherited from SoNode ๐ธ
static const SoFieldData ** getFieldDataPtr (void)static void setNextActionMethodIndex (int index)static int getNextActionMethodIndex (void)static void incNextActionMethodIndex (void)static void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask)
๐ Static Protected Member Functions inherited from SoBase ๐
static uint32_t getCurrentWriteCounter (void)static void staticDataLock (void)static void staticDataUnlock (void)
๐ซถ Additional Inherited Members ๐ซถ
๐ Protected Types inherited from SoBase ๐
enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }
๐ Protected Attributes inherited from SoNode ๐
uint32_t uniqueId
๐ Protected Attributes inherited from SoFieldContainer ๐
SbBool isBuiltIn
๐ Static Protected Attributes inherited from SoNode ๐
static uint32_t nextUniqueId = 0static int nextActionMethodIndex = 0
๐ฆ Detailed Description ๐ฆ
Okay so SoBumpMap does exactly what the name says: it maps a bump map onto every shape that comes after it. It's giving "I'm about to make your surfaces look textured" energy. ๐
SoBumpMap has support for two types of maps. If the image is a three component (RGB) image, it gets treated as a normal map. In that case, the red image component equals the X normal component, green equals Y, and blue is Z. There's a nice introduction about bump mapping and normal maps at http://www.paulsprojects.net/tutorials/simplebump/simplebump.html โ go look, bestie.
If the image is a grayscale image, it gets treated as a height map, and it's automatically converted to a normal map. So you don't have to do it yourself. Slay.
For bump mapping to work with extension nodes for Coin, the SoShape::generatePrimitives() method must be correctly implemented for the shape. This is needed since tangent space coordinates need to be calculated for each vertex in the shape. All shape nodes which are a standard part of Coin meet this criteria. So if you're rolling your own extension shape, that's on you, bestie.
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. So like, no crash, but also no bumps. Sad. ๐ญ
GL_ARB_vertex_program and GL_ARB_fragment_program are required to get specular lighting on the bumps. If these extensions are not available, the bumps will be rendered with diffuse lighting only. So you still get something, just not the shiny. โจ
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).
๐ FILE FORMAT/DEFAULTS ๐
BumpMap {
filename ""
image 0 0 0
wrapS REPEAT
wrapT REPEAT
}
โณ Since โณ
Coin 2.2
๐ Member Enumeration Documentation ๐
๐ enum SoBumpMap::Wrap ๐
Enumeration of wrapping strategies which can be used when the bump map doesn't cover the full extent of the geometry. Basically: what happens at the edges, bestie?
Enumerator
REPEATโ Repeat bump map when coordinate is not between 0 and 1. It's giving infinite pattern energy.CLAMPโ Clamp coordinate between 0 and 1. No repeating, just vibes.
๐ Constructor & Destructor Documentation ๐
โจ SoBumpMap::SoBumpMap (void) โจ
okay so this is the Constructor, bestie. it builds the thing. iconic behavior honestly.
- ๐ References:
CLAMP,filename,image,REPEAT,SoBumpMap(),wrapS, andwrapT - ๐ Referenced by:
getFieldData(), andSoBumpMap()
๐ธ SoBumpMap::~SoBumpMap () [protected], [virtual] ๐ธ
the Destructor, aka the goodbye moment ๐ฅบ. it frees up internal resources used to store texture image data. so like, it cleans up after itself. very responsible of it, no notes.
๐ฆ Member Function Documentation ๐ฆ
๐ SoType SoBumpMap::getTypeId (void) const [virtual] ๐
this one returns the type identification of an object derived from a class inheriting SoBase. it's what makes run-time type checking and "downward" casting possible. lowkey the backbone of the whole type system fr fr.
Usage example, straight up, no edits:
void foo(SoNode * node)
{
if (node->getTypeId() == SoFile::getClassTypeId()) {
SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type
}
else if (node->getTypeId().isOfType(SoGroup::getClassTypeId())) {
SoGroup * group = (SoGroup *)node; // safe downward cast, knows the type
}
}
so for application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: bestie, this method needs to be overridden in all 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 Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on. the macros are doing the heavy lifting, we're just living in their world ๐
for more info on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.
Implements SoBase.
๐ const SoFieldData * SoBumpMap::getFieldData (void) const [protected], [virtual] ๐
Returns a pointer to the class-wide field data storage object for this instance. and if there are no fields present, it returns NULL. that's it, that's the whole vibe. short and efficient, we respect it.
- โป๏ธ Reimplemented from
SoFieldContainer - ๐ References:
SoBumpMap()
๐ฅ void SoBumpMap::doAction (SoAction * action) [virtual] ๐ฅ
This function performs the typical operation of a node for any action. the generalist. the main character. it does the thing for whatever action comes knocking ๐ซ
- โป๏ธ Reimplemented from
SoNode - ๐ References:
SoAction::getState(), andimage - ๐ Referenced by:
rayPick()
๐ void SoBumpMap::GLRender (SoGLRenderAction * action) [virtual] ๐
Action method for the SoGLRenderAction. this one gets called during rendering traversals. any node that influences the rendering state in any way, or that wants to throw geometry primitives at OpenGL, overrides this method. so yeah, this is where the pixels get their moment โจ
- โป๏ธ Reimplemented from
SoNode - ๐ References:
SoGLRenderAction::getCacheContext(),SoAction::getState(),image,SoDebugError::postWarning(),wrapS, andwrapT
๐ซถ void SoBumpMap::callback (SoCallbackAction * action) [virtual] ๐ซถ
Action method for SoCallbackAction. it simply updates the state according to how the node behaves for the render action, so the application programmer can use the SoCallbackAction for extracting information about the scene graph. very "let me just peek at the scene graph real quick" energy, and honestly? valid.
Reimplemented from SoNode.
๐ void SoBumpMap::rayPick (SoRayPickAction * action) [virtual] ๐
Action method for SoRayPickAction. it checks the ray specification of the action and tests for intersection with the data of the node. and heads up โ nodes influencing relevant state variables for how picking is done also overrides this method. iykyk.
- โป๏ธ Reimplemented from
SoNode - ๐ References:
doAction()
๐ SbBool SoBumpMap::readImage (const SbString & fname, int & w, int & h, int & nc, unsigned char *& bytes) [static] ๐
okay bestie sit down for this one. it is not implemented. it was added to the API by mistake. and it will be removed in Coin 3. so likeโฆ do not use it. do not pass go. do not collect $200. it's giving "oops" ๐
๐ง SbBool SoBumpMap::readInstance (SoInput * in, unsigned short flags) [protected], [virtual] ๐ง
This method is mainly intended for internal use during file import operations.
it reads a definition of an instance from the input stream in. the input stream state points to the start of a serialized / persistant representation of an instance of this class type.
TRUE or FALSE is returned, depending on if the instantiation and configuration of the new object of this class type went ok or not. and here's the important part: the import process should be robust and handle corrupted input streams by returning FALSE. so like, no crashing out, just a polite no thank you ๐
flags is used internally during binary import when reading user extension nodes, group nodes or engines.
- โป๏ธ Reimplemented from
SoNode - ๐ References:
filename,SoReadError::post(), andSoNode::readInstance()
๐ void SoBumpMap::notify (SoNotList * l) [protected], [virtual] ๐
Notifies all auditors for this instance when changes are made. the group chat ping of the Coin world โ everyone who needs to know, knows ๐ฃ
- โป๏ธ Reimplemented from
SoNode - ๐ References:
filename,SoNotList::getLastField(),image, andSoNode::notify()
โญ Member Data Documentation โญ
๐ SoSFString SoBumpMap::filename ๐
Bump map (or normal map) filename, referring to a file on disk in a supported image bitmap format. See SoBumpMap::filename for more information. (yes it references itself, she's self-aware, we love a meta queen ๐
)
- ๐ Referenced by:
notify(),readInstance(), andSoBumpMap()
๐ธ SoSFImage SoBumpMap::image ๐ธ
Inline image data. Defaults to contain an empty bump map. so it starts empty and it's just vibing until you give it something.
- ๐ Referenced by:
doAction(),GLRender(),notify(), andSoBumpMap()
โจ SoSFEnum SoBumpMap::wrapS โจ
Wrapping strategy for the S coordinate when the bump map is narrower than the object to map onto.
Default value is SoBumpMap::REPEAT.
- ๐ Referenced by:
GLRender(), andSoBumpMap()
โจ SoSFEnum SoBumpMap::wrapT โจ
Wrapping strategy for the T coordinate when the bump map is shorter than the object to map onto.
Default value is SoBumpMap::REPEAT.
- ๐ Referenced by:
GLRender(), andSoBumpMap()
๐ Author ๐
Generated automatically by Doxygen for Coin from the source code.
and that's a wrap on SoBumpMap(3), bestie ๐๐ this page is Coin, Version 2.5.0, dated SoBumpMap(3) โ go forth and bump-map responsibly, mwah ๐
โจ
๐ฆ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 ยท GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 ยท GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 ยท GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms