H3D::Material Class Reference
[X3D node classes.]

The Material node specifies surface material properties for associated geometry nodes and is used by the X3D lighting equations during rendering. More...

#include <H3D/Material.h>

Inheritance diagram for H3D::Material:

Inheritance graph

List of all members.

Public Member Functions

 Material (Inst< DisplayList > _displayList=0, Inst< SFFloat > _ambientIntensity=0, Inst< SFColor > _diffuseColor=0, Inst< SFColor > _emissiveColor=0, Inst< SFNode > _metadata=0, Inst< SFFloat > _shininess=0, Inst< SFColor > _specularColor=0, Inst< SFFloat > _transparency=0)
 Constructor.
virtual void render ()
 Set up the material properties in OpenGL.
virtual void preRender ()
 This function will be called by the X3DShapeNode before any rendering of geometry and before the call to the render function.
virtual void postRender ()
 This function will be called by the X3DShapeNode after the geometry has been rendered to restore the states to what it was before the call to preRender().
virtual bool isTransparent ()
 This function checks the transparency field to determine if the material requires that the geometry is rendered with transparency.

Public Attributes

auto_ptr< SFFloatambientIntensity
 The ambientIntensity field specifies how much ambient light from light sources this surface shall reflect.
auto_ptr< SFColordiffuseColor
 The diffuseColor field reflects all light sources depending on the angle of the surface with respect to the light source.
auto_ptr< SFColoremissiveColor
 The emissiveColor field models "glowing" objects.
auto_ptr< SFFloatshininess
 Shininess effect the specular highlights.
auto_ptr< SFColorspecularColor
 The color of the specular highlights.
auto_ptr< SFFloattransparency
 The transparency field specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The Material node specifies surface material properties for associated geometry nodes and is used by the X3D lighting equations during rendering.

See the Lighting component of the X3D specification for a detailed description of the X3D lighting model equations. All of the fields in the Material node range from 0.0 to 1.0.

The fields in the Material node determine how light reflects off an object to create colour:

Internal routes:
Material.dot

Member Function Documentation

virtual void H3D::Material::postRender (  )  [inline, virtual]

This function will be called by the X3DShapeNode after the geometry has been rendered to restore the states to what it was before the call to preRender().

Reimplemented from H3D::X3DAppearanceChildNode.

virtual void H3D::Material::preRender (  )  [inline, virtual]

This function will be called by the X3DShapeNode before any rendering of geometry and before the call to the render function.

So this is the place to save the states that are going to be changed in render() in order to restore it in postRender().

Reimplemented from H3D::X3DAppearanceChildNode.


Member Data Documentation

The ambientIntensity field specifies how much ambient light from light sources this surface shall reflect.

Ambient light is omnidirectional and depends only on the number of light sources, not their positions with respect to the surface. Ambient colour is calculated as ambientIntensity diffuseColor.

Access type: inputOutput
Default value: 0.2
Valid range: [0-1]

Material_ambientIntensity.dot

Referenced by Material(), and render().

The diffuseColor field reflects all light sources depending on the angle of the surface with respect to the light source.

The more directly the surface faces the light, the more diffuse light reflects.

Access type: inputOutput
Default value: RGB( 0.8, 0.8, 0.8 )
Valid range: [0-1]

Material_diffuseColor.dot

Referenced by Material(), and render().

The emissiveColor field models "glowing" objects.

This can be useful for displaying pre-lit models (where the light energy of the room is computed explicitly), or for displaying scientific data.

Access type: inputOutput
Default value: RGB( 0, 0, 0 )
Valid range: [0-1]

Material_emissiveColor.dot

Referenced by Material(), and render().

Shininess effect the specular highlights.

Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights.

Access type: inputOutput
Default value: 0.2
Valid range: [0-1]

Material_shininess.dot

Referenced by Material(), and render().

The color of the specular highlights.

Access type: inputOutput
Default value: RGB( 0, 0, 0 )
Valid range: [0-1]

Material_specularColor.dot

Referenced by Material(), and render().

The transparency field specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque.

Access type: inputOutput
Default value: 0
Valid range: [0-1]

Material_transparency.dot

Referenced by Material(), and render().


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

Generated on Fri Nov 7 10:30:34 2008 for H3D API by  doxygen 1.5.7