Class SoLightModel

  • All Implemented Interfaces:

    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 the model 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 and SoSpotLight 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) see SoShapeHints.


    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
    • Constructor Detail

      • SoLightModel

        public SoLightModel()
        Creates a light model node with default settings.