Skip to content

Commit

Permalink
Merge pull request #419 from KhronosGroup/materials
Browse files Browse the repository at this point in the history
Update material and technique schema
  • Loading branch information
tparisi committed Oct 4, 2015
2 parents c4c80b0 + 106ed18 commit 6605488
Show file tree
Hide file tree
Showing 14 changed files with 85 additions and 261 deletions.
30 changes: 10 additions & 20 deletions specification/schema/examples/materials.json
Original file line number Diff line number Diff line change
@@ -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" : {
Expand Down
149 changes: 46 additions & 103 deletions specification/schema/examples/techniques.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : {
Expand Down
15 changes: 11 additions & 4 deletions specification/schema/material.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@
"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.",
"required" : true
"technique" : {
"extends" : { "$ref" : "glTFid.schema.json" },
"description" : "The id (JSON property name) of the technique. TODO: define technique when this is undefined",
},
"values" : {
"properties" : {
},
"additionalProperties" : {
"$ref" : "materialValues.schema.json"
},
"default" : {}
}
},
"additionalProperties" : false
Expand Down
22 changes: 0 additions & 22 deletions specification/schema/materialInstanceTechnique.schema.json

This file was deleted.

23 changes: 18 additions & 5 deletions specification/schema/technique.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 0 additions & 24 deletions specification/schema/techniquePass.schema.json

This file was deleted.

17 changes: 0 additions & 17 deletions specification/schema/techniquePassDetails.schema.json

This file was deleted.

30 changes: 0 additions & 30 deletions specification/schema/techniquePassDetailsCommonProfile.schema.json

This file was deleted.

This file was deleted.

30 changes: 0 additions & 30 deletions specification/schema/techniquePassInstanceProgram.schema.json

This file was deleted.

0 comments on commit 6605488

Please sign in to comment.