Skip to content

Commit

Permalink
Tighten up byteStride usage
Browse files Browse the repository at this point in the history
  • Loading branch information
lexaknyazev committed Apr 30, 2017
1 parent 5e38721 commit 6e6ae37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion specification/2.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ When nor `sparse`, neither `bufferView` is defined, `min` and `max` properties c

The offset of an `accessor` into a `bufferView` (i.e., `accessor.byteOffset`) and the offset of an `accessor` into a `buffer` (i.e., `accessor.byteOffset + bufferView.byteOffset`) must be a multiple of the size of the accessor's component type.

When `byteStride` of referenced `bufferView` equals `0` (or not defined), it means that accessor elements are tightly packed, i.e., effective stride equals to the size of the element. Such effective stride must be the same across all accessors that use that `bufferView`. When `bufferView.byteStride` is defined, it must be a multiple of the size of the accessor's component type.
When `byteStride` of referenced `bufferView` is not defined, it means that accessor elements are tightly packed, i.e., effective stride equals the size of the element. When `byteStride` is defined, it must be a multiple of the size of the accessor's component type. `byteStride` must be defined, when two or more accessors use the same `bufferView`.

Each `accessor` must fit its `bufferView`, i.e., `accessor.byteOffset + STRIDE * (accessor.count - 1) + SIZE_OF_ELEMENT` must be less than or equal to `bufferView.length`.

Expand Down
7 changes: 3 additions & 4 deletions specification/2.0/schema/bufferView.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
"byteStride": {
"type": "integer",
"description": "The stride, in bytes.",
"minimum": 0,
"maximum": 255,
"default": 0,
"gltf_detailedDescription": "The stride, in bytes, between vertex attributes. When this is zero, data is tightly packed.",
"minimum": 4,
"maximum": 252,
"gltf_detailedDescription": "The stride, in bytes, between vertex attributes. When this is not defined, data is tightly packed. When two or more accessors use the same bufferView, this field must be defined.",
"gltf_webgl": "`vertexAttribPointer()` stride parameter"
},
"target": {
Expand Down

0 comments on commit 6e6ae37

Please sign in to comment.