defaultGeometrySchema [common profiles]

December 17, 2019 ยท View on GitHub

The defaultGeometry schema is used in stores where all arrayBufferView geometry declarations use the same pattern for face and vertex elements. This schema reduces redundancies of arrayBufferView geometry declarations in a store and reuses the geometryAttribute type from featureData. Only valueType and valuesPerElement are required.

Geometry buffer

fieldNametypedescription
vertexCountUINT32Number of vertices
featureCountUINT32Number of features.
positionFloat32[3*vertex count]Vertex x,y,z positions.
normalFloat32[3*vertex count]Normals x,y,z vectors.
uv0Float32[2*vertex count]Texture coordinates.
colorUInt8[4*vertex countRGBA colors.
idUInt64[feature count]Feature IDs.
faceRangeUInt32[2*feature countInclusive range of the mesh triangles belonging to each feature in the featureID array.
regionUINT16[4*vertex count]UV region for repeated textures.

cmn::store, psl::store

Properties

PropertyTypeDescription
geometryTypestringLow-level default geometry type. If defined, all geometries in the store are expected to have this type.
Must be:
  • triangles
topologystringDeclares the topology of embedded geometry attributes. When 'Indexed', the indices must also be declared in the geometry schema ('faces') and precede the vertexAttribute data.
Possible values are:
  • PerAttributeArray
  • Indexed: When Indexed, the indices must also be declared in the geometry schema (faces) and precede the vertexAttribute data.
headerheaderAttribute[]Defines header fields in the geometry resources of this store that precede the vertex (and index) data.
orderingstring[]Defines the ordering of the vertex Attributes.
vertexAttributesvertexAttributeDeclaration of the attributes per vertex in the geometry, such as position, normals or texture coordinates.
facesvertexAttributeDeclaration of the indices into vertex attributes that define faces in the geometry, such as position, normals or texture coordinates.
featureAttributeOrderstring[]Provides the order of the keys in featureAttributes, if present.
featureAttributesfeatureAttributeDeclaration of the attributes per feature in the geometry, such as feature ID or face range.

Note: properties in bold are required

Examples

Example: defaultGeometrySchema for 3D Object and integrated mesh scene layer

 {
  "geometryType": "triangles",
  "header": [
    {
      "property": "vertexCount",
      "type": "UInt32"
    },
    {
      "property": "featureCount",
      "type": "UInt32"
    }
  ],
  "topology": "PerAttributeArray",
  "ordering": [
    "position",
    "normal",
    "uv0",
    "color"
  ],
  "vertexAttributes": {
    "position": {
      "valueType": "Float32",
      "valuesPerElement": 3
    },
    "normal": {
      "valueType": "Float32",
      "valuesPerElement": 3
    },
    "uv0": {
      "valueType": "Float32",
      "valuesPerElement": 2
    },
    "color": {
      "valueType": "UInt8",
      "valuesPerElement": 4
    }
  },
  "featureAttributeOrder": [
    "id",
    "faceRange"
  ],
  "featureAttributes": {
    "id": {
      "valueType": "UInt64",
      "valuesPerElement": 1
    },
    "faceRange": {
      "valueType": "UInt32",
      "valuesPerElement": 2
    }
  }
}