Class dnx.lr.node.MaterialNode
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.lr.node.MaterialNode

java.lang.Object
   |
   +----dnx.util.DNXObject
           |
           +----dnx.lr.Node
                   |
                   +----dnx.lr.SubsidiaryNode
                           |
                           +----dnx.lr.node.MaterialNode

public class MaterialNode
extends SubsidiaryNode
 Material {
    exposedField SFFloat      ambientIntensity 0.2
    exposedField SFColor      diffuseColor    0.8 0.8 0.8
    exposedField SFColor      emissiveColor   0 0 0
    exposedField SFFloat      shininess       0.2
    exposedField SFColor      specularColor   0 0 0
    exposedField SFFloat      transparency    0
 }

The Material node specifies surface material properties for associated geometry nodes and are used by the VRML lighting equations during rendering. See "Concepts - Lighting Model" for a detailed description of the VRML 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 the way light reflects off an object to create color:


[This section belong in the Conformance annex.]

For rendering systems that do not support the full OpenGL lighting model, the following simpler lighting model is recommended:

A transparency value of 0 is completely opaque, a value of 1 is completely transparent. Browsers need not support partial transparency, but should support at least fully transparent and fully opaque surfaces, treating transparency values >= 0.5 as fully transparent.

Issues for Low-End Rendering Systems. Many low-end PC rendering systems are not able to support the full range of the VRML material specification. For example, many systems do not render individual red, green and blue reflected values as specified in the specularColor field. The following table describes which Material fields are typically supported in popular low-end systems and suggests actions for browser implementors to take when a field is not supported.

 Field           Supported?    Suggested Action
 ambientIntensity No           Ignore
 diffuseColor     Yes          Use
 specularColor    No           Ignore
 emissiveColor    No           If diffuse == 0.8 0.8 0.8, use emissive
 shininess        Yes          Use
 transparency     Yes          if < 0.5 then opaque else transparent
 

The emissive color field is used when all other colors are black (0 0 0 ). Rendering systems which do not support specular color may nevertheless support a specular intensity. This should be derived by taking the dot product of the specified RGB specular value with the vector [.32 .57 .11]. This adjusts the color value to compensate for the variable sensitivity of the eye to colors.

Likewise, if a system supports ambient intensity but not color, the same thing should be done with the ambient color values to generate the ambient intensity. If a rendering system does not support per-object ambient values, it should set the ambient value for the entire scene at the average ambient value of all objects.

It is also expected that simpler rendering systems may be unable to support both diffuse and emissive objects in the same world. Also, many renderers will not support ambientIntensity with per-vertex colors specified with the Color node.


Variable Index

 o ambientIntensity
 o diffuseColor
 o emissiveColor
 o shininess
 o specularColor
 o transparency

Constructor Index

 o MaterialNode()

Method Index

 o createNodeDefinition(NodeDefinition)
Create the node definition.
 o getMaterial()
 o handleFieldChange(Field)
Handle a field change.
 o initFields()
Initialize field values.

Variables

 o ambientIntensity
  public SFFloat ambientIntensity
 o diffuseColor
  public SFColor diffuseColor
 o emissiveColor
  public SFColor emissiveColor
 o shininess
  public SFFloat shininess
 o specularColor
  public SFColor specularColor
 o transparency
  public SFFloat transparency

Constructors

 o MaterialNode
  public MaterialNode()

Methods

 o createNodeDefinition
  protected void createNodeDefinition(NodeDefinition def)
Create the node definition.
Overrides:
createNodeDefinition in class Node
 o initFields
  protected void initFields()
Initialize field values.
Overrides:
initFields in class Node
 o getMaterial
  public Material getMaterial()
 o handleFieldChange
  protected void handleFieldChange(Field f)
Handle a field change.
Overrides:
handleFieldChange in class Node

All Packages  Class Hierarchy  This Package  Previous  Next  Index