#include <Material.h>
Inheritance diagram for H3D::Material:

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< SFFloat > | ambientIntensity |
| The ambientIntensity field specifies how much ambient light from light sources this surface shall reflect. | |
| auto_ptr< SFColor > | diffuseColor |
| The diffuseColor field reflects all light sources depending on the angle of the surface with respect to the light source. | |
| auto_ptr< SFColor > | emissiveColor |
| The emissiveColor field models "glowing" objects. | |
| auto_ptr< SFFloat > | shininess |
| Shininess effect the specular highlights. | |
| auto_ptr< SFColor > | specularColor |
| The color of the specular highlights. | |
| auto_ptr< SFFloat > | transparency |
| 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. | |
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:
|
|
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. |
|
|
Set up the material properties in OpenGL. If an RGB, BGR, RGBA or BGRA texture the texture values should not be modulated with diffuseColor according to the X3D spec. So we set the diffuse color to 1 1 1 in order to show the texture values as they are. The alpha value should be the one from material if 3 component texture and the one from the texture if 4-component texture. Reimplemented from H3D::Node. |
|
|
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
|
|
|
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
|
|
|
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
|
|
|
Shininess effect the specular highlights. Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights.
Access type: inputOutput
|
|
|
The color of the specular highlights.
Access type: inputOutput
|
|
|
The transparency field specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque.
Access type: inputOutput
|
1.4.5