SOMATERIAL(3iv)
β¨ SoMaterial β¨
okay bestie, gather round, because we're about to talk about SoMaterial(3IV) β the surface material definition node that's literally the glow-up station for all your 3D shapes π β¨
πΈ INHERITS FROM πΈ
SoBase > SoFieldContainer > SoNode > SoMaterial
it's giving legacy, it's giving lineage, it's giving "my ancestors were iconic too" π
π SYNOPSIS π
#include <Inventor/nodes/SoMaterial.h>
Fields from class SoMaterial:
SoMFColor ambientColor
SoMFColor diffuseColor
SoMFColor specularColor
SoMFColor emissiveColor
SoMFFloat shininess
SoMFFloat transparency
Methods from class SoMaterial:
SoMaterial()
static SoType getClassTypeId()
Methods from class SoNode:
void setOverride(SbBool state)
SbBool isOverride() const
SoNode * copy(SbBool copyConnections = FALSE) const
virtual SbBool affectsState() const
static SoNode * getByName(const SbName &name)
static int getByName(const SbName &name, SoNodeList &list)
Methods from class SoFieldContainer:
void setToDefaults()
SbBool hasDefaultValues() const
SbBool fieldsAreEqual(const SoFieldContainer *fc) const
void copyFieldValues(const SoFieldContainer *fc, SbBool
copyConnections = FALSE)
SbBool set(const char *fieldDataString)
void get(SbString &fieldDataString)
virtual int getFields(SoFieldList &resultList) const
virtual SoField * getField(const SbName &fieldName) const
SbBool getFieldName(const SoField *field, SbName &fieldName)
const
SbBool isNotifyEnabled() const
SbBool enableNotify(SbBool flag)
Methods from class SoBase:
void ref()
void unref() const
void unrefNoDelete() const
void touch()
virtual SoType getTypeId() const
SbBool isOfType(SoType type) const
virtual void setName(const SbName &name)
virtual SbName getName() const
π DESCRIPTION π
so basically, this node is the main character of surface vibes. SoMaterial defines the current surface material properties for every shape that comes after it in the scene graph. it sets several components of the current material during traversal β no cap, it's just out here setting the mood for everything downstream π¦
you can specify multiple values for the diffuseColor and transparency. different shapes interpret materials with multiple values differently, so it's not a one-size-fits-all situation, bestie. to actually bind materials to shapes, you use an SoMaterialBinding node β that's the matchmaker that pairs your materials with your geometry π
β¨ FIELDS β¨
SoMFColor ambientColorβ the ambient color of the surface. it's the base glow, the ambient lighting vibe, the "just existing" energy πSoMFColor diffuseColorβ the diffuse color(s) of the surface. this is the main character color, the one everyone sees under normal light πSoMFColor specularColorβ the specular color of the surface. that's the shiny highlight color, the sparkle, the β¨gleamβ¨SoMFColor emissiveColorβ the emissive color of the surface. it's the glow-from-within color, like your shape is lit from the inside out π₯SoMFFloat shininessβ the shininess coefficient of the surface. values range from0.0for no shininess (a diffuse surface, aka matte, lowkey) to1.0for maximum shininess (a highly polished surface, aka highkey glowing like a diamond π).SoMFFloat transparencyβ the transparency value(s) of the surface. values range from0.0for opaque surfaces to1.0for completely transparent surfaces. okay so important detail: if the transparency type isSoGLRenderAction::SCREEN_DOORthen only the first transparency value will be used. with other transparency types, multiple transparencies will be used, if theSoMaterialnode contains as many transparencies as diffuse colors. if there are not as many transparencies as diffuse colors, only the first transparency will be used. fr fr, that's the rule π«Ά
π§ METHODS π§
SoMaterial()β creates a material node with default settings. it's the blank canvas, the fresh start, the "not me starting a new project" moment πstatic SoType getClassTypeId()β returns the type identifier for this class. it's like a birth certificate but for code π
π ACTION BEHAVIOR π
SoGLRenderAction, SoCallbackAction
sets the ambient color, the diffuse color, the specular color, the emissive color, the shininess, and the transparency of the current material. that's it. that's the whole job. and it does it flawlessly every time π―
π FILE FORMAT/DEFAULTS π
Material {
ambientColor 0.2 0.2 0.2
diffuseColor 0.8 0.8 0.8
specularColor 0 0 0
emissiveColor 0 0 0
shininess 0.2
transparency 0
}
look at those defaults, so clean, so iconic, so "I woke up like this" πΈ
π SEE ALSO π
SoBaseColorSoLightModelSoMaterialBindingSoPackedColor
and that's the whole page, bestie! this has been SoMaterial(3IV)() β brought to you by the Inventor crew, and yes, the manual name is literally SoMaterial(3IV)() because we keep it old school like that. now go make something shiny πβ¨
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms