SOLIGHTMODEL(3iv)

πŸ’– SoLightModel β€” the lighting vibe-setter πŸ’–

okay bestie, welcome to the SoLightModel page from the 3IV manual ✨ this one's short and sweet and it literally just picks which lighting model the renderer uses. it's giving "small node, big mood" energy. πŸŽ€


🌈 NAME 🌈

SoLightModel β€” node that defines the lighting model to use when rendering

like. that's the whole job. it decides how light hits your shapes. no cap. πŸ’…


🧬 INHERITS FROM 🧬

SoBase > SoFieldContainer > SoNode > SoLightModel

so it's a full-on SoNode descendant, which means it comes with the whole node family inheritance package. iconic lineage fr. πŸ‘‘


✨ SYNOPSIS ✨

#include <Inventor/nodes/SoLightModel.h>

enum Model {
     SoLightModel::BASE_COLOR  Use only the base (diffuse) object color
     SoLightModel::PHONG       Use Phong lighting model
}

Fields from class SoLightModel:

SoSFEnum            model

Methods from class SoLightModel:

                    SoLightModel()
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

yes the synopsis is a whole inheritance flex, we love a family tree that goes hard. 🌸


πŸ’« DESCRIPTION πŸ’«

okay so real talk: this node defines the lighting model used when rendering subsequent shapes. it's a state-setter, bestie β€” it doesn't light itself, it changes the rules for everything that comes after it in the scene graph. πŸ¦‹

the model gets specified in the model field, obviously. πŸ’–

and here's the part you actually need to know: when the default model (Phong lighting) is used, light sources are required in a scene for objects to be easily visible. like, if you're on Phong and you forgot to add a light?? your objects are gonna be sitting there in the dark. main character who forgot to pay the electric bill energy. πŸ˜­πŸ’€


πŸ”§ FIELDS πŸ”§

  • SoSFEnum model β€” Lighting model to use

one field. one. and it's running the entire show. obsessed. πŸ‘‘


πŸ› οΈ METHODS πŸ› οΈ

  • SoLightModel() β€” Creates a light model node with default settings.

fresh node, default settings, ready to go. it's giving "new phone who dis" ✨

  • static SoType getClassTypeId() β€” Returns type identifier for this class.

you want the type ID? she's got the type ID. πŸ’…


🎬 ACTION BEHAVIOR 🎬

  • SoGLRenderAction, SoCallbackAction β€” Sets the current lighting model in the state.

so when these actions roll through, they just set the lighting model in the state and keep it moving. vibe check: passed. 🌈


πŸ“„ FILE FORMAT/DEFAULTS πŸ“„

LightModel {
     model  PHONG
}

yup β€” out of the box, model is PHONG. so bestie, default behavior = you need lights. don't forget. πŸ™ˆ


πŸ‘€ SEE ALSO πŸ‘€

SoBaseColor, SoEnvironment, SoLight, SoMaterial

go read those too, they're all in the same lighting/material friend group. iykyk. 🫢


⚠️ reminder, fr fr: this node affects the rendering of subsequent shapes. it's state, so order matters. no cap.

and that's the whole page bestie!! this was SoLightModel(3IV)() β€” the 3IV manual, signing off. slay, stay lit (literally), and go add a light source πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ”₯πŸ‘‘πŸŒˆβ­πŸ’œ