SOENVIRONMENT(3iv)
β¨ SoEnvironment(3IV) β¨
okay bestie, sit down, we're talking about SoEnvironment(3IV) β the global environment node. it's giving main character energy for your whole scene's lighting mood. π
π INHERITS FROM
SoBase > SoFieldContainer > SoNode > SoEnvironment
the family tree is real and it ate. πΈ
π¦ SYNOPSIS
#include <Inventor/nodes/SoEnvironment.h>
enum FogType {
SoEnvironment::NONE No fog
SoEnvironment::HAZE Linear increase in opacity with distance
SoEnvironment::FOG Exponential increase in opacity
SoEnvironment::SMOKE Exponential squared increase in opacity
}
Fields from class SoEnvironment:
SoSFFloat ambientIntensity
SoSFColor ambientColor
SoSFVec3f attenuation
SoSFEnum fogType
SoSFColor fogColor
SoSFFloat fogVisibility
Methods from class SoEnvironment:
SoEnvironment()
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 this node? it's the one holding the global environmental attributes β ambient lighting, light attenuation, and fog. the whole vibe check for your scene, basically. π
Ambient lighting is the amount of extra light impinging on each surface point when the lighting model is Phong β peek SoLightModel for that one, iykyk.
Light attenuation affects all subsequent lights in a scene (shoutout to SoLight). it's a quadratic function of distance from a light source to a surface point. the three coefficients live in the attenuation field. and no cap: attenuation works only for light sources with a fixed location, like point and spot lights. so don't come for me when your directional light doesn't get the memo. π
Fog has one of four types, and each one blends each surface point with the specified fog color. each type reads the visibility field as the distance at which fog totally obscures objects. a visibility value of 0 (the default) makes the SoEnvironment node set up fog so that the visibility is the distance to the far clipping plane of the current camera. iconic behavior honestly. β¨
note bestie: this node has effect only during rendering, and it does not inherit field values from other SoEnvironment nodes. so don't expect it to pick up gossip from its neighbors. π«Ά
π FIELDS
SoSFFloatambientIntensitySoSFColorambientColor
intensity and RGB color of ambient lighting (for Phong lighting). the glow-up, literally.
SoSFVec3fattenuation
squared, linear, and constant light attenuation coefficients (in that order β do not shuffle them, it's not a playlist) with respect to distance of light from surface (for Phong lighting).
SoSFEnumfogTypeSoSFColorfogColorSoSFFloatfogVisibility
type of fog, color of fog, and visibility distance β which is the distance at which fog totally obscures objects. mystery mode activated. π«οΈ
π METHODS
SoEnvironment()
creates an environment node with default settings. blank canvas, fresh start, slay.
static SoType getClassTypeId()
returns type identifier for this class. it's the class's little name tag at the party. π
π₯ ACTION BEHAVIOR
SoGLRenderAction
sets the current environment parameters to those specified with this node. successive geometries will be rendered using this environment. periodt.
β FILE FORMAT/DEFAULTS
Environment {
ambientIntensity 0.2
ambientColor 1 1 1
attenuation 0 0 1
fogType NONE
fogColor 1 1 1
fogVisibility 0
}
these are the defaults, bestie β fogType starts at NONE, so no fog until you say so. she's lowkey shy at first. π
π§ SEE ALSO
SoLight, SoLightModel
and that's the whole page!! π the source/version line and the date at the bottom are literally just SoEnvironment(3IV)() β same as the title, no extra tea to spill. consider yourself fully caught up. mwah, go render something gorgeous. ππ¦β¨
π¦ 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