From a7d76e5ce0725035b21626d49469f2516d698832 Mon Sep 17 00:00:00 2001 From: Alexey Knyazev Date: Fri, 20 Oct 2017 21:48:47 +0400 Subject: [PATCH] Add more restrictions on indexed attribute semantics --- specification/2.0/README.md | 4 +++- specification/2.0/schema/textureInfo.schema.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/specification/2.0/README.md b/specification/2.0/README.md index dbf59530e1..56e40a1159 100644 --- a/specification/2.0/README.md +++ b/specification/2.0/README.md @@ -746,6 +746,8 @@ Valid accessor type and component type for each attribute semantic property are `TEXCOORD`, `COLOR`, `JOINTS`, and `WEIGHTS` attribute semantic property names must be of the form `[semantic]_[set_index]`, e.g., `TEXCOORD_0`, `TEXCOORD_1`, `COLOR_0`. Client implementations must support at least two UV texture coordinate sets, one vertex color, and one joints/weights set. Extensions can add additional property names, accessor types, and/or accessor component types. +All indices for indexed attribute semantics, must start with 0 and be continuous: `TEXCOORD_0`, `TEXCOORD_1`, etc. + > **Implementation note:** Each primitive corresponds to one WebGL draw call (engines are, of course, free to batch draw calls). When a primitive's `indices` property is defined, it references the accessor to use for index data, and GL's `drawElements` function should be used. When the `indices` property is not defined, GL's `drawArrays` function should be used with a count equal to the count property of any of the accessors referenced by the `attributes` property (they are all equal for a given primitive). > **Implementation note:** When normals are not specified, client implementations should calculate flat normals. @@ -3703,7 +3705,7 @@ The index of the texture. #### textureInfo.texCoord -This integer value is used to construct a string in the format TEXCOORD_ which is a reference to a key in mesh.primitives.attributes (e.g. A value of 0 corresponds to TEXCOORD_0). +This integer value is used to construct a string in the format `TEXCOORD_` which is a reference to a key in mesh.primitives.attributes (e.g. A value of `0` corresponds to `TEXCOORD_0`). Mesh must have corresponding texture coordinate attributes for the material to be applicable to it. * **Type**: `integer` * **Required**: No, default: `0` diff --git a/specification/2.0/schema/textureInfo.schema.json b/specification/2.0/schema/textureInfo.schema.json index c214f7f04e..86a2df5f6a 100644 --- a/specification/2.0/schema/textureInfo.schema.json +++ b/specification/2.0/schema/textureInfo.schema.json @@ -14,7 +14,7 @@ "description": "The set index of texture's TEXCOORD attribute used for texture coordinate mapping.", "default": 0, "minimum": 0, - "gltf_detailedDescription": "This integer value is used to construct a string in the format TEXCOORD_ which is a reference to a key in mesh.primitives.attributes (e.g. A value of 0 corresponds to TEXCOORD_0)." + "gltf_detailedDescription": "This integer value is used to construct a string in the format `TEXCOORD_` which is a reference to a key in mesh.primitives.attributes (e.g. A value of `0` corresponds to `TEXCOORD_0`). Mesh must have corresponding texture coordinate attributes for the material to be applicable to it." }, "extensions": { }, "extras": { }