Class SoLightModel
- 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.SoLightModel
-
- All Implemented Interfaces:
SafeDisposable
public class SoLightModel extends SoNode
Node that defines the lighting model to use when rendering. This node defines the lighting model to be used when rendering subsequent shapes. The lighting model is specified in themodel
field.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. When using the Open Inventor viewer components (e.g. SceneExaminer), a "headlight" is automatically added to the scene graph.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.
When
model
is set to BASE_COLOR, the lighting computation is disabled for subsequent shapes. This can be useful for annotation, data visualization and other special cases.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
.VolumeViz:
SoLightModel
controls lighting for most VolumeViz shapes, but not forSoVolumeRender
. Lighting for volume rendering is controlled by theSoVolumeRenderingQuality
node.- Two sided lighting is automatically enabled for "slice" shapes, such as
SoOrthoSlice
.
File format/default:
LightModel {
model PER_PIXEL_PHONG Action behavior:
SoGLRenderAction
,SoCallbackAction
Sets the current lighting model in the state.- See Also:
SoBaseColor
,SoEnvironment
,SoDirectionalLight
,SoLight
,SoPointLight
,SoMaterial
,SoSpotLight
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoLightModel.Models
Lighting model.-
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 SoSFEnum<SoLightModel.Models>
model
Lighting model to use .-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoLightModel()
Creates a light model node with default settings.
-
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
-
model
public final SoSFEnum<SoLightModel.Models> model
Lighting model to use . Default is PER_PIXEL_PHONG.
-
-