From 823c18438a36c3f9f91ea4369f4770286f4256a5 Mon Sep 17 00:00:00 2001 From: Patrick Cozzi Date: Tue, 29 Sep 2015 20:17:16 -0400 Subject: [PATCH 1/3] Update material and technique --- specification/schema/examples/materials.json | 30 ++-- specification/schema/examples/techniques.json | 149 ++++++------------ specification/schema/material.schema.json | 14 +- ...schema.json => materialValues.schema.json} | 0 specification/schema/technique.schema.json | 23 ++- ...ma.json => techniqueAttribute.schema.json} | 0 .../schema/techniquePass.schema.json | 24 --- .../schema/techniquePassDetails.schema.json | 17 -- ...hniquePassDetailsCommonProfile.schema.json | 30 ---- ...sCommonProfileTexcoordBindings.schema.json | 6 - .../techniquePassInstanceProgram.schema.json | 30 ---- ...chema.json => techniqueStates.schema.json} | 0 ...hema.json => techniqueUniform.schema.json} | 0 13 files changed, 85 insertions(+), 238 deletions(-) rename specification/schema/{materialInstanceTechniqueValues.schema.json => materialValues.schema.json} (100%) rename specification/schema/{techniquePassInstanceProgramAttribute.schema.json => techniqueAttribute.schema.json} (100%) delete mode 100644 specification/schema/techniquePass.schema.json delete mode 100644 specification/schema/techniquePassDetails.schema.json delete mode 100644 specification/schema/techniquePassDetailsCommonProfile.schema.json delete mode 100644 specification/schema/techniquePassDetailsCommonProfileTexcoordBindings.schema.json delete mode 100644 specification/schema/techniquePassInstanceProgram.schema.json rename specification/schema/{techniquePassStates.schema.json => techniqueStates.schema.json} (100%) rename specification/schema/{techniquePassInstanceProgramUniform.schema.json => techniqueUniform.schema.json} (100%) diff --git a/specification/schema/examples/materials.json b/specification/schema/examples/materials.json index 0ebf8e5c1e..a7e9006ffc 100644 --- a/specification/schema/examples/materials.json +++ b/specification/schema/examples/materials.json @@ -1,26 +1,16 @@ { "materials" : { "material_id": { - "instanceTechnique": { - "technique": "technique_id", - "values": { - "ambient": [ - 0, - 0, - 0, - 1 - ], - "diffuse": "texture_image_0", - "shininess": 38.4 - }, - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } + "technique": "technique_id", + "values": { + "ambient": [ + 0, + 0, + 0, + 1 + ], + "diffuse": "texture_image_0", + "shininess": 38.4 }, "name": "user-defined material name", "extensions" : { diff --git a/specification/schema/examples/techniques.json b/specification/schema/examples/techniques.json index 343d2ce3a7..a8cd6d7e12 100644 --- a/specification/schema/examples/techniques.json +++ b/specification/schema/examples/techniques.json @@ -68,112 +68,55 @@ "type": 35666 } }, - "pass" : "pass_id", - "passes" : { - "pass_id" : { - "details": { - "commonProfile": { - "lightingModel": "Blinn", - "parameters": [ - "ambient", - "diffuse", - "lightColor", - "lightTransform", - "modelViewMatrix", - "projectionMatrix", - "normalMatrix" - ], - "texcoordBindings": { - "diffuse": "TEXCOORD_0" - }, - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras": { - "doubleSided": false - } - }, - "type": "COLLADA-1.4.1/commonProfile", - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } - }, - "instanceProgram": { - "attributes": { - "a_position": "position", - "a_normal": "normal", - "a_texcoord0": "texcoord0", - "a_joint": "joint", - "a_jointMatrix": "jointMatrix", - "a_weight": "weight" - }, - "program": "program_id", - "uniforms": { - "u_ambient": "ambient", - "u_diffuse": "diffuse", - "u_lightColor": "lightColor", - "u_lightTransformMatrix": "lightTransform", - "u_modelViewMatrix": "modelViewMatrix", - "u_projectionMatrix": "projectionMatrix", - "u_normalMatrix": "normalMatrix" - }, - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } - }, - "states" : { - "enable" : [3042, 2884, 2929, 32823, 32926, 3089], - "functions" : { - "blendColor": [0.0, 0.0, 0.0, 0.0], - "blendEquationSeparate" : [32774, 32774], - "blendFuncSeparate" : [1, 1, 0, 0], - "colorMask" : [true, true, true, true], - "cullFace" : [1029], - "depthFunc" : [513], - "depthMask" : [true], - "depthRange" : [0.0, 1.0], - "frontFace" : [2305], - "lineWidth" : [1.0], - "polygonOffset" : [0.0, 0.0], - "scissor" : [0, 0, 0, 0], - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } - }, - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, - "extras" : { - "Application specific" : "The extra object can contain any properties." - } + "attributes": { + "a_position": "position", + "a_normal": "normal", + "a_texcoord0": "texcoord0", + "a_joint": "joint", + "a_jointMatrix": "jointMatrix", + "a_weight": "weight" + }, + "program": "program_id", + "uniforms": { + "u_ambient": "ambient", + "u_diffuse": "diffuse", + "u_lightColor": "lightColor", + "u_lightTransformMatrix": "lightTransform", + "u_modelViewMatrix": "modelViewMatrix", + "u_projectionMatrix": "projectionMatrix", + "u_normalMatrix": "normalMatrix" + }, + "states" : { + "enable" : [3042, 2884, 2929, 32823, 32926, 3089], + "functions" : { + "blendColor": [0.0, 0.0, 0.0, 0.0], + "blendEquationSeparate" : [32774, 32774], + "blendFuncSeparate" : [1, 1, 0, 0], + "colorMask" : [true, true, true, true], + "cullFace" : [1029], + "depthFunc" : [513], + "depthMask" : [true], + "depthRange" : [0.0, 1.0], + "frontFace" : [2305], + "lineWidth" : [1.0], + "polygonOffset" : [0.0, 0.0], + "scissor" : [0, 0, 0, 0], + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } }, - "extensions" : { - "extension_name" : { - "extension specific" : "value" - } - }, "extras" : { "Application specific" : "The extra object can contain any properties." - } + } + }, + "extensions" : { + "extension_name" : { + "extension specific" : "value" + } + }, + "extras" : { + "Application specific" : "The extra object can contain any properties." } }, "extensions" : { diff --git a/specification/schema/material.schema.json b/specification/schema/material.schema.json index 63bd2d2323..f9ed4907c2 100644 --- a/specification/schema/material.schema.json +++ b/specification/schema/material.schema.json @@ -5,10 +5,18 @@ "description" : "An instance of a technique with parameter value overrides.", "extends" : { "$ref" : "glTFChildOfRootProperty.schema.json" }, "properties": { - "instanceTechnique" : { - "extends" : { "$ref" : "materialInstanceTechnique.schema.json" }, - "description" : "An instance of a technique with parameter value overrides.", + "technique" : { + "extends" : { "$ref" : "glTFid.schema.json" }, + "description" : "The id (JSON property name) of the technique.", "required" : true + }, + "values" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "materialValues.schema.json" + }, + "default" : {} } }, "additionalProperties" : false diff --git a/specification/schema/materialInstanceTechniqueValues.schema.json b/specification/schema/materialValues.schema.json similarity index 100% rename from specification/schema/materialInstanceTechniqueValues.schema.json rename to specification/schema/materialValues.schema.json diff --git a/specification/schema/technique.schema.json b/specification/schema/technique.schema.json index 4d4af0bbe2..3195f93763 100644 --- a/specification/schema/technique.schema.json +++ b/specification/schema/technique.schema.json @@ -13,18 +13,31 @@ }, "default" : {} }, - "pass" : { + "attributes" : { + "properties" : { + }, + "additionalProperties" : { + "$ref" : "techniqueAttribute.schema.json" + }, + "default" : {} + }, + "program" : { "extends" : { "$ref" : "glTFid.schema.json" }, - "description" : "The id (JSON property name) of the default pass to use.", + "description" : "Specifies the program id (property name).", "required" : true }, - "passes" : { + "uniforms" : { "properties" : { }, "additionalProperties" : { - "$ref" : "techniquePass.schema.json" + "$ref" : "techniqueUniform.schema.json" }, - "required" : true + "default" : {} + }, + "states" : { + "extends" : { "$ref" : "techniqueStates.schema.json" }, + "description" : "Fixed-function rendering states.", + "default" : {} } }, "additionalProperties" : false diff --git a/specification/schema/techniquePassInstanceProgramAttribute.schema.json b/specification/schema/techniqueAttribute.schema.json similarity index 100% rename from specification/schema/techniquePassInstanceProgramAttribute.schema.json rename to specification/schema/techniqueAttribute.schema.json diff --git a/specification/schema/techniquePass.schema.json b/specification/schema/techniquePass.schema.json deleted file mode 100644 index 6e6ddbd4df..0000000000 --- a/specification/schema/techniquePass.schema.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "technique/pass", - "type" : "object", - "description" : "The shader program and render states for a rendering pass.", - "extends" : { "$ref" : "glTFProperty.schema.json" }, - "properties": { - "details" : { - "extends" : { "$ref" : "techniquePassDetails.schema.json" }, - "description" : "Information to reconstruct a shader program." - }, - "instanceProgram" : { - "extends" : { "$ref" : "techniquePassInstanceProgram.schema.json" }, - "description" : "Shader program and attribute and uniform inputs.", - "required" : true - }, - "states" : { - "extends" : { "$ref" : "techniquePassStates.schema.json" }, - "description" : "Fixed-function rendering states.", - "default" : {} - } - }, - "additionalProperties" : false -} diff --git a/specification/schema/techniquePassDetails.schema.json b/specification/schema/techniquePassDetails.schema.json deleted file mode 100644 index 4e33663483..0000000000 --- a/specification/schema/techniquePassDetails.schema.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "technique/pass/details", - "type" : "object", - "extends" : { "$ref" : "glTFProperty.schema.json" }, - "properties" : { - "commonProfile" : { - "$ref" : "techniquePassDetailsCommonProfile.schema.json" - }, - "type" : { - "type" : "string", - "description" : "TODO", - "required" : true - } - }, - "additionalProperties" : false -} diff --git a/specification/schema/techniquePassDetailsCommonProfile.schema.json b/specification/schema/techniquePassDetailsCommonProfile.schema.json deleted file mode 100644 index 18a108ca97..0000000000 --- a/specification/schema/techniquePassDetailsCommonProfile.schema.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "technique/pass/details/commonProfile", - "type" : "object", - "description" : "TODO", - "extends" : { "$ref" : "glTFProperty.schema.json" }, - "properties" : { - "lightingModel" : { - "type" : "string", - "description" : "TODO", - "required" : true - }, - "parameters" : { - "type" : "array", - "description" : "TODO", - "items" : { - "type" : "string", - "minLength" : 1 - } - }, - "texcoordBindings" : { - "properties" : { - }, - "additionalProperties" : { - "$ref" : "techniquePassDetailsCommonProfileTexcoordBindings.schema.json" - } - } - }, - "additionalProperties" : false -} diff --git a/specification/schema/techniquePassDetailsCommonProfileTexcoordBindings.schema.json b/specification/schema/techniquePassDetailsCommonProfileTexcoordBindings.schema.json deleted file mode 100644 index ffdf16c7c3..0000000000 --- a/specification/schema/techniquePassDetailsCommonProfileTexcoordBindings.schema.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "technique/pass/details/commonProfile/texcoordBindings", - "type" : "string", - "description" : "TODO" -} diff --git a/specification/schema/techniquePassInstanceProgram.schema.json b/specification/schema/techniquePassInstanceProgram.schema.json deleted file mode 100644 index 1215330ff4..0000000000 --- a/specification/schema/techniquePassInstanceProgram.schema.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "technique/pass/instanceProgram", - "type" : "object", - "extends" : { "$ref" : "glTFProperty.schema.json" }, - "properties" : { - "attributes" : { - "properties" : { - }, - "additionalProperties" : { - "$ref" : "techniquePassInstanceProgramAttribute.schema.json" - }, - "default" : {} - }, - "program" : { - "extends" : { "$ref" : "glTFid.schema.json" }, - "description" : "Specifies the program id (property name).", - "required" : true - }, - "uniforms" : { - "properties" : { - }, - "additionalProperties" : { - "$ref" : "techniquePassInstanceProgramUniform.schema.json" - }, - "default" : {} - } - }, - "additionalProperties" : false -} diff --git a/specification/schema/techniquePassStates.schema.json b/specification/schema/techniqueStates.schema.json similarity index 100% rename from specification/schema/techniquePassStates.schema.json rename to specification/schema/techniqueStates.schema.json diff --git a/specification/schema/techniquePassInstanceProgramUniform.schema.json b/specification/schema/techniqueUniform.schema.json similarity index 100% rename from specification/schema/techniquePassInstanceProgramUniform.schema.json rename to specification/schema/techniqueUniform.schema.json From 6c463d9235434c255575d9f50f8db3a51d187814 Mon Sep 17 00:00:00 2001 From: Patrick Cozzi Date: Tue, 29 Sep 2015 20:19:57 -0400 Subject: [PATCH 2/3] material.technique is optional --- specification/schema/material.schema.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/specification/schema/material.schema.json b/specification/schema/material.schema.json index f9ed4907c2..44a52f7278 100644 --- a/specification/schema/material.schema.json +++ b/specification/schema/material.schema.json @@ -7,8 +7,7 @@ "properties": { "technique" : { "extends" : { "$ref" : "glTFid.schema.json" }, - "description" : "The id (JSON property name) of the technique.", - "required" : true + "description" : "The id (JSON property name) of the technique. TODO: define technique when this is undefined", }, "values" : { "properties" : { From 106ed189c1d8c6ee190b970452e8125d9c6bff75 Mon Sep 17 00:00:00 2001 From: Patrick Cozzi Date: Tue, 29 Sep 2015 20:20:30 -0400 Subject: [PATCH 3/3] Delete unused file --- .../materialInstanceTechnique.schema.json | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 specification/schema/materialInstanceTechnique.schema.json diff --git a/specification/schema/materialInstanceTechnique.schema.json b/specification/schema/materialInstanceTechnique.schema.json deleted file mode 100644 index 0e6356fd75..0000000000 --- a/specification/schema/materialInstanceTechnique.schema.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-03/schema", - "title" : "material/instanceTechnique", - "type" : "object", - "extends" : { "$ref" : "glTFProperty.schema.json" }, - "properties": { - "technique" : { - "extends" : { "$ref" : "glTFid.schema.json" }, - "description" : "The id (JSON property name) of the technique.", - "required" : true - }, - "values" : { - "properties" : { - }, - "additionalProperties" : { - "$ref" : "materialInstanceTechniqueValues.schema.json" - }, - "default" : {} - } - }, - "additionalProperties" : false -}