SoBumpMap(3)

๐Ÿ“ฆ version 2.5.0, in fedora 43, fedora 44

๐Ÿ’… 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) const
  • SoBumpMap (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) const
  • void setNodeType (const NodeType type)
  • NodeType getNodeType (void) const
  • virtual SoNode * copy (SbBool copyconnections=0) const
  • virtual SbBool affectsState (void) const
  • virtual 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) const
  • virtual SoChildList * getChildren (void) const
  • virtual void writeInstance (SoOutput *out)
  • virtual SoNode * addToCopyDict (void) const
  • virtual void copyContents (const SoFieldContainer *from, SbBool copyconnections)
  • virtual SoFieldContainer * copyThroughConnection (void) const

๐Ÿฆ‹ Public Member Functions inherited from SoFieldContainer ๐Ÿฆ‹

  • void setToDefaults (void)
  • SbBool hasDefaultValues (void) const
  • SbBool fieldsAreEqual (const SoFieldContainer *container) const
  • void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=0)
  • SbBool set (const char *const fielddata)
  • void get (SbString &fielddata)
  • virtual int getFields (SoFieldList &l) const
  • virtual int getAllFields (SoFieldList &l) const
  • virtual SoField * getField (const SbName &name) const
  • virtual SoField * getEventIn (const SbName &name) const
  • virtual SoField * getEventOut (const SbName &name) const
  • SbBool getFieldName (const SoField *const field, SbName &name) const
  • SbBool enableNotify (const SbBool flag)
  • SbBool isNotifyEnabled (void) const
  • SbBool 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) const
  • void setUserData (void *userdata) const
  • void * getUserData (void) const

๐ŸŒˆ Public Member Functions inherited from SoBase ๐ŸŒˆ

  • void ref (void) const
  • void unref (void) const
  • void unrefNoDelete (void) const
  • int32_t getRefCount (void) const
  • void touch (void)
  • SbBool isOfType (SoType type) const
  • virtual SbName getName (void) const
  • virtual 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) const
  • SbBool 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 filename
  • SoSFImage image
  • SoSFEnum wrapS
  • SoSFEnum wrapT

๐ŸŽ€ Protected Member Functions ๐ŸŽ€

  • virtual const SoFieldData * getFieldData (void) const
  • virtual ~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) const
  • SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) const
  • void writeFooter (SoOutput *out) const
  • virtual 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 = 0
  • static 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, and wrapT
  • ๐Ÿ‘€ Referenced by: getFieldData(), and SoBumpMap()

๐ŸŒธ 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(), and image
  • ๐Ÿ‘€ 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, and wrapT

๐Ÿซถ 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(), and SoNode::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, and SoNode::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(), and SoBumpMap()

๐ŸŒธ 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(), and SoBumpMap()

โœจ 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(), and SoBumpMap()

โœจ 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(), and SoBumpMap()

๐ŸŒˆ 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