Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to KHR_technique_webgl extension spec #1296

Merged
merged 18 commits into from
Jul 21, 2018
Merged
537 changes: 155 additions & 382 deletions extensions/2.0/Khronos/KHR_technique_webgl/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should also be a schema for material.KHR_technique_webgl.schema.json.

"$schema" : "http://json-schema.org/draft-04/schema",
"title" : "KHR_technique_webgl glTF extension",
"title" : "KHR_techniques_webgl glTF extension",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a top-level description.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "allOf": [ { "$ref": "glTFProperty.schema.json" } ],

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: should all the new schemas inherit from glTFProperty or glTFChildOfRootProperty?

"type" : "object",
"properties" : {
"shaders" : {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think shaders, techniques, and programs should be required and empty arrays disallowed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@
"description" : "The index of the vertex shader."
},
"name" : {},
"glExtensions" : {
"type" : "array",
"description" : "Names of WebGL 1.0 extensions to enable.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a better description is Names of required WebGL 1.0 extensions

"items" : {
"type" : "string",
"minLength" : 1,
"maxLength" : 256
},
"default" : [],
"gltf_webgl" : "`getExtension()`"
},
Copy link
Contributor

@lilleyse lilleyse Mar 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of defaulting to an empty array require that minItems is 1, since this seems to be the convention in glTF 2. The property itself can stay optional.

"extensions" : {},
"extras" : {}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema" : "http://json-schema.org/draft-04/schema",
"title" : "shader",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the main spec, capitalize all the titles.

"type" : "object",
"description" : "A vertex or fragment shader.",
"description" : "A vertex or fragment shader. Exactly one of `uri` or `bufferView` must be provided.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"allOf" : [ { "$ref" : "glTFChildOfRootProperty.schema.json" } ],
"properties" : {
"uri" : {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below - for bufferView remove minLength.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
{
"$schema" : "http://json-schema.org/draft-04/schema",
"title" : "attribute",
"allOf" : [ { "$ref" : "glTFid.schema.json" } ],
"description" : "A dictionary object of strings that maps GLSL attribute names to technique parameter IDs."
"type" : "object",
"description" : "An attribute input to a technique, and an optional semantic.",
"allOf" : [ { "$ref" : "glTFProperty.schema.json" } ],
"properties" : {
"type" : {
"type" : "integer",
"description" : "The datatype.",
"enum" : [5120, 5121, 5122, 5123, 5124, 5125, 5126, 35664, 35665, 35666, 35667, 35668, 35669, 35670, 35671, 35672, 35673, 35674, 35675, 35676, 35678],
"gltf_enumNames" : ["BYTE", "UNSIGNED_BYTE", "SHORT", "UNSIGNED_SHORT", "INT", "UNSIGNED_INT", "FLOAT", "FLOAT_VEC2", "FLOAT_VEC3", "FLOAT_VEC4", "INT_VEC2", "INT_VEC3", "INT_VEC4", "BOOL", "BOOL_VEC2", "BOOL_VEC3", "BOOL_VEC4", "FLOAT_MAT2", "FLOAT_MAT3", "FLOAT_MAT4", "SAMPLER_2D"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove SAMPLER_2D from these two lists since it is not a valid attribute type.

"gltf_detailedDescription" : "The datatype. All valid values correspond to WebGL enums."
},
"semantic" : {
"type" : "string",
"description" : "Identifies a parameter with a well-known meaning.",
"gltf_detailedDescription" : "Identifies a parameter with a well-known meaning. Attribute semantics include `\"POSITION\"`, `\"NORMAL\"`, `\"TEXCOORD\"`, `\"COLOR\"`, `\"JOINT\"`, and `\"WEIGHT\"`. `\"TEXCOORD\"` and `\"COLOR\"` attribute semantic property names must be of the form `[semantic]_[set_index]`, e.g., `\"TEXCOORD_0\"`, `\"TEXCOORD_1\"`, `\"COLOR_1\"`, etc. For forward-compatibility, application-specific semantics must start with an underscore, e.g., \"_SIMULATION_TIME\"."
},
"extensions" : {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name is missing. Make sure it is included throughout in the schema files, wherever applicable.

"extras" : {}
},
"additionalProperties" : false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this used in other glTF schema files, so remove throughout.

"required" : ["type", "semantic"]
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,31 @@
"description" : "A template for material appearances.",
"allOf" : [ { "$ref" : "glTFChildOfRootProperty.schema.json" } ],
"properties": {
"parameters" : {
"type" : "object",
"description" : "A dictionary object of technique.parameters objects.",
"properties" : {
},
"additionalProperties" : {
"$ref" : "technique.parameters.schema.json"
},
"default" : {},
"gltf_detailedDescription" : "A dictionary object of technique.parameters objects. Each parameter defines an attribute or uniform input, and an optional semantic and value. Each parameter must be referenced by the attributes or uniforms dictionary properties."
},
"attributes" : {
"type" : "object",
"description" : "A dictionary object of strings that maps GLSL attribute names to technique parameter IDs.",
"description" : "A dictionary object of technique.attribute objects.",
"properties" : {
},
"additionalProperties" : {
"$ref" : "technique.attribute.schema.json"
},
"default" : {},
"gltf_detailedDescription" : "A dictionary object of strings that maps GLSL attribute names to technique parameter IDs. Each string must also be in the parameters dictionary object."
"gltf_detailedDescription" : "A dictionary object of technique.attribute objects. Each object defines an attribute input with a type and a semantic."
},
"program" : {
"allOf" : [ { "$ref" : "glTFid.schema.json" } ],
"description" : "The index of the program."
},
"uniforms" : {
"type" : "object",
"description" : "A dictionary object of strings that maps GLSL uniform names to technique parameter IDs.",
"description" : "A dictionary object of technique.uniform objects.",
"properties" : {
},
"additionalProperties" : {
"$ref" : "technique.uniform.schema.json"
},
"default" : {},
"gltf_detailedDescription" : "A dictionary object of strings that maps GLSL attribute names to technique parameter IDs. Each string must also be in the parameters dictionary object."
},
"states" : {
"allOf" : [ { "$ref" : "technique.states.schema.json" } ],
"description" : "Fixed-function rendering states.",
"default" : {}
"gltf_detailedDescription" : "A dictionary object of technique.uniform objects. Each object defines a uniform input with a type and an optional semantic and value."
},
"name" : {},
"extensions" : {},
Expand Down

This file was deleted.

This file was deleted.

Loading