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

Public Member Functions | |
| TwoSidedMaterial (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, Inst< SFFloat > _backAmbientIntensity=0, Inst< SFColor > _backDiffuseColor=0, Inst< SFColor > _backEmissiveColor=0, Inst< SFFloat > _backShininess=0, Inst< SFColor > _backSpecularColor=0, Inst< SFFloat > _backTransparency=0, Inst< SFBool > _separateBackColor=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. | |
| auto_ptr< SFFloat > | backAmbientIntensity |
| The backAmbientIntensity is the same as the ambientIntensity field but will be used for the back side of the geometry if separateBackColor is true;. | |
| auto_ptr< SFColor > | backDiffuseColor |
| The backDiffuseColor is the same as the diffuseColor field but will be used for the back side of the geometry if separateBackColor is true;. | |
| auto_ptr< SFColor > | backEmissiveColor |
| The backEmissiveColor is the same as the emissiveColor field but will be used for the back side of the geometry if separateBackColor is true;. | |
| auto_ptr< SFFloat > | backShininess |
| The backShininess is the same as the shininess field but will be used for the back side of the geometry if separateBackColor is true;. | |
| auto_ptr< SFColor > | backSpecularColor |
| The backSpecularColor is the same as the specularColor field but will be used for the back side of the geometry if separateBackColor is true;. | |
| auto_ptr< SFFloat > | backTransparency |
| The backTransparency is the same as the transparency field but will be used for the back side of the geometry if separateBackColor is true. | |
| auto_ptr< SFBool > | separateBackColor |
| If the separateBackColor field is set to TRUE, then the rendering shall render the front and back faces of the geometry with different values. | |
Static Public Attributes | |
| static H3DNodeDatabase | database |
| The H3DNodeDatabase for this node. | |
These materials are used for both the front and back side of the geometry whenever the X3D lighting model is active.
If the separateBackColor field is set to TRUE, then the rendering shall render the front and back faces of the geometry with different values. If the value is FALSE, then the front colours are used for both the front and back side of the polygon, as per the existing X3D lighting rules.
When calculating the terms in the lighting equations, the front geometry shall use the fields ambientIntensity, diffuseColor,emissiveColor, shininess, specularColor, and transparency. The faces that are determined to be the back side are rendered using backAmbientIntensity, backDiffuseColor, backEmissiveColor, backShininess, and backTransparency as the appropriate components in the lighting equations.
|
|
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. 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 backAmbientIntensity is the same as the ambientIntensity field but will be used for the back side of the geometry if separateBackColor is true;.
Access type: inputOutput
|
|
|
The backDiffuseColor is the same as the diffuseColor field but will be used for the back side of the geometry if separateBackColor is true;.
Access type: inputOutput
|
|
|
The backEmissiveColor is the same as the emissiveColor field but will be used for the back side of the geometry if separateBackColor is true;.
Access type: inputOutput
|
|
|
The backShininess is the same as the shininess field but will be used for the back side of the geometry if separateBackColor is true;.
Access type: inputOutput
|
|
|
The backSpecularColor is the same as the specularColor field but will be used for the back side of the geometry if separateBackColor is true;.
Access type: inputOutput
|
|
|
The backTransparency is the same as the transparency field but will be used for the back side of the geometry if separateBackColor is true.
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
|
|
|
If the separateBackColor field is set to TRUE, then the rendering shall render the front and back faces of the geometry with different values. If the value is FALSE, then the front colours are used for both the front and back side of the polygon,
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