Class SoLight
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.inventor.nodes.SoLight
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
SoDirectionalLight
,SoPointLight
,SoSpotLight
public class SoLight extends SoNode
Abstract base class for all light source nodes.SoLight
is 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
SoLightKit
.An
SoEnvironment
node can be used to specify additional options related to lighting:- The ambient light component of the Phong reflection model.
- Light attenuation for
SoPointLight
andSoSpotLight
nodes. - 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) seeSoShapeHints
.The maximum number of lights depends on the hardware, but at least eight simultaneous lights are supported.
File format/default:
This is an abstract class. See the reference page of a derived class for the format and default values.
Action behavior:
SoGLRenderAction
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.- See Also:
SoDirectionalLight
,SoEnvironment
,SoLightKit
,SoLightModel
,SoMaterial
,SoPointLight
,SoSpotLight
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFColor
color
Light source illumination color.SoSFFloat
intensity
Illumination intensity of light source.SoSFBool
on
Determines whether the source is active or inactive.-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
-
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
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
on
public final SoSFBool on
Determines whether the source is active or inactive. When inactive, the source does not illuminate at all.
-
intensity
public final SoSFFloat intensity
Illumination intensity of light source. Valid values range from 0.0 (no illumination) to 1.0 (maximum illumination).
-
color
public final SoSFColor color
Light source illumination color.
-
-