SoVRMLMaterial(3)
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 theSoTypefor 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 offSbBool isOverride (void) constβ are we in override mode rn?void setNodeType (const NodeType type)β set the node typeNodeType getNodeType (void) constβ get the node typevirtual SoNode * copy (SbBool copyconnections=FALSE) constβ make a copy, and you can choose whether connections come alongvirtual SbBool affectsState (void) constβ does this thing touch the state?virtual void GLRenderBelowPath (SoGLRenderAction *action)β the below-path render traversalvirtual void GLRenderInPath (SoGLRenderAction *action)β the in-path render traversalvirtual void GLRenderOffPath (SoGLRenderAction *action)β the off-path render traversalvirtual void getBoundingBox (SoGetBoundingBoxAction *action)β bounding box actionvirtual void getMatrix (SoGetMatrixAction *action)β matrix actionvirtual void handleEvent (SoHandleEventAction *action)β event handling actionvirtual void pick (SoPickAction *action)β pick actionvirtual void rayPick (SoRayPickAction *action)β ray pick actionvirtual void search (SoSearchAction *action)β search actionvirtual void write (SoWriteAction *action)β write actionvirtual void audioRender (SoAudioRenderAction *action)β audio render actionvirtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)β primitive count actionvirtual void grabEventsSetup (void)β event grabbing setupvirtual void grabEventsCleanup (void)β event grabbing cleanupvirtual void startNotify (void)β kick off notificationvirtual void notify (SoNotList *l)β do the notificationSbUniqueId getNodeId (void) constβ the node's unique id πvirtual SoChildList * getChildren (void) constβ the child listvirtual void writeInstance (SoOutput *out)β write out this instancevirtual SoNode * addToCopyDict (void) constβ register yourself in the copy dictionaryvirtual void copyContents (const SoFieldContainer *from, SbBool copyconnections)β copy contents over from another field containervirtual SoFieldContainer * copyThroughConnection (void) constβ copy through a connection
π Public Member Functions inherited from SoFieldContainer
void setToDefaults (void)β reset everything to defaultsSbBool 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 connectionsSbBool set (const char *const fielddata)β set from field datavoid get (SbString &fielddata)β get the field data outvirtual int getFields (SoFieldList &l) constβ collect the fields into a listvirtual int getAllFields (SoFieldList &l) constβ collect all the fields into a listvirtual SoField * getField (const SbName &name) constβ grab a field by namevirtual SoField * getEventIn (const SbName &name) constβ grab an event-in by namevirtual SoField * getEventOut (const SbName &name) constβ grab an event-out by nameSbBool getFieldName (const SoField *const field, SbName &name) constβ look up a field's nameSbBool enableNotify (const SbBool flag)β turn notification on or offSbBool isNotifyEnabled (void) constβ is notification on?SbBool set (const char *fielddata, SoInput *input)β the otherset, this time with anSoInputvoid get (SbString &fielddata, SoOutput *out)β the otherget, this time with anSoOutputvirtual SbBool validateNewFieldValue (SoField *field, void *newval)β check whether a new value is validvirtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE)β add a write referenceSbBool getIsBuiltIn (void) constβ is this built in?virtual void getFieldsMemorySize (size_t &managed, size_t &unmanaged) constβ report field memory sizesvoid setUserData (void *userdata) constβ stash some user datavoid * getUserData (void) constβ get that user data back
π¦ Public Member Functions inherited from SoBase
void ref (void) constβ bump the ref countvoid unref (void) constβ drop the ref countvoid unrefNoDelete (void) constβ drop the ref count without deletingint32_t getRefCount (void) constβ what's the ref count rn?void touch (void)β touch it, make it notifySbBool isOfType (SoType type) constβ ReturnsTRUEif the type of this object is either of the same type or inherited from type. π«Άvirtual SbName getName (void) constβ get the namevirtual void setName (const SbName &newname)β set the namevoid addAuditor (void *const auditor, const SoNotRec::Type type)β add an auditorvoid removeAuditor (void *const auditor, const SoNotRec::Type type)β remove an auditorconst SoAuditorList & getAuditors (void) constβ get the auditor listSbBool 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-levelSoTypeπ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 typestatic SoType getClassTypeId (void)β the classSoTypestatic SoNode * getByName (const SbName &name)β find a node by namestatic int getByName (const SbName &name, SoNodeList &l)β find nodes by name into a liststatic 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 classesstatic SbUniqueId getNextNodeId (void)β the next node idstatic int getActionMethodIndex (const SoType type)β action method index for a typestatic void getBoundingBoxS (SoAction *action, SoNode *node)β static bounding box helperstatic void GLRenderS (SoAction *action, SoNode *node)β static GL render helperstatic void callbackS (SoAction *action, SoNode *node)β static callback helperstatic void getMatrixS (SoAction *action, SoNode *node)β static matrix helperstatic void handleEventS (SoAction *action, SoNode *node)β static event helperstatic void pickS (SoAction *action, SoNode *node)β static pick helperstatic void rayPickS (SoAction *action, SoNode *node)β static ray pick helperstatic void searchS (SoAction *action, SoNode *node)β static search helperstatic void writeS (SoAction *action, SoNode *node)β static write helperstatic void audioRenderS (SoAction *action, SoNode *node)β static audio render helperstatic 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 theSoTypeobject associated with objects of this class. πstatic void cleanupClass (void)β clean the class upstatic void initCopyDict (void)β init the copy dictionarystatic void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy)β add a copy to the dictionarystatic SoFieldContainer * checkCopy (const SoFieldContainer *orig)β check the copystatic SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections)β find a copy, with or without connectionsstatic 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 theSoTypeobject associated with objects of this class. πstatic void addName (SoBase *const base, const char *const name)β register a namestatic void removeName (SoBase *const base, const char *const name)β unregister a namestatic void incrementCurrentWriteCounter (void)β bump the write counterstatic void decrementCurrentWriteCounter (void)β drop the write counterstatic SoBase * getNamedBase (const SbName &name, SoType type)β find a named basestatic int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type)β find named bases into a liststatic SbBool read (SoInput *input, SoBase *&base, SoType expectedtype)β read one instatic void setInstancePrefix (const SbString &c)β set the instance prefixstatic void setTraceRefs (SbBool trace)β turn ref tracing on or offstatic 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 intensitySoSFColor specularColorβ the specular color β¨SoSFColor emissiveColorβ the emissive colorSoSFFloat shininessβ the shininess πSoSFFloat transparencyβ the transparency π«₯
π Protected Member Functions
virtual const SoFieldData * getFieldData (void) constβ get the field datavirtual ~SoVRMLMaterial ()β the destructor π
πΈ Protected Member Functions inherited from SoNode
SoNode (void)β the node constructorvirtual ~SoNode ()β the node destructorvirtual SbBool readInstance (SoInput *in, unsigned short flags)β read an instance
π Protected Member Functions inherited from SoFieldContainer
SoFieldContainer (void)β the field container constructorvirtual ~SoFieldContainer ()β the field container destructor
π¦ Protected Member Functions inherited from SoBase
SoBase (void)β the base constructorvirtual ~SoBase ()β the base destructorvirtual void destroy (void)β destroy itSbBool hasMultipleWriteRefs (void) constβ got multiple write refs?SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) constβ write the headervoid writeFooter (SoOutput *out) constβ write the footervirtual const char * getFileFormatName (void) constβ the file format namevirtual 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 pointerstatic void setNextActionMethodIndex (int index)β set the next action method indexstatic int getNextActionMethodIndex (void)β get the next action method indexstatic void incNextActionMethodIndex (void)β increment the next action method indexstatic 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 counterstatic void staticDataLock (void)β lock the static datastatic 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
ambientIntensityfield 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 asambientIntensityΓdiffuseColor. π«Ά - The
diffuseColorfield 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
emissiveColorfield 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
specularColorandshininessfields 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, thespecularColoris added to the diffuse and ambient colour calculations. Lowershininessvalues produce soft glows, while higher values result in sharper, smaller highlights. Glossy vs. matte, your choice bestie π - The
transparencyfield specifies how "clear" an object is, with1.0being completely transparent, and0.0completely 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 is0.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 between0and1. Default value is0.2.SoSFFloat SoVRMLMaterial::transparencyβ the material transparency. Valid range is from0.0(completely opaque) to1.0(completely transparent). Default value is0.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
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms