SoVRMLMaterial(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

okay bestie, welcome to SoVRMLMaterial(3) from the Coin manual πŸ’– this one is a whole saga so it comes in two parts, and this is part 1. grab a snack πŸ“ and let's go.

πŸ“› NAME

SoVRMLMaterial β€” the class used to assign a material to geometry. yes fr, it's the glow-up department for your shapes. ✨

🫢 SYNOPSIS

#include <Inventor/VRMLnodes/SoVRMLMaterial.h>

Inherits SoNode. πŸ‘‘


πŸŽ€ Public Member Functions

  • virtual SoType getTypeId (void) const β€” hands you the SoType for this object πŸ¦‹
  • SoVRMLMaterial (void) β€” the constructor, makes you a brand new material node πŸ’…
  • virtual void doAction (SoAction *action) β€” the action-dispatch override for this node πŸ”
  • virtual void GLRender (SoGLRenderAction *action) β€” the GL render override 🎨
  • virtual void callback (SoCallbackAction *action) β€” the callback-action override πŸ“ž

🌸 Public Member Functions inherited from SoNode

  • void setOverride (const SbBool state) β€” flip override mode on or off
  • SbBool isOverride (void) const β€” are we in override mode rn?
  • void setNodeType (const NodeType type) β€” set the node type
  • NodeType getNodeType (void) const β€” get the node type
  • virtual SoNode * copy (SbBool copyconnections=FALSE) const β€” make a copy, and you can choose whether connections come along
  • virtual SbBool affectsState (void) const β€” does this thing touch the state?
  • virtual void GLRenderBelowPath (SoGLRenderAction *action) β€” the below-path render traversal
  • virtual void GLRenderInPath (SoGLRenderAction *action) β€” the in-path render traversal
  • virtual void GLRenderOffPath (SoGLRenderAction *action) β€” the off-path render traversal
  • virtual void getBoundingBox (SoGetBoundingBoxAction *action) β€” bounding box action
  • virtual void getMatrix (SoGetMatrixAction *action) β€” matrix action
  • virtual void handleEvent (SoHandleEventAction *action) β€” event handling action
  • virtual void pick (SoPickAction *action) β€” pick action
  • virtual void rayPick (SoRayPickAction *action) β€” ray pick action
  • virtual void search (SoSearchAction *action) β€” search action
  • virtual void write (SoWriteAction *action) β€” write action
  • virtual void audioRender (SoAudioRenderAction *action) β€” audio render action
  • virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action) β€” primitive count action
  • virtual void grabEventsSetup (void) β€” event grabbing setup
  • virtual void grabEventsCleanup (void) β€” event grabbing cleanup
  • virtual void startNotify (void) β€” kick off notification
  • virtual void notify (SoNotList *l) β€” do the notification
  • SbUniqueId getNodeId (void) const β€” the node's unique id πŸ†”
  • virtual SoChildList * getChildren (void) const β€” the child list
  • virtual void writeInstance (SoOutput *out) β€” write out this instance
  • virtual SoNode * addToCopyDict (void) const β€” register yourself in the copy dictionary
  • virtual void copyContents (const SoFieldContainer *from, SbBool copyconnections) β€” copy contents over from another field container
  • virtual SoFieldContainer * copyThroughConnection (void) const β€” copy through a connection

πŸ’œ Public Member Functions inherited from SoFieldContainer

  • void setToDefaults (void) β€” reset everything to defaults
  • SbBool hasDefaultValues (void) const β€” are all the values still default?
  • SbBool fieldsAreEqual (const SoFieldContainer *container) const β€” do our fields match theirs?
  • void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=FALSE) β€” steal their field values, optionally including connections
  • SbBool set (const char *const fielddata) β€” set from field data
  • void get (SbString &fielddata) β€” get the field data out
  • virtual int getFields (SoFieldList &l) const β€” collect the fields into a list
  • virtual int getAllFields (SoFieldList &l) const β€” collect all the fields into a list
  • virtual SoField * getField (const SbName &name) const β€” grab a field by name
  • virtual SoField * getEventIn (const SbName &name) const β€” grab an event-in by name
  • virtual SoField * getEventOut (const SbName &name) const β€” grab an event-out by name
  • SbBool getFieldName (const SoField *const field, SbName &name) const β€” look up a field's name
  • SbBool enableNotify (const SbBool flag) β€” turn notification on or off
  • SbBool isNotifyEnabled (void) const β€” is notification on?
  • SbBool set (const char *fielddata, SoInput *input) β€” the other set, this time with an SoInput
  • void get (SbString &fielddata, SoOutput *out) β€” the other get, this time with an SoOutput
  • virtual SbBool validateNewFieldValue (SoField *field, void *newval) β€” check whether a new value is valid
  • virtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE) β€” add a write reference
  • SbBool getIsBuiltIn (void) const β€” is this built in?
  • virtual void getFieldsMemorySize (size_t &managed, size_t &unmanaged) const β€” report field memory sizes
  • void setUserData (void *userdata) const β€” stash some user data
  • void * getUserData (void) const β€” get that user data back

πŸ¦‹ Public Member Functions inherited from SoBase

  • void ref (void) const β€” bump the ref count
  • void unref (void) const β€” drop the ref count
  • void unrefNoDelete (void) const β€” drop the ref count without deleting
  • int32_t getRefCount (void) const β€” what's the ref count rn?
  • void touch (void) β€” touch it, make it notify
  • SbBool isOfType (SoType type) const β€” Returns TRUE if the type of this object is either of the same type or inherited from type. 🫢
  • virtual SbName getName (void) const β€” get the name
  • virtual void setName (const SbName &newname) β€” set the name
  • void addAuditor (void *const auditor, const SoNotRec::Type type) β€” add an auditor
  • void removeAuditor (void *const auditor, const SoNotRec::Type type) β€” remove an auditor
  • const SoAuditorList & getAuditors (void) const β€” get the auditor list
  • SbBool shouldWrite (void) β€” should this be written out?
  • void assertAlive (void) const β€” assert that it's still alive

✨ Static Public Member Functions

  • static SoType getClassTypeId (void) β€” the class-level SoType 🌟
  • static void initClass (void) β€” sets up class init πŸŽ€

🌈 Static Public Member Functions inherited from SoNode

  • static uint32_t getCompatibilityTypes (const SoType &nodetype) β€” compatibility types for a node type
  • static SoType getClassTypeId (void) β€” the class SoType
  • static SoNode * getByName (const SbName &name) β€” find a node by name
  • static int getByName (const SbName &name, SoNodeList &l) β€” find nodes by name into a list
  • static void initClass (void) β€” Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. πŸ’«
  • static void initClasses (void) β€” set up all the classes
  • static SbUniqueId getNextNodeId (void) β€” the next node id
  • static int getActionMethodIndex (const SoType type) β€” action method index for a type
  • static void getBoundingBoxS (SoAction *action, SoNode *node) β€” static bounding box helper
  • static void GLRenderS (SoAction *action, SoNode *node) β€” static GL render helper
  • static void callbackS (SoAction *action, SoNode *node) β€” static callback helper
  • static void getMatrixS (SoAction *action, SoNode *node) β€” static matrix helper
  • static void handleEventS (SoAction *action, SoNode *node) β€” static event helper
  • static void pickS (SoAction *action, SoNode *node) β€” static pick helper
  • static void rayPickS (SoAction *action, SoNode *node) β€” static ray pick helper
  • static void searchS (SoAction *action, SoNode *node) β€” static search helper
  • static void writeS (SoAction *action, SoNode *node) β€” static write helper
  • static void audioRenderS (SoAction *action, SoNode *node) β€” static audio render helper
  • static void getPrimitiveCountS (SoAction *action, SoNode *node) β€” static primitive count helper

🧚 Static Public Member Functions inherited from SoFieldContainer

  • static void initClass (void) β€” Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. πŸ’«
  • static SoType getClassTypeId (void) β€” This static method returns the SoType object associated with objects of this class. πŸ”Ž
  • static void cleanupClass (void) β€” clean the class up
  • static void initCopyDict (void) β€” init the copy dictionary
  • static void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy) β€” add a copy to the dictionary
  • static SoFieldContainer * checkCopy (const SoFieldContainer *orig) β€” check the copy
  • static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections) β€” find a copy, with or without connections
  • static void copyDone (void) β€” copying is done

πŸ’– Static Public Member Functions inherited from SoBase

  • static void initClass (void) β€” Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. πŸ’«
  • static SoType getClassTypeId (void) β€” This static method returns the SoType object associated with objects of this class. πŸ”Ž
  • static void addName (SoBase *const base, const char *const name) β€” register a name
  • static void removeName (SoBase *const base, const char *const name) β€” unregister a name
  • static void incrementCurrentWriteCounter (void) β€” bump the write counter
  • static void decrementCurrentWriteCounter (void) β€” drop the write counter
  • static SoBase * getNamedBase (const SbName &name, SoType type) β€” find a named base
  • static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type) β€” find named bases into a list
  • static SbBool read (SoInput *input, SoBase *&base, SoType expectedtype) β€” read one in
  • static void setInstancePrefix (const SbString &c) β€” set the instance prefix
  • static void setTraceRefs (SbBool trace) β€” turn ref tracing on or off
  • static SbBool getTraceRefs (void) β€” is ref tracing on?
  • static SbBool connectRoute (SoInput *input, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname) β€” connect a route between two nodes and fields πŸ”—
  • static SbBool readRoute (SoInput *input) β€” read a route

πŸ“ Public Attributes

  • SoSFColor diffuseColor β€” the diffuse color 🎨
  • SoSFFloat ambientIntensity β€” the ambient intensity
  • SoSFColor specularColor β€” the specular color ✨
  • SoSFColor emissiveColor β€” the emissive color
  • SoSFFloat shininess β€” the shininess πŸ’Ž
  • SoSFFloat transparency β€” the transparency πŸ«₯

πŸ‘‘ Protected Member Functions

  • virtual const SoFieldData * getFieldData (void) const β€” get the field data
  • virtual ~SoVRMLMaterial () β€” the destructor πŸ’€

🌸 Protected Member Functions inherited from SoNode

  • SoNode (void) β€” the node constructor
  • virtual ~SoNode () β€” the node destructor
  • virtual SbBool readInstance (SoInput *in, unsigned short flags) β€” read an instance

πŸ’œ Protected Member Functions inherited from SoFieldContainer

  • SoFieldContainer (void) β€” the field container constructor
  • virtual ~SoFieldContainer () β€” the field container destructor

πŸ¦‹ Protected Member Functions inherited from SoBase

  • SoBase (void) β€” the base constructor
  • virtual ~SoBase () β€” the base destructor
  • virtual void destroy (void) β€” destroy it
  • SbBool hasMultipleWriteRefs (void) const β€” got multiple write refs?
  • SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) const β€” write the header
  • void writeFooter (SoOutput *out) const β€” write the footer
  • virtual const char * getFileFormatName (void) const β€” the file format name
  • virtual SoNotRec createNotRec (void) β€” create a notification record

πŸ’… Static Protected Member Functions

  • static const SoFieldData ** getFieldDataPtr (void) β€” pointer to the field data pointer

🌈 Static Protected Member Functions inherited from SoNode

  • static const SoFieldData ** getFieldDataPtr (void) β€” pointer to the field data pointer
  • static void setNextActionMethodIndex (int index) β€” set the next action method index
  • static int getNextActionMethodIndex (void) β€” get the next action method index
  • static void incNextActionMethodIndex (void) β€” increment the next action method index
  • static void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask) β€” set compatibility types

🧚 Static Protected Member Functions inherited from SoBase

  • static uint32_t getCurrentWriteCounter (void) β€” get the current write counter
  • static void staticDataLock (void) β€” lock the static data
  • static void staticDataUnlock (void) β€” unlock the static data

✨ Additional Inherited Members

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,
    COIN_3_0 = 0x8000, INVENTOR_6_0 = 0x10000, COIN_4_0 = 0x20000 }

Protected Types inherited from SoBase

enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }

Protected Attributes inherited from SoNode

SbUniqueId uniqueId

Protected Attributes inherited from SoFieldContainer

SbBool isBuiltIn

Static Protected Attributes inherited from SoNode

static SbUniqueId nextUniqueId = 1
static int nextActionMethodIndex = 0

and that's the whole inheritance tree laid out bestie, every single one of them accounted for 🫢 part 2 is right behind this one, don't go anywhere πŸ‘€

🌈 Detailed Description 🌈

Okay bestie, listen up πŸ’– The SoVRMLMaterial class is what you use to assign a material to geometry. That's the whole vibe. You want your shape to look like shiny plastic or matte clay or a glowing alien orb? This is the node that makes it happen. Periodt.

The detailed class documentation is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997). It is copyright The Web3D Consortium, and is used by permission of the Consortium:

Material {
  exposedField SFFloat ambientIntensity  0.2         # [0,1]
  exposedField SFColor diffuseColor      0.8 0.8 0.8 # [0,1]
  exposedField SFColor emissiveColor     0 0 0       # [0,1]
  exposedField SFFloat shininess         0.2         # [0,1]
  exposedField SFColor specularColor     0 0 0       # [0,1]
  exposedField SFFloat transparency      0           # [0,1]
}

The Material node specifies surface material properties for associated geometry nodes, and it gets used by the VRML lighting equations during rendering. Like, when the renderer is figuring out what colour a pixel should be, it's lowkey consulting this node the whole time. ✨

Subclause 4.14, Lighting model (http://www.web3d.org/documents/specifications/14772/V2.0/part1/concepts.html#4.14) contains a detailed description of the VRML lighting model equations β€” go read it if you want the actual math, iykyk.

All of the fields in the Material node range from 0.0 to 1.0. The fields in the Material node determine how light reflects off an object to create colour:

  • The ambientIntensity field specifies how much ambient light from light sources this surface shall reflect. Ambient light is omnidirectional and depends only on the number of light sources, not their positions with respect to the surface. Ambient colour is calculated as ambientIntensity Γ— diffuseColor. 🫢
  • The diffuseColor field reflects all VRML light sources depending on the angle of the surface with respect to the light source. The more directly the surface faces the light, the more diffuse light reflects. It's giving "the sun is literally in my face right now." β˜€οΈ
  • The emissiveColor field models "glowing" objects. This can be useful for displaying pre-lit models (where the light energy of the room is computed explicitly), or for displaying scientific data. Main character glow-up energy. πŸ‘‘
  • The specularColor and shininess fields determine the specular highlights (e.g., the shiny spots on an apple). When the angle from the light to the surface is close to the angle from the surface to the viewer, the specularColor is added to the diffuse and ambient colour calculations. Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights. Glossy vs. matte, your choice bestie πŸ’…
  • The transparency field specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque. Ghost mode: activated. πŸ‘»

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

SoVRMLMaterial::SoVRMLMaterial (void )

Constructor. Making a brand new one, no cap.

SoVRMLMaterial::~SoVRMLMaterial () [protected], [virtual]

Destructor. It's protected and virtual, so it's doing its little cleanup thing behind the scenes. πŸ™ˆ


⭐ Member Function Documentation ⭐

SoType SoVRMLMaterial::getClassTypeId (void ) [static]

This static method returns the SoType object associated with objects of this class.

SoType SoVRMLMaterial::getTypeId (void ) const [virtual]

Returns the type identification of an object derived from a class inheriting SoBase. This is used for runtime type checking and "downward" casting.

Implements SoBase.

const SoFieldData ** SoVRMLMaterial::getFieldDataPtr (void ) [static], [protected]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. So like... if you're an app dev, this one isn't for you, bestie. πŸ™ˆ

Returns the SoFieldData class which holds information about fields in this node.

const SoFieldData * SoVRMLMaterial::getFieldData (void ) const [protected], [virtual]

Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.

Reimplemented from SoFieldContainer.

void SoVRMLMaterial::initClass (void ) [static]

No description in the source β€” it's just out here existing, silent, iconic. πŸ’…

void SoVRMLMaterial::doAction (SoAction * action) [virtual]

This function performs the typical operation of a node for any action.

Reimplemented from SoNode.

void SoVRMLMaterial::GLRender (SoGLRenderAction * action) [virtual]

Action method for the SoGLRenderAction.

This is called during rendering traversals. Nodes influencing the rendering state in any way or want to throw geometry primitives at OpenGL override this method.

Reimplemented from SoNode.

void SoVRMLMaterial::callback (SoCallbackAction * action) [virtual]

Action method for SoCallbackAction.

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.

Reimplemented from SoNode.


πŸ¦‹ Member Data Documentation πŸ¦‹

  • SoSFColor SoVRMLMaterial::diffuseColor β€” the diffuse color component. Default value is (0.8, 0.8, 0.8).
  • SoSFFloat SoVRMLMaterial::ambientIntensity β€” the ambient intensity. Default value is 0.2.
  • SoSFColor SoVRMLMaterial::specularColor β€” the specular color component. Default value is (0, 0, 0).
  • SoSFColor SoVRMLMaterial::emissiveColor β€” the emissive color component. Default value is (0, 0, 0).
  • SoSFFloat SoVRMLMaterial::shininess β€” the shininess value. A number between 0 and 1. Default value is 0.2.
  • SoSFFloat SoVRMLMaterial::transparency β€” the material transparency. Valid range is from 0.0 (completely opaque) to 1.0 (completely transparent). Default value is 0.0.

πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for Coin from the source code. Not a human, just a robot doing its little documentation thing fr fr. πŸ€–


And that's the whole page, bestie!! 🌸 This was Version 4.0.10, dated Thu Jun 25 2026, and it lives at SoVRMLMaterial(3) in the manual pages. Go forth and make your geometry absolutely gorgeous πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from