Rendering component - extensions

Contents:

1. Explicit tangent vectors (Tangent node, X3DComposedGeometryNode.tangent field)

We add a new node:

Tangent : X3DGeometricPropertyNode {
  MFVec3f    [in,out]      vector      []        
}

This node can be used within the new field tangent of X3DComposedGeometryNode:

X3DComposedGeometryNode {
  ...
  SFNode     [in,out]      tangent     NULL      
}

If specified, this node holds tangent vectors information, necessary for bump mapping. The vector field should contain normalized tangent vectors, in the right-handed coordinate system.

The ordering of the tangent vectors is exactly the same as ordering of normal vectors would be, so e.g. X3DComposedGeometryNode.NormalPerVertex affects the interpretation of tangent vectors as well.

When reading data from glTF, we automatically import glTF information about tangent vectors into this node.

2. Mode to specify how per-vertex colors are applied (X3DColorNode.mode)

We add a new field to X3DColorNode (ancestor of Color and ColorRGBA that specify per-vertex colors):

X3DColorNode {
  ...
  SFString   []            mode        "REPLACE"   # ["REPLACE","MODULATE"]
}
  • "REPLACE" is the default, and is compatible with X3D 3.

  • "MODULATE" means to multiply per-vertex colors (with the same value as was replaced by `"REPLACE"`, like Material.diffuseColor or PhysicalMaterial.baseColor or UnlitMaterial.emissiveColor, with alpha added from XxxMaterial.transparency). This allows to achieve glTF-compatible behaviour.