SoLightModel Class Reference
[Lights & colors]

Node that defines the lighting model to use when rendering. More...

#include <Inventor/nodes/SoLightModel.h>

Inheritance diagram for SoLightModel:
SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Types

enum  Model {
  BASE_COLOR = SoLightModelElement::BASE_COLOR,
  PHONG = SoLightModelElement::PHONG,
  PER_VERTEX_PHONG = SoLightModelElement::PER_VERTEX_PHONG,
  PER_PIXEL_PHONG = SoLightModelElement::PER_PIXEL_PHONG
}

Public Member Functions

virtual SoType getTypeId () const
 SoLightModel ()
virtual void setOverride (const SbBool state)
virtual SbBool isOverride () const

Static Public Member Functions

static SoType getClassTypeId ()

Public Attributes

SoSFEnum model

Detailed Description

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:

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.

VolumeViz:

FILE FORMAT/DEFAULT

ACTION BEHAVIOR

SEE ALSO

SoBaseColor, SoEnvironment, SoDirectionalLight, SoLight, SoPointLight, SoMaterial, SoSpotLight


Member Enumeration Documentation

Lighting model.

Enumerator:
BASE_COLOR 

Use only the base (diffuse) object color.

Effectively lighting is turned off and light nodes are not considered.

PHONG 

Use Phong lighting model.

Deprecated:

Deprecated since Open Inventor 10000
PHONG is replaced by PER_VERTEX_PHONG to avoid ambiguities with PER_PIXEL_PHONG
PER_VERTEX_PHONG 

Use Vertex-based Phong lighting model.

A lighting computation is done at each vertex of the shape and the color of each pixel (fragment) is determined by interpolating between these values. This model produces less realistic results than pixel-based lighting, especially for Point and Spot lights.

PER_PIXEL_PHONG 

Use Pixel-based Phong lighting model (default).

A lighting computation is done for each pixel (fragment) affected by the shape.


Constructor & Destructor Documentation

SoLightModel::SoLightModel (  ) 

Creates a light model node with default settings.


Member Function Documentation

static SoType SoLightModel::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoNode.

virtual SoType SoLightModel::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoNode.

virtual SbBool SoLightModel::isOverride (  )  const [inline, virtual]

Returns the state of the override field.

Reimplemented from SoNode.

virtual void SoLightModel::setOverride ( const SbBool  state  )  [inline, virtual]

Set the state of the override field.

see SoNode::setOverride doc.

Reimplemented from SoNode.


Member Data Documentation

Lighting model to use Use enum Model.

Default is PER_PIXEL_PHONG.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/