Skip to content

Latest commit

 

History

History
106 lines (87 loc) · 2.61 KB

geometryBuffer.cmn.md

File metadata and controls

106 lines (87 loc) · 2.61 KB

geometryBuffer

Mesh Geometry Description

Important: The order of the vertex attributes in the buffer is fixed to simplify binary parsing:

position
normal
uv0
uv1
color
uvRegion
featureId
faceRange

or

compressedAttributes

Important:

  • Attribute that are present are store contiguously in the corresponding geometry buffers.
  • All vertex attributes ( except compressedAttributes) have a fixed size that may be computed as: #component * sizeof( type ) * {#vertices or #features}

Related:

cmn::geometryDefinition

Properties

Property Type Description
offset integer The number of bytes to skip from the beginning of the binary buffer. Useful to describe 'legacy' buffer that have a header. Default=0.
position geometryPosition Vertex positions relative to oriented-bounding-box center.
normal geometryNormal Face/vertex normal.
uv0 geometryUV First set of UV coordinates. Only applies to textured mesh.
color geometryColor The colors attribute.
uvRegion geometryUVRegion UV regions, used for repeated textures in texture atlases.
featureId geometryFeatureID FeatureId attribute.
faceRange geometryFaceRange Face range for a feature.
compressedAttributes compressedAttributes Compressed attributes. Cannot be combined with any other attributes.

Examples

Example: I3S v1.6 equivalent geometry buffer definition (with UV regions)

 {
  "offset": 8,
  "position": {
    "type": "Float32",
    "component": 3
  },
  "normal": {
    "type": "Float32",
    "component": 3
  },
  "uv0": {
    "type": "Float32",
    "component": 2
  },
  "color": {
    "type": "UInt8",
    "component": 4
  },
  "uvRegion": {
    "type": "UInt16",
    "component": 4
  },
  "featureId": {
    "type": "UInt64",
    "component": 1,
    "binding": "per-feature"
  },
  "faceRange": {
    "type": "UInt32",
    "component": 2,
    "binding": "per-feature"
  }
} 

Example: A compressed geometry buffer definition with featureId (without normal, with UV regions)

 {
  "compressedAttributes": {
    "encoding": "draco",
    "attributes": [
      "position",
      "uv0",
      "color",
      "feature-index",
      "uv-region"
    ]
  }
}