materialDefinitions

December 17, 2019 ยท View on GitHub

The materialDefinitions object in I3S version 1.7 and higher are feature-compatible with glTF material but with the following exceptions. I3S material colors properties (baseColorFactor, emissiveFactor etc.) are assumed to be in the same color space as the textures, most commonly sRGB while in glTF they are interpreted as linear. glTF has separate definitions for properties like strength for occlusionTextureInfo and scale for normalTextureInfo. Further I3S has only one texture definition with factor that replaces strength and scale.

cmn::3DSceneLayer

Properties

PropertyTypeDescription
pbrMetallicRoughnesspbrMetallicRoughnessA set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of pbrMetallicRoughness apply.
normalTexturematerialTextureThe normal texture map. They are a special kind of texture that allow you to add surface detail such as bumps, grooves, and scratches to a model which catch the light as if they are represented by real geometry.
occlusionTexturematerialTextureThe occlusion texture map. The occlusion map is used to provide information about which areas of the model should receive high or low indirect lighting
emissiveTexturematerialTextureThe emissive texture map. A texture that receives no lighting, so the pixels are shown at full intensity.
emissiveFactornumber[3]The emissive color of the material.
alphaModestringDefines the meaning of the alpha-channel/alpha-mask.
Possible values are:
  • opaque: The rendered output is fully opaque and any alpha value is ignored.
  • mask: The rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alpha cutoff value. This mode is used to simulate geometry such as tree leaves or wire fences.
  • blend: The rendered output is combined with the background using the normal painting operation (i.e. the Porter and Duff over operator).
alphaCutoffnumberThe alpha cutoff value of the material (alphaMode=mask) default = 0.25.
doubleSidedbooleanSpecifies whether the material is double sided. For lightning, the opposite normals will be used when original normals are facing away from the camera. default=false.
cullFacestringWinding order is counterclockwise.
Possible values are:
  • none: Default. Must be none if doubleSided=True.
  • front: Cull front faces (i.e. faces with counter-clockwise winding order).
  • back: Cull back faces (i.e. faces with clockwise winding order).

Examples

Example: Metal material

 {
  "alphaMode": "mask",
  "alphaCutoff": 0.25,
  "pbrMetallicRoughness": {
    "baseColorFactor": [
      0.5,
      0.5,
      0.5,
      1.0
    ],
    "baseColorTexture": {
      "textureSetDefinitionId": 0,
      "texCoord": 0
    },
    "metallicFactor": 1,
    "roughnessFactor": 1,
    "metallicRoughnessTexture": {
      "textureSetDefinitionId": 2,
      "texCoord": 1
    }
  },
  "normalTexture": {
    "textureSetDefinitionId": 1,
    "factor": 2.0,
    "texCoord": 1
  }
}