- All Implemented Interfaces:
public class SoLight extends SoNodeAbstract base class for all light source nodes.
SoLightis the abstract base class for all light nodes. A light node defines an illumination source that may affect subsequent shapes in the scene graph, depending on the current lighting style. Light sources are affected by the current transformation. A light node under a separator does not affect any objects outside that separator.
You can also use a node kit to create a light. See
SoEnvironmentnode can be used to specify additional options related to lighting:
- The ambient light component of the Phong reflection model.
- Light attenuation for
- Ambient occlusion.
Lighting is enabled by default (default model is PER_VERTEX_PHONG). When lighting is enabled, there must be light nodes (e.g.
SoDirectionalLight) in the scene graph for objects to be easily visible. When using the Open Inventor viewer classes (e.g.
SoWinExaminerViewer), the viewer will create a "headlight" (directional light attached to the camera) if no other light nodes exist when setSceneGraph() is called.
By default, lighting is only computed for the "front" faces of geometry, so the back face of the geometry will be dark. The front face is determined by the normal vector, if specified, or by the vertex ordering (see
SoShapeHints) if normals are computed by Open Inventor. To enable "two sided" lighting (lighting both front and back faces) see
The maximum number of lights depends on the hardware, but at least eight simultaneous lights are supported.
This is an abstract class. See the reference page of a derived class for the format and default values.
Activates this light (if so specified) during traversal. All shape nodes that come after this light in the scene graph are illuminated by this light.
Fields Modifier and Type Field Description
colorLight source illumination color.
intensityIllumination intensity of light source.
onDetermines whether the source is active or inactive.
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
public final SoSFBool onDetermines whether the source is active or inactive. When inactive, the source does not illuminate at all.
public final SoSFFloat intensityIllumination intensity of light source. Valid values range from 0.0 (no illumination) to 1.0 (maximum illumination).
public final SoSFColor colorLight source illumination color.