Surface material definition node. More...
#include <Inventor/nodes/SoMaterial.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
Returns the type identifier for this specific instance. | |
SoMaterial () | |
Creates a material node with default settings. | |
virtual void | setOverride (const SbBool state) |
Set the state of the override field. | |
virtual SbBool | isOverride () const |
Returns the state of the override field. | |
Public Member Functions inherited from SoNode | |
virtual SoNode * | copy (SbBool copyConnections=FALSE) const |
Creates and returns an exact copy of the node. | |
virtual SbBool | affectsState () const |
Returns TRUE if a node has an effect on the state during traversal. | |
virtual void | touch () |
Marks an instance as modified, simulating a change to it. | |
Public Member Functions inherited from SoFieldContainer | |
void | setToDefaults () |
Sets all fields in this object to their default values. | |
SbBool | hasDefaultValues () const |
Returns TRUE if all of the object's fields have their default values. | |
SbBool | fieldsAreEqual (const SoFieldContainer *fc) const |
Returns TRUE if this object's fields are exactly equal to fc's fields. | |
void | copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE) |
Copies the contents of fc's fields into this object's fields. | |
SoNONUNICODE SbBool | set (const char *fieldDataString) |
Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. | |
SbBool | set (const SbString &fieldDataString) |
Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. | |
void | get (SbString &fieldDataString) |
Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. | |
virtual int | getFields (SoFieldList &list) const |
Appends references to all of this object's fields to resultList, and returns the number of fields appended. | |
virtual int | getAllFields (SoFieldList &list) const |
Returns a list of fields, including the eventIn's and eventOut's. | |
virtual SoField * | getField (const SbName &fieldName) const |
Returns a the field of this object whose name is fieldName. | |
virtual SoField * | getEventIn (const SbName &fieldName) const |
Returns a the eventIn with the given name. | |
virtual SoField * | getEventOut (const SbName &fieldName) const |
Returns the eventOut with the given name. | |
SbBool | getFieldName (const SoField *field, SbName &fieldName) const |
Returns the name of the given field in the fieldName argument. | |
SbBool | enableNotify (SbBool flag) |
Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE). | |
SbBool | isNotifyEnabled () const |
Notification is the process of telling interested objects that this object has changed. | |
virtual void | setUserData (void *data) |
Sets application data. | |
void * | getUserData (void) const |
Gets user application data. | |
Public Member Functions inherited from SoBase | |
virtual SbName | getName () const |
Returns the name of an instance. | |
virtual void | setName (const SbName &name) |
Sets the name of an instance. | |
void | setSynchronizable (const bool b) |
Sets this to be a ScaleViz synchronizable object. | |
bool | isSynchronizable () const |
Gets the ScaleViz synchronizable state of this object. | |
Public Member Functions inherited from SoRefCounter | |
void | ref () const |
Adds a reference to an instance. | |
void | unref () const |
Removes a reference from an instance. | |
void | unrefNoDelete () const |
unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero. | |
int | getRefCount () const |
Returns current reference count. | |
void | lock () const |
lock this instance. | |
void | unlock () const |
unlock this instance. | |
Public Member Functions inherited from SoTypedObject | |
SbBool | isOfType (const SoType &type) const |
Returns TRUE if this object is of the type specified in type or is derived from that type. | |
template<typename TypedObjectClass > | |
SbBool | isOfType () const |
Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class. | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoNode | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
static SoNode * | getByName (const SbName &name) |
A node's name can be set using SoBase::setName(). | |
static int | getByName (const SbName &name, SoNodeList &list) |
A node's name can be set using SoBase::setName(). | |
Static Public Member Functions inherited from SoFieldContainer | |
static SoType | getClassTypeId () |
Returns the type of this class. | |
Static Public Member Functions inherited from SoBase | |
static SoType | getClassTypeId () |
Returns type identifier for this class. | |
Static Public Member Functions inherited from SoTypedObject | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Public Attributes | |
SoMFColor | ambientColor |
Ambient color of the surface. | |
SoMFColor | diffuseColor |
Diffuse color(s) of the surface. | |
SoMFColor | specularColor |
Specular color of the surface. | |
SoMFColor | emissiveColor |
Emissive color of the surface. | |
SoMFFloat | shininess |
Shininess coefficient of the surface. | |
SoMFFloat | transparency |
Transparency value(s) of the surface. | |
Deprecated | |
class | SoIfWeeder |
DirectViz rendering only. | |
class | SoIfBuilder |
DirectViz rendering only. | |
class | SoIfShape |
DirectViz rendering only. | |
class | SoIfMerger |
DirectViz rendering only. | |
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 for geometry.
Lighting and material RGB values:
Override material:
Transparency:
VolumeViz shapes:
ambientColor | 0.2 0.2 0.2 |
diffuseColor | 0.8 0.8 0.8 |
specularColor | 0 0 0 |
emissiveColor | 0 0 0 |
shininess | 0.2 |
transparency | 0 |
SoBaseColor, SoLightModel, SoMaterialBinding, SoPackedColor, SoVertexProperty,
Definition at line 186 of file SoMaterial.h.
SoMaterial::SoMaterial | ( | ) |
Creates a material node with default settings.
|
static |
Returns the type identifier for this class.
|
virtual |
Returns the type identifier for this specific instance.
Reimplemented from SoNode.
|
inlinevirtual |
Returns the state of the override field.
Reimplemented from SoNode.
Definition at line 272 of file SoMaterial.h.
|
inlinevirtual |
Set the state of the override field.
see SoNode::setOverride doc.
Reimplemented from SoNode.
Definition at line 266 of file SoMaterial.h.
|
friend |
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.1
Definition at line 317 of file SoMaterial.h.
|
friend |
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.1
Definition at line 319 of file SoMaterial.h.
|
friend |
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.1
Definition at line 318 of file SoMaterial.h.
|
friend |
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.1
Definition at line 316 of file SoMaterial.h.
SoMFColor SoMaterial::ambientColor |
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.
Definition at line 203 of file SoMaterial.h.
SoMFColor SoMaterial::diffuseColor |
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.
Definition at line 214 of file SoMaterial.h.
SoMFColor SoMaterial::emissiveColor |
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.
Definition at line 237 of file SoMaterial.h.
SoMFFloat SoMaterial::shininess |
Shininess 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.
Definition at line 247 of file SoMaterial.h.
SoMFColor SoMaterial::specularColor |
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.
Definition at line 228 of file SoMaterial.h.
SoMFFloat SoMaterial::transparency |
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).
Transparency is the inverse of "opacity" or "alpha" value.
Definition at line 255 of file SoMaterial.h.