Surface material definition node. More...
#include <Inventor/nodes/SoMaterial.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoMaterial () | |
virtual void | setOverride (const SbBool state) |
virtual SbBool | isOverride () const |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Public Attributes | |
SoMFColor | ambientColor |
SoMFColor | diffuseColor |
SoMFColor | specularColor |
SoMFColor | emissiveColor |
SoMFFloat | shininess |
SoMFFloat | transparency |
SoSFBool | receiveShadow |
SoMFColor | reflectiveColor |
Surface material definition node.
This node defines the current surface material properties for all subsequent shapes. SoMaterial sets several components of the current material during traversal. The ambientColor, diffuseColor, emissiveColor, specularColor and shininess fields are interpreted according to the classic OpenGL lighting model. The transparency field is effectively the inverse of "opacity" or "alpha value".
If lighting is turned off (SoLightModel set to BASE_COLOR), only the diffuse color and transparency fields are used to render geometry.
Multiple values can be specified for the diffuseColor and transparency fields. Different shapes interpret materials with multiple values differently. To bind materials to shapes, use an SoMaterialBinding node.
Several other nodes can be used to set diffuse color and transparency.
Lighting and material RGB values:
Override material:
Transparency:
ambientColor | 0.2 0.2 0.2 |
diffuseColor | 0.8 0.8 0.8 |
specularColor | 0 0 0 |
reflectiveColor | 0 0 0 |
emissiveColor | 0 0 0 |
shininess | 0.2 |
transparency | 0 |
receiveShadow | FALSE |
SoBaseColor, SoLightModel, SoMaterialBinding, SoPackedColor, SoVertexProperty, SoDirectVizManager
SoMaterial::SoMaterial | ( | ) |
Creates a material node with default settings.
static SoType SoMaterial::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoNode.
virtual SoType SoMaterial::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoNode.
virtual SbBool SoMaterial::isOverride | ( | ) | const [inline, virtual] |
Returns the state of the override field.
Reimplemented from SoNode.
virtual void SoMaterial::setOverride | ( | const SbBool | state | ) | [inline, virtual] |
Ambient color of the surface.
Default is 0.2 0.2 0.2.
Ambient reflectance affects the overall color of the object. Because diffuse reflectance is brightest where an object is directly illuminated, ambient reflectance is most noticeable where an object receives no direct illumination. An object's total ambient reflectance is affected by the global ambient light (see SoEnvironment) and ambient light from individual light sources. Like diffuse reflectance, ambient reflectance is not affected by the position of the camera.
Diffuse color(s) of the surface.
Default is 0.8 0.8 0.8.
Diffuse reflectance plays the most important role in determining the appearance of an object. It's affected by the color of the incident light(s) and the angle of each incident light relative to the object's normal direction. (It's most intense where the incident light falls perpendicular to the surface.) The position of the camera doesn't affect diffuse reflectance at all.
Emissive color of the surface.
Default is 0 0 0.
Emissive color makes an object appear to be giving off light of that color, independent of any lights (or lack of lights) in the scene. It can be useful for highlighting selected objects in the scene.
DirectViz rendering only.
Specifies that all the shapes using this material node will receive shadows from other shapes when rendering using DirectViz.
NOTE: field available since Open Inventor 6.1DirectViz rendering only.
Specifies the reflective color of the shape. When set to black (0,0,0), the object is not reflective. To simulate a perfect mirror, the reflectiveColor should be set to white (1, 1, 1), and all other color field values to black (0, 0, 0). The reflective component is added to the overall color of the object.
NOTE: field available since Open Inventor 6.1Shininess coefficient of the surface.
Values can range from 0.0 to 1.0. Default is 0.2.
The dot product of the vector reflected by the surface normal and the inverted light vector is raised to the "Shininess" power. The higher the shininess number, the smaller the resulting specular highlight turns out to be.
Specular color of the surface.
Default is 0 0 0.
Specular reflection from an object produces highlights. Unlike ambient and diffuse reflection, the amount of specular reflection does depend on the location of the camera - it's brightest along the direct angle of reflection. To see this, imagine looking at a metallic ball outdoors in the sunlight. As you move your head, the highlight created by the sunlight moves with you to some extent. However, if you move your head too much, you lose the highlight entirely.
This field specifies the color of the reflected light. The shininess field controls the size and brightness of the highlight.
Transparency value(s) of the surface.
Values can range from 0.0 for opaque surfaces to 1.0 for completely transparent surfaces. Default is 0 (opaque).
If the transparency type is SoGLRenderAction::SCREEN_DOOR then only the first transparency value will be used (See SoGLRenderAction::SCREEN_DOOR description). With other transparency types, multiple transparencies will be used, if the SoMaterial node contains as many transparencies as diffuse colors. If there are not as many transparencies as diffuse colors, only the first transparency will be used.
Transparency is the inverse of "opacity" or "alpha" value.