diff --git a/2.0/AdvancedMaterial/README.md b/2.0/AdvancedMaterial/README.md deleted file mode 100644 index 20c4c3c9..00000000 --- a/2.0/AdvancedMaterial/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# AdvancedMaterial - -## Screenshot - -![screenshot](screenshot/screenshot.png) - -## License Information - -Public domain ([CC0](https://creativecommons.org/publicdomain/zero/1.0/)) - -## Data layout - -The following image shows the data layout of this sample: - -![triangle](screenshot/triangle.png) - diff --git a/2.0/AdvancedMaterial/glTF-Embedded-buffer/AdvancedMaterial.gltf b/2.0/AdvancedMaterial/glTF-Embedded-buffer/AdvancedMaterial.gltf deleted file mode 100644 index c4d651f7..00000000 --- a/2.0/AdvancedMaterial/glTF-Embedded-buffer/AdvancedMaterial.gltf +++ /dev/null @@ -1,171 +0,0 @@ -{ - "scenes" : { - "scene0" : { - "nodes" : [ "node0", "node1" ] - } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] - }, - "node1" : { - "translation" : [ 1.0, 0.0, 0.0 ], - "rotation" : [ -0.383, 0.0, 0.0, 0.924 ], - "meshes" : [ "mesh0" ] - } - }, - - "meshes" : { - "mesh0" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "advancedMaterial" - } ] - } - }, - - "materials" : { - "advancedMaterial" : { - "technique" : "advancedTechnique" - } - }, - "techniques": { - "advancedTechnique": { - "program": "advancedProgram", - "attributes": { - "a_position": "positionParameter", - "a_normal": "normalParameter" - }, - "uniforms": { - "u_modelViewMatrix": "modelViewMatrixParameter", - "u_normalMatrix": "normalMatrixParameter", - "u_projectionMatrix": "projectionMatrixParameter", - "u_ambient": "ambientParameter", - "u_diffuse": "diffuseParameter", - "u_specular": "specularParameter", - "u_shininess": "shininessParameter" - }, - "parameters": { - "positionParameter" : { - "type": 35665, - "semantic": "POSITION" - }, - "normalParameter" : { - "type": 35665, - "semantic": "NORMAL" - }, - "modelViewMatrixParameter": { - "type": 35676, - "semantic": "MODELVIEW" - }, - "normalMatrixParameter": { - "type": 35675, - "semantic": "MODELVIEWINVERSETRANSPOSE" - }, - "projectionMatrixParameter": { - "type": 35676, - "semantic": "PROJECTION" - }, - "ambientParameter": { - "type": 35666, - "value": [ 0.1, 0.1, 0.1, 1.0 ] - }, - "diffuseParameter": { - "type": 35666, - "value": [ 0.9, 0.5, 0.1, 1.0 ] - }, - "specularParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "shininessParameter": { - "type": 5126, - "value": [ 40.0 ] - } - }, - "states": { - "enable": [ - 2929, - 2884 - ] - } - } - }, - "programs": { - "advancedProgram": { - "vertexShader": "advancedVertexShader", - "fragmentShader": "advancedFragmentShader", - "attributes": [ - "a_position", - "a_normal" - ] - } - }, - "shaders": { - "advancedVertexShader": { - "type": 35633, - "uri": "advanced.vert" - }, - "advancedFragmentShader": { - "type": 35632, - "uri": "advanced.frag" - } - }, - - "buffers" : { - "geometryBuffer" : { - "uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8=", - "byteLength" : 80 - } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 0, - "byteLength" : 6, - "target" : 34963 - }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 8, - "byteLength" : 72, - "target" : 34962 - } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", - "byteOffset" : 0, - "componentType" : 5123, - "count" : 3, - "type" : "SCALAR", - "max" : [ 2 ], - "min" : [ 0 ] - }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 3, - "type" : "VEC3", - "max" : [ 1.0, 1.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0 ] - }, - "normalsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 36, - "componentType" : 5126, - "count" : 3, - "type" : "VEC3", - "max" : [ 0.0, 0.0, 1.0 ], - "min" : [ 0.0, 0.0, 1.0 ] - } - }, - "asset" : { - "version" : "1.1" - } -} diff --git a/2.0/AdvancedMaterial/glTF-Embedded-buffer/advanced.frag b/2.0/AdvancedMaterial/glTF-Embedded-buffer/advanced.frag deleted file mode 100644 index 9d47ed85..00000000 --- a/2.0/AdvancedMaterial/glTF-Embedded-buffer/advanced.frag +++ /dev/null @@ -1,43 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -varying vec3 v_position; -varying vec3 v_normal; - -uniform vec4 u_ambient; -uniform vec4 u_diffuse; -uniform vec4 u_specular; -uniform float u_shininess; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec3 normal = normalize(v_normal); - vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - vec3 diffuseLight = vec3(0.0, 0.0, 0.0); - vec3 lightColor = vec3(1.0, 1.0, 1.0); - vec4 ambient = u_ambient; - vec4 diffuse = u_diffuse; - vec4 specular = u_specular; - - vec3 specularLight = vec3(0.0, 0.0, 0.0); - { - float specularIntensity = 0.0; - float attenuation = 1.0; - vec3 l = normalize(v_light0Direction); - vec3 viewDir = -normalize(v_position); - vec3 h = normalize(l+viewDir); - specularIntensity = max(0.0, pow(max(dot(normal,h), 0.0) , u_shininess)) * attenuation; - specularLight += lightColor * specularIntensity; - diffuseLight += lightColor * max(dot(normal,l), 0.0) * attenuation; - } - specular.rgb *= specularLight; - diffuse.rgb *= diffuseLight; - color.rgb += ambient.xyz; - color.rgb += diffuse.xyz; - color.rgb += specular.xyz; - color.a = diffuse.a; - gl_FragColor = color; -} diff --git a/2.0/AdvancedMaterial/glTF-Embedded-buffer/advanced.vert b/2.0/AdvancedMaterial/glTF-Embedded-buffer/advanced.vert deleted file mode 100644 index e5d134ad..00000000 --- a/2.0/AdvancedMaterial/glTF-Embedded-buffer/advanced.vert +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -attribute vec3 a_position; -attribute vec3 a_normal; - -uniform mat3 u_normalMatrix; -uniform mat4 u_modelViewMatrix; -uniform mat4 u_projectionMatrix; - -varying vec3 v_position; -varying vec3 v_normal; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec4 pos = u_modelViewMatrix * vec4(a_position, 1.0); - v_normal = u_normalMatrix * a_normal; - v_position = pos.xyz; - v_light0Direction = mat3(u_modelViewMatrix) * vec3(1.0, 1.0, 1.0); - gl_Position = u_projectionMatrix * pos; -} diff --git a/2.0/AdvancedMaterial/glTF/AdvancedMaterial.gltf b/2.0/AdvancedMaterial/glTF/AdvancedMaterial.gltf deleted file mode 100644 index af65a899..00000000 --- a/2.0/AdvancedMaterial/glTF/AdvancedMaterial.gltf +++ /dev/null @@ -1,171 +0,0 @@ -{ - "scenes" : { - "scene0" : { - "nodes" : [ "node0", "node1" ] - } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] - }, - "node1" : { - "translation" : [ 1.0, 0.0, 0.0 ], - "rotation" : [ -0.383, 0.0, 0.0, 0.924 ], - "meshes" : [ "mesh0" ] - } - }, - - "meshes" : { - "mesh0" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "advancedMaterial" - } ] - } - }, - - "materials" : { - "advancedMaterial" : { - "technique" : "advancedTechnique" - } - }, - "techniques": { - "advancedTechnique": { - "program": "advancedProgram", - "attributes": { - "a_position": "positionParameter", - "a_normal": "normalParameter" - }, - "uniforms": { - "u_modelViewMatrix": "modelViewMatrixParameter", - "u_normalMatrix": "normalMatrixParameter", - "u_projectionMatrix": "projectionMatrixParameter", - "u_ambient": "ambientParameter", - "u_diffuse": "diffuseParameter", - "u_specular": "specularParameter", - "u_shininess": "shininessParameter" - }, - "parameters": { - "positionParameter" : { - "type": 35665, - "semantic": "POSITION" - }, - "normalParameter" : { - "type": 35665, - "semantic": "NORMAL" - }, - "modelViewMatrixParameter": { - "type": 35676, - "semantic": "MODELVIEW" - }, - "normalMatrixParameter": { - "type": 35675, - "semantic": "MODELVIEWINVERSETRANSPOSE" - }, - "projectionMatrixParameter": { - "type": 35676, - "semantic": "PROJECTION" - }, - "ambientParameter": { - "type": 35666, - "value": [ 0.1, 0.1, 0.1, 1.0 ] - }, - "diffuseParameter": { - "type": 35666, - "value": [ 0.9, 0.5, 0.1, 1.0 ] - }, - "specularParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "shininessParameter": { - "type": 5126, - "value": [ 40.0 ] - } - }, - "states": { - "enable": [ - 2929, - 2884 - ] - } - } - }, - "programs": { - "advancedProgram": { - "vertexShader": "advancedVertexShader", - "fragmentShader": "advancedFragmentShader", - "attributes": [ - "a_position", - "a_normal" - ] - } - }, - "shaders": { - "advancedVertexShader": { - "type": 35633, - "uri": "advanced.vert" - }, - "advancedFragmentShader": { - "type": 35632, - "uri": "advanced.frag" - } - }, - - "buffers" : { - "geometryBuffer" : { - "uri" : "triangle.bin", - "byteLength" : 80 - } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 0, - "byteLength" : 6, - "target" : 34963 - }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 8, - "byteLength" : 72, - "target" : 34962 - } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", - "byteOffset" : 0, - "componentType" : 5123, - "count" : 3, - "type" : "SCALAR", - "max" : [ 2 ], - "min" : [ 0 ] - }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 3, - "type" : "VEC3", - "max" : [ 1.0, 1.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0 ] - }, - "normalsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 36, - "componentType" : 5126, - "count" : 3, - "type" : "VEC3", - "max" : [ 0.0, 0.0, 1.0 ], - "min" : [ 0.0, 0.0, 1.0 ] - } - }, - "asset" : { - "version" : "1.1" - } -} diff --git a/2.0/AdvancedMaterial/glTF/advanced.frag b/2.0/AdvancedMaterial/glTF/advanced.frag deleted file mode 100644 index 9d47ed85..00000000 --- a/2.0/AdvancedMaterial/glTF/advanced.frag +++ /dev/null @@ -1,43 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -varying vec3 v_position; -varying vec3 v_normal; - -uniform vec4 u_ambient; -uniform vec4 u_diffuse; -uniform vec4 u_specular; -uniform float u_shininess; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec3 normal = normalize(v_normal); - vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - vec3 diffuseLight = vec3(0.0, 0.0, 0.0); - vec3 lightColor = vec3(1.0, 1.0, 1.0); - vec4 ambient = u_ambient; - vec4 diffuse = u_diffuse; - vec4 specular = u_specular; - - vec3 specularLight = vec3(0.0, 0.0, 0.0); - { - float specularIntensity = 0.0; - float attenuation = 1.0; - vec3 l = normalize(v_light0Direction); - vec3 viewDir = -normalize(v_position); - vec3 h = normalize(l+viewDir); - specularIntensity = max(0.0, pow(max(dot(normal,h), 0.0) , u_shininess)) * attenuation; - specularLight += lightColor * specularIntensity; - diffuseLight += lightColor * max(dot(normal,l), 0.0) * attenuation; - } - specular.rgb *= specularLight; - diffuse.rgb *= diffuseLight; - color.rgb += ambient.xyz; - color.rgb += diffuse.xyz; - color.rgb += specular.xyz; - color.a = diffuse.a; - gl_FragColor = color; -} diff --git a/2.0/AdvancedMaterial/glTF/advanced.vert b/2.0/AdvancedMaterial/glTF/advanced.vert deleted file mode 100644 index e5d134ad..00000000 --- a/2.0/AdvancedMaterial/glTF/advanced.vert +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -attribute vec3 a_position; -attribute vec3 a_normal; - -uniform mat3 u_normalMatrix; -uniform mat4 u_modelViewMatrix; -uniform mat4 u_projectionMatrix; - -varying vec3 v_position; -varying vec3 v_normal; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec4 pos = u_modelViewMatrix * vec4(a_position, 1.0); - v_normal = u_normalMatrix * a_normal; - v_position = pos.xyz; - v_light0Direction = mat3(u_modelViewMatrix) * vec3(1.0, 1.0, 1.0); - gl_Position = u_projectionMatrix * pos; -} diff --git a/2.0/AdvancedMaterial/glTF/triangle.bin b/2.0/AdvancedMaterial/glTF/triangle.bin deleted file mode 100644 index 291b43ca..00000000 Binary files a/2.0/AdvancedMaterial/glTF/triangle.bin and /dev/null differ diff --git a/2.0/AdvancedMaterial/screenshot/screenshot.png b/2.0/AdvancedMaterial/screenshot/screenshot.png deleted file mode 100644 index 7738b304..00000000 Binary files a/2.0/AdvancedMaterial/screenshot/screenshot.png and /dev/null differ diff --git a/2.0/AdvancedMaterial/screenshot/triangle.png b/2.0/AdvancedMaterial/screenshot/triangle.png deleted file mode 100644 index b4c5829d..00000000 Binary files a/2.0/AdvancedMaterial/screenshot/triangle.png and /dev/null differ diff --git a/2.0/AnimatedTriangle/glTF-Embedded/AnimatedTriangle.gltf b/2.0/AnimatedTriangle/glTF-Embedded/AnimatedTriangle.gltf index 00408da4..6c1341ad 100644 --- a/2.0/AnimatedTriangle/glTF-Embedded/AnimatedTriangle.gltf +++ b/2.0/AnimatedTriangle/glTF-Embedded/AnimatedTriangle.gltf @@ -1,77 +1,79 @@ { - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] + "scenes" : [ + { + "nodes" : [ 0 ] } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ], + ], + + "nodes" : [ + { + "mesh" : 0, "rotation" : [ 0.0, 0.0, 0.0, 1.0 ] } - }, - "meshes" : { - "mesh0" : { + ], + + "meshes" : [ + { "primitives" : [ { "attributes" : { - "POSITION" : "positionsAccessor" + "POSITION" : 1 }, - "indices" : "indicesAccessor" + "indices" : 0 } ] } - }, - - "animations" : { - "animation0" : { - "samplers" : { - "rotationSampler" : { - "input" : "TIMEAccessor", + ], + + "animations": [ + { + "samplers" : [ + { + "input" : 2, "interpolation" : "LINEAR", - "output" : "rotationAccessor" + "output" : 3 } - }, + ], "channels" : [ { - "sampler" : "rotationSampler", + "sampler" : 0, "target" : { - "id" : "node0", + "node" : 0, "path" : "rotation" } } ] } - }, + ], - "buffers" : { - "geometryBuffer" : { + "buffers" : [ + { "uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAA=", "byteLength" : 44 }, - "animationBuffer" : { + { "uri" : "data:application/octet-stream;base64,AAAAAAAAgD4AAAA/AABAPwAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAD0/TQ/9P00PwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAPT9ND/0/TS/AAAAAAAAAAAAAAAAAACAPw==", "byteLength" : 100 } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", + ], + "bufferViews" : [ + { + "buffer" : 0, "byteOffset" : 0, "byteLength" : 6, "target" : 34963 }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", + { + "buffer" : 0, "byteOffset" : 8, "byteLength" : 36, "target" : 34962 }, - "animationBufferView" : { - "buffer" : "animationBuffer", + { + "buffer" : 1, "byteOffset" : 0, "byteLength" : 100 } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", + ], + "accessors" : [ + { + "bufferView" : 0, "byteOffset" : 0, "componentType" : 5123, "count" : 3, @@ -79,8 +81,8 @@ "max" : [ 2 ], "min" : [ 0 ] }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", + { + "bufferView" : 1, "byteOffset" : 0, "componentType" : 5126, "count" : 3, @@ -88,8 +90,8 @@ "max" : [ 1.0, 1.0, 0.0 ], "min" : [ 0.0, 0.0, 0.0 ] }, - "TIMEAccessor" : { - "bufferView" : "animationBufferView", + { + "bufferView" : 2, "byteOffset" : 0, "componentType" : 5126, "count" : 5, @@ -97,8 +99,8 @@ "max" : [ 1.0 ], "min" : [ 0.0 ] }, - "rotationAccessor" : { - "bufferView" : "animationBufferView", + { + "bufferView" : 2, "byteOffset" : 20, "componentType" : 5126, "count" : 5, @@ -106,10 +108,10 @@ "max" : [ 0.0, 0.0, 1.0, 1.0 ], "min" : [ 0.0, 0.0, 0.0, -0.707 ] } - }, + ], "asset" : { - "version" : "1.1" + "version" : "2.0" } -} \ No newline at end of file +} diff --git a/2.0/AnimatedTriangle/glTF/AnimatedTriangle.gltf b/2.0/AnimatedTriangle/glTF/AnimatedTriangle.gltf index cc70b127..73608797 100644 --- a/2.0/AnimatedTriangle/glTF/AnimatedTriangle.gltf +++ b/2.0/AnimatedTriangle/glTF/AnimatedTriangle.gltf @@ -1,77 +1,79 @@ { - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] + "scenes" : [ + { + "nodes" : [ 0 ] } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ], + ], + + "nodes" : [ + { + "mesh" : 0, "rotation" : [ 0.0, 0.0, 0.0, 1.0 ] } - }, - "meshes" : { - "mesh0" : { + ], + + "meshes" : [ + { "primitives" : [ { "attributes" : { - "POSITION" : "positionsAccessor" + "POSITION" : 1 }, - "indices" : "indicesAccessor" + "indices" : 0 } ] } - }, + ], - "animations": { - "animation0": { - "samplers" : { - "rotationSampler" : { - "input" : "TIMEAccessor", + "animations": [ + { + "samplers" : [ + { + "input" : 2, "interpolation" : "LINEAR", - "output" : "rotationAccessor" + "output" : 3 } - }, + ], "channels" : [ { - "sampler" : "rotationSampler", + "sampler" : 0, "target" : { - "id" : "node0", + "node" : 0, "path" : "rotation" } } ] } - }, + ], - "buffers" : { - "geometryBuffer" : { + "buffers" : [ + { "uri" : "simpleTriangle.bin", "byteLength" : 44 }, - "animationBuffer" : { + { "uri" : "animation.bin", "byteLength" : 100 } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", + ], + "bufferViews" : [ + { + "buffer" : 0, "byteOffset" : 0, "byteLength" : 6, "target" : 34963 }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", + { + "buffer" : 0, "byteOffset" : 8, "byteLength" : 36, "target" : 34962 }, - "animationBufferView" : { - "buffer" : "animationBuffer", + { + "buffer" : 1, "byteOffset" : 0, "byteLength" : 100 } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", + ], + "accessors" : [ + { + "bufferView" : 0, "byteOffset" : 0, "componentType" : 5123, "count" : 3, @@ -79,8 +81,8 @@ "max" : [ 2 ], "min" : [ 0 ] }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", + { + "bufferView" : 1, "byteOffset" : 0, "componentType" : 5126, "count" : 3, @@ -88,8 +90,8 @@ "max" : [ 1.0, 1.0, 0.0 ], "min" : [ 0.0, 0.0, 0.0 ] }, - "TIMEAccessor" : { - "bufferView" : "animationBufferView", + { + "bufferView" : 2, "byteOffset" : 0, "componentType" : 5126, "count" : 5, @@ -97,8 +99,8 @@ "max" : [ 1.0 ], "min" : [ 0.0 ] }, - "rotationAccessor" : { - "bufferView" : "animationBufferView", + { + "bufferView" : 2, "byteOffset" : 20, "componentType" : 5126, "count" : 5, @@ -106,10 +108,10 @@ "max" : [ 0.0, 0.0, 1.0, 1.0 ], "min" : [ 0.0, 0.0, 0.0, -0.707 ] } - }, + ], "asset" : { - "version" : "1.1" + "version" : "2.0" } } diff --git a/2.0/Cameras/glTF-Embedded/Cameras.gltf b/2.0/Cameras/glTF-Embedded/Cameras.gltf index c446df39..f5264429 100644 --- a/2.0/Cameras/glTF-Embedded/Cameras.gltf +++ b/2.0/Cameras/glTF-Embedded/Cameras.gltf @@ -1,26 +1,26 @@ { - "scenes" : { - "scene0" : { - "nodes" : [ "meshNode", "perspectiveCameraNode", "orthographicCameraNode" ] + "scenes" : [ + { + "nodes" : [ 0, 1, 2 ] } - }, - "nodes" : { - "meshNode" : { + ], + "nodes" : [ + { "rotation" : [ -0.383, 0.0, 0.0, 0.924 ], - "meshes" : [ "mesh0" ] + "mesh" : 0 }, - "perspectiveCameraNode" : { + { "translation" : [ 0.5, 0.5, 3.0 ], - "camera" : "exampleCameraPerspective" + "camera" : 0 }, - "orthographicCameraNode" : { + { "translation" : [ 0.5, 0.5, 3.0 ], - "camera" : "exampleCameraOrthographic" + "camera" : 1 } - }, + ], - "cameras" : { - "exampleCameraPerspective": { + "cameras" : [ + { "type": "perspective", "perspective": { "aspectRatio": 1.0, @@ -29,7 +29,7 @@ "znear": 0.01 } }, - "exampleCameraOrthographic": { + { "type": "orthographic", "orthographic": { "xmag": 1.0, @@ -38,42 +38,42 @@ "znear": 0.01 } } - }, + ], - "meshes" : { - "mesh0" : { + "meshes" : [ + { "primitives" : [ { "attributes" : { - "POSITION" : "positionsAccessor" + "POSITION" : 1 }, - "indices" : "indicesAccessor" + "indices" : 0 } ] } - }, + ], - "buffers" : { - "geometryBuffer" : { + "buffers" : [ + { "uri" : "data:application/octet-stream;base64,AAABAAIAAQADAAIAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAACAPwAAgD8AAAAA", "byteLength" : 60 } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", + ], + "bufferViews" : [ + { + "buffer" : 0, "byteOffset" : 0, "byteLength" : 12, "target" : 34963 }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", + { + "buffer" : 0, "byteOffset" : 12, "byteLength" : 48, "target" : 34962 } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", + ], + "accessors" : [ + { + "bufferView" : 0, "byteOffset" : 0, "componentType" : 5123, "count" : 6, @@ -81,8 +81,8 @@ "max" : [ 3 ], "min" : [ 0 ] }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", + { + "bufferView" : 1, "byteOffset" : 0, "componentType" : 5126, "count" : 4, @@ -90,8 +90,9 @@ "max" : [ 1.0, 1.0, 0.0 ], "min" : [ 0.0, 0.0, 0.0 ] } - }, + ], + "asset" : { - "version" : "1.1" + "version" : "2.0" } } diff --git a/2.0/Cameras/glTF/Cameras.gltf b/2.0/Cameras/glTF/Cameras.gltf index 122415f6..b61145d0 100644 --- a/2.0/Cameras/glTF/Cameras.gltf +++ b/2.0/Cameras/glTF/Cameras.gltf @@ -1,26 +1,26 @@ { - "scenes" : { - "scene0" : { - "nodes" : [ "meshNode", "perspectiveCameraNode", "orthographicCameraNode" ] + "scenes" : [ + { + "nodes" : [ 0, 1, 2 ] } - }, - "nodes" : { - "meshNode" : { + ], + "nodes" : [ + { "rotation" : [ -0.383, 0.0, 0.0, 0.924 ], - "meshes" : [ "mesh0" ] + "mesh" : 0 }, - "perspectiveCameraNode" : { + { "translation" : [ 0.5, 0.5, 3.0 ], - "camera" : "exampleCameraPerspective" + "camera" : 0 }, - "orthographicCameraNode" : { + { "translation" : [ 0.5, 0.5, 3.0 ], - "camera" : "exampleCameraOrthographic" + "camera" : 1 } - }, + ], - "cameras" : { - "exampleCameraPerspective": { + "cameras" : [ + { "type": "perspective", "perspective": { "aspectRatio": 1.0, @@ -29,7 +29,7 @@ "znear": 0.01 } }, - "exampleCameraOrthographic": { + { "type": "orthographic", "orthographic": { "xmag": 1.0, @@ -38,42 +38,42 @@ "znear": 0.01 } } - }, + ], - "meshes" : { - "mesh0" : { + "meshes" : [ + { "primitives" : [ { "attributes" : { - "POSITION" : "positionsAccessor" + "POSITION" : 1 }, - "indices" : "indicesAccessor" + "indices" : 0 } ] } - }, + ], - "buffers" : { - "geometryBuffer" : { + "buffers" : [ + { "uri" : "simpleSquare.bin", "byteLength" : 60 } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", + ], + "bufferViews" : [ + { + "buffer" : 0, "byteOffset" : 0, "byteLength" : 12, "target" : 34963 }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", + { + "buffer" : 0, "byteOffset" : 12, "byteLength" : 48, "target" : 34962 } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", + ], + "accessors" : [ + { + "bufferView" : 0, "byteOffset" : 0, "componentType" : 5123, "count" : 6, @@ -81,8 +81,8 @@ "max" : [ 3 ], "min" : [ 0 ] }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", + { + "bufferView" : 1, "byteOffset" : 0, "componentType" : 5126, "count" : 4, @@ -90,8 +90,9 @@ "max" : [ 1.0, 1.0, 0.0 ], "min" : [ 0.0, 0.0, 0.0 ] } - }, + ], + "asset" : { - "version" : "1.1" + "version" : "2.0" } } diff --git a/2.0/README.md b/2.0/README.md index 08ecff90..f8198bef 100644 --- a/2.0/README.md +++ b/2.0/README.md @@ -1,7 +1,5 @@ # glTF 2.0 Sample Models -**Note:** These models are not yet updated to glTF 2.0! - ## Simple models for testing individual features | Model | Screenshot | Description| @@ -11,13 +9,8 @@ | [Animated Triangle](AnimatedTriangle) | ![](AnimatedTriangle/screenshot/screenshot.gif) | This sample is similar to the [Triangle](Triangle), but the `node` has a `rotation` property that is modified with a simple `animation` | | [Animated Morph Cube](AnimatedMorphCube) | ![](AnimatedMorphCube/screenshot/screenshot.gif) | Demonstrates a simple cube with two simple morph targets and an animation that transitions between them both. | | [Animated Morph Sphere](AnimatedMorphSphere) | ![](AnimatedMorphSphere/screenshot/screenshot.gif) | This sample is similar to the [Animated Morph Cube](AnimatedMorphCube), but the two morph targets move many more vertices and are more extreme than with the cube. | -| [Simple Material](SimpleMaterial) | ![](SimpleMaterial/screenshot/screenshot.png) | This sample is similar to the [Triangle](Triangle), but additonally defines a `material` that consists of an emissive color | | [Simple Meshes](SimpleMeshes) | ![](SimpleMeshes/screenshot/screenshot.png) | A simple `scene` with two `nodes`, both containing the same `mesh`, namely a `mesh` with a single `mesh.primitive` with a single indexed triangle with *multiple* attributes (positions, normals and texture coordinates), but without a `material` | -| [Advanced Material](AdvancedMaterial) | ![](AdvancedMaterial/screenshot/screenshot.png) | This sample is similar to the [Simple Meshes](SimpleMeshes), but defines a `material` that includes a light, and thus shows the effect of the normals attribute | -| [Simple Opacity](SimpleOpacity) | ![](SimpleOpacity/screenshot/screenshot.png) | A simple `scene` with multiple `nodes`, `meshes` and `materials`, where each `material` has different opacity values, ranging from fully transparent to fully opaque | -| [Simple Texture](SimpleTexture) | ![](SimpleTexture/screenshot/screenshot.png) | A sample with a `material` that uses a single `texture` | | [Cameras](Cameras) | ![](Cameras/screenshot/screenshot.png) | A sample with two different `camera` objects | -| [Simple Skin](SimpleSkin) | ![](SimpleSkin/screenshot/screenshot.gif) | A sample with a `skin`, showing very basic vertex skinning. **Note: Parts of the skinning definitions still have to be finalized for glTF 1.1!** | ## More complex models diff --git a/2.0/SimpleMaterial/README.md b/2.0/SimpleMaterial/README.md deleted file mode 100644 index 6494f0a3..00000000 --- a/2.0/SimpleMaterial/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# SimpleMaterial - -## Screenshot - -![screenshot](screenshot/screenshot.png) - -## License Information - -Public domain ([CC0](https://creativecommons.org/publicdomain/zero/1.0/)) - -## Data layout - -The following image shows the data layout of this sample: - -![simpleTriangle](screenshot/simpleTriangle.png) diff --git a/2.0/SimpleMaterial/glTF-Embedded-buffer/SimpleMaterial.gltf b/2.0/SimpleMaterial/glTF-Embedded-buffer/SimpleMaterial.gltf deleted file mode 100644 index b87f4d8a..00000000 --- a/2.0/SimpleMaterial/glTF-Embedded-buffer/SimpleMaterial.gltf +++ /dev/null @@ -1,127 +0,0 @@ -{ - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] - } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] - } - }, - "meshes" : { - "mesh0" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "simpleMaterial" - } ] - } - }, - - "materials" : { - "simpleMaterial" : { - "technique" : "simpleTechnique", - "values" : { - "emissionParameter" : [ 0.9, 0.5, 0.1, 1.0 ] - } - } - }, - "techniques": { - "simpleTechnique": { - "program": "simpleProgram", - "attributes": { - "a_position": "positionParameter" - }, - "uniforms": { - "u_modelViewMatrix": "modelViewMatrixParameter", - "u_projectionMatrix": "projectionMatrixParameter", - "u_emission": "emissionParameter" - }, - "parameters": { - "modelViewMatrixParameter": { - "type": 35676, - "semantic": "MODELVIEW" - }, - "projectionMatrixParameter": { - "type": 35676, - "semantic": "PROJECTION" - }, - "emissionParameter": { - "type": 35666, - "value": [ 0.5, 0.5, 0.5, 1.0 ] - }, - "positionParameter" : { - "type": 35665, - "semantic": "POSITION" - } - } - } - }, - "programs": { - "simpleProgram": { - "vertexShader": "simpleVertexShader", - "fragmentShader": "simpleFragmentShader", - "attributes": [ - "a_position" - ] - } - }, - "shaders": { - "simpleVertexShader": { - "type": 35633, - "uri": "simple.vert" - }, - "simpleFragmentShader": { - "type": 35632, - "uri": "simple.frag" - } - }, - - "buffers" : { - "geometryBuffer" : { - "uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAA=", - "byteLength" : 44 - } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 0, - "byteLength" : 6, - "target" : 34963 - }, - "positionsBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 8, - "byteLength" : 36, - "target" : 34962 - } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", - "byteOffset" : 0, - "componentType" : 5123, - "count" : 3, - "type" : "SCALAR", - "max" : [ 2 ], - "min" : [ 0 ] - }, - "positionsAccessor" : { - "bufferView" : "positionsBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 3, - "type" : "VEC3", - "max" : [ 1.0, 1.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0 ] - } - }, - - "asset" : { - "version" : "1.1" - } -} diff --git a/2.0/SimpleMaterial/glTF-Embedded-buffer/simple.frag b/2.0/SimpleMaterial/glTF-Embedded-buffer/simple.frag deleted file mode 100644 index 4a31bf39..00000000 --- a/2.0/SimpleMaterial/glTF-Embedded-buffer/simple.frag +++ /dev/null @@ -1,10 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -uniform vec4 u_emission; - -void main(void) -{ - gl_FragColor = u_emission; -} \ No newline at end of file diff --git a/2.0/SimpleMaterial/glTF-Embedded-buffer/simple.vert b/2.0/SimpleMaterial/glTF-Embedded-buffer/simple.vert deleted file mode 100644 index 11e6cdd6..00000000 --- a/2.0/SimpleMaterial/glTF-Embedded-buffer/simple.vert +++ /dev/null @@ -1,13 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -attribute vec3 a_position; - -uniform mat4 u_modelViewMatrix; -uniform mat4 u_projectionMatrix; - -void main(void) -{ - gl_Position = u_projectionMatrix * u_modelViewMatrix * vec4(a_position,1.0); -} diff --git a/2.0/SimpleMaterial/glTF/SimpleMaterial.gltf b/2.0/SimpleMaterial/glTF/SimpleMaterial.gltf deleted file mode 100644 index 4edbe195..00000000 --- a/2.0/SimpleMaterial/glTF/SimpleMaterial.gltf +++ /dev/null @@ -1,127 +0,0 @@ -{ - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] - } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] - } - }, - "meshes" : { - "mesh0" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "simpleMaterial" - } ] - } - }, - - "materials" : { - "simpleMaterial" : { - "technique" : "simpleTechnique", - "values" : { - "emissionParameter" : [ 0.9, 0.5, 0.1, 1.0 ] - } - } - }, - "techniques": { - "simpleTechnique": { - "program": "simpleProgram", - "attributes": { - "a_position": "positionParameter" - }, - "uniforms": { - "u_modelViewMatrix": "modelViewMatrixParameter", - "u_projectionMatrix": "projectionMatrixParameter", - "u_emission": "emissionParameter" - }, - "parameters": { - "modelViewMatrixParameter": { - "type": 35676, - "semantic": "MODELVIEW" - }, - "projectionMatrixParameter": { - "type": 35676, - "semantic": "PROJECTION" - }, - "emissionParameter": { - "type": 35666, - "value": [ 0.5, 0.5, 0.5, 1.0 ] - }, - "positionParameter" : { - "type": 35665, - "semantic": "POSITION" - } - } - } - }, - "programs": { - "simpleProgram": { - "vertexShader": "simpleVertexShader", - "fragmentShader": "simpleFragmentShader", - "attributes": [ - "a_position" - ] - } - }, - "shaders": { - "simpleVertexShader": { - "type": 35633, - "uri": "simple.vert" - }, - "simpleFragmentShader": { - "type": 35632, - "uri": "simple.frag" - } - }, - - "buffers" : { - "geometryBuffer" : { - "uri" : "simpleTriangle.bin", - "byteLength" : 44 - } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 0, - "byteLength" : 6, - "target" : 34963 - }, - "positionsBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 8, - "byteLength" : 36, - "target" : 34962 - } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", - "byteOffset" : 0, - "componentType" : 5123, - "count" : 3, - "type" : "SCALAR", - "max" : [ 2 ], - "min" : [ 0 ] - }, - "positionsAccessor" : { - "bufferView" : "positionsBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 3, - "type" : "VEC3", - "max" : [ 1.0, 1.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0 ] - } - }, - - "asset" : { - "version" : "1.1" - } -} diff --git a/2.0/SimpleMaterial/glTF/simple.frag b/2.0/SimpleMaterial/glTF/simple.frag deleted file mode 100644 index 4a31bf39..00000000 --- a/2.0/SimpleMaterial/glTF/simple.frag +++ /dev/null @@ -1,10 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -uniform vec4 u_emission; - -void main(void) -{ - gl_FragColor = u_emission; -} \ No newline at end of file diff --git a/2.0/SimpleMaterial/glTF/simple.vert b/2.0/SimpleMaterial/glTF/simple.vert deleted file mode 100644 index 11e6cdd6..00000000 --- a/2.0/SimpleMaterial/glTF/simple.vert +++ /dev/null @@ -1,13 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -attribute vec3 a_position; - -uniform mat4 u_modelViewMatrix; -uniform mat4 u_projectionMatrix; - -void main(void) -{ - gl_Position = u_projectionMatrix * u_modelViewMatrix * vec4(a_position,1.0); -} diff --git a/2.0/SimpleMaterial/glTF/simpleTriangle.bin b/2.0/SimpleMaterial/glTF/simpleTriangle.bin deleted file mode 100644 index d642500b..00000000 Binary files a/2.0/SimpleMaterial/glTF/simpleTriangle.bin and /dev/null differ diff --git a/2.0/SimpleMaterial/screenshot/screenshot.png b/2.0/SimpleMaterial/screenshot/screenshot.png deleted file mode 100644 index d3b10902..00000000 Binary files a/2.0/SimpleMaterial/screenshot/screenshot.png and /dev/null differ diff --git a/2.0/SimpleMaterial/screenshot/simpleTriangle.png b/2.0/SimpleMaterial/screenshot/simpleTriangle.png deleted file mode 100644 index 98df05c1..00000000 Binary files a/2.0/SimpleMaterial/screenshot/simpleTriangle.png and /dev/null differ diff --git a/2.0/SimpleMeshes/glTF-Embedded/SimpleMeshes.gltf b/2.0/SimpleMeshes/glTF-Embedded/SimpleMeshes.gltf index 82109302..3aac8d62 100644 --- a/2.0/SimpleMeshes/glTF-Embedded/SimpleMeshes.gltf +++ b/2.0/SimpleMeshes/glTF-Embedded/SimpleMeshes.gltf @@ -1,54 +1,55 @@ { - "scenes" : { - "scene0" : { - "nodes" : [ "node0", "node1" ] + "scenes" : [ + { + "nodes" : [ 0, 1] } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] + ], + "nodes" : [ + { + "mesh" : 0 }, - "node1" : { - "meshes" : [ "mesh0" ], + { + "mesh" : 0, "translation" : [ 1.0, 0.0, 0.0 ] } - }, - - "meshes" : { - "mesh0" : { + ], + + "meshes" : [ + { "primitives" : [ { "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" + "POSITION" : 1, + "NORMAL" : 2 }, - "indices" : "indicesAccessor" + "indices" : 0 } ] } - }, + ], - "buffers" : { - "geometryBuffer" : { + "buffers" : [ + { "uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8=", "byteLength" : 80 } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", + ], + "bufferViews" : [ + { + "buffer" : 0, "byteOffset" : 0, "byteLength" : 6, "target" : 34963 }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", + { + "buffer" : 0, "byteOffset" : 8, "byteLength" : 72, + "byteStride" : 12, "target" : 34962 } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", + ], + "accessors" : [ + { + "bufferView" : 0, "byteOffset" : 0, "componentType" : 5123, "count" : 3, @@ -56,8 +57,8 @@ "max" : [ 2 ], "min" : [ 0 ] }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", + { + "bufferView" : 1, "byteOffset" : 0, "componentType" : 5126, "count" : 3, @@ -65,8 +66,8 @@ "max" : [ 1.0, 1.0, 0.0 ], "min" : [ 0.0, 0.0, 0.0 ] }, - "normalsAccessor" : { - "bufferView" : "attributesBufferView", + { + "bufferView" : 1, "byteOffset" : 36, "componentType" : 5126, "count" : 3, @@ -74,9 +75,10 @@ "max" : [ 0.0, 0.0, 1.0 ], "min" : [ 0.0, 0.0, 1.0 ] } - }, + ], "asset" : { - "version" : "1.1" + "version" : "2.0" } -} \ No newline at end of file +} + diff --git a/2.0/SimpleMeshes/glTF/SimpleMeshes.gltf b/2.0/SimpleMeshes/glTF/SimpleMeshes.gltf index e59f9b6c..7de86672 100644 --- a/2.0/SimpleMeshes/glTF/SimpleMeshes.gltf +++ b/2.0/SimpleMeshes/glTF/SimpleMeshes.gltf @@ -1,54 +1,55 @@ { - "scenes" : { - "scene0" : { - "nodes" : [ "node0", "node1" ] + "scenes" : [ + { + "nodes" : [ 0, 1] } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] + ], + "nodes" : [ + { + "mesh" : 0 }, - "node1" : { - "meshes" : [ "mesh0" ], + { + "mesh" : 0, "translation" : [ 1.0, 0.0, 0.0 ] } - }, + ], - "meshes" : { - "mesh0" : { + "meshes" : [ + { "primitives" : [ { "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" + "POSITION" : 1, + "NORMAL" : 2 }, - "indices" : "indicesAccessor" + "indices" : 0 } ] } - }, + ], - "buffers" : { - "geometryBuffer" : { + "buffers" : [ + { "uri" : "triangle.bin", "byteLength" : 80 } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", + ], + "bufferViews" : [ + { + "buffer" : 0, "byteOffset" : 0, "byteLength" : 6, "target" : 34963 }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", + { + "buffer" : 0, "byteOffset" : 8, "byteLength" : 72, + "byteStride" : 12, "target" : 34962 } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", + ], + "accessors" : [ + { + "bufferView" : 0, "byteOffset" : 0, "componentType" : 5123, "count" : 3, @@ -56,8 +57,8 @@ "max" : [ 2 ], "min" : [ 0 ] }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", + { + "bufferView" : 1, "byteOffset" : 0, "componentType" : 5126, "count" : 3, @@ -65,8 +66,8 @@ "max" : [ 1.0, 1.0, 0.0 ], "min" : [ 0.0, 0.0, 0.0 ] }, - "normalsAccessor" : { - "bufferView" : "attributesBufferView", + { + "bufferView" : 1, "byteOffset" : 36, "componentType" : 5126, "count" : 3, @@ -74,8 +75,9 @@ "max" : [ 0.0, 0.0, 1.0 ], "min" : [ 0.0, 0.0, 1.0 ] } - }, + ], + "asset" : { - "version" : "1.1" + "version" : "2.0" } } diff --git a/2.0/SimpleOpacity/README.md b/2.0/SimpleOpacity/README.md deleted file mode 100644 index e3d194f4..00000000 --- a/2.0/SimpleOpacity/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# SimpleOpacity - -## Screenshot - -![screenshot](screenshot/screenshot.png) - -## License Information - -Public domain ([CC0](https://creativecommons.org/publicdomain/zero/1.0/)) - -## Data layout - -The following image shows the data layout of this sample: - -![triangle](screenshot/triangle.png) diff --git a/2.0/SimpleOpacity/glTF-Embedded-buffer/SimpleOpacity.gltf b/2.0/SimpleOpacity/glTF-Embedded-buffer/SimpleOpacity.gltf deleted file mode 100644 index c50092b7..00000000 --- a/2.0/SimpleOpacity/glTF-Embedded-buffer/SimpleOpacity.gltf +++ /dev/null @@ -1,348 +0,0 @@ -{ - "scene" : "scene0", - "scenes" : { - "scene0" : { - "nodes" : [ "node0", "node1", "node2", "node3", "node4", "node5" ] - } - }, - "nodes" : { - "node0" : { - "translation" : [ -0.5, -0.5, -1.0 ], - "meshes" : [ "meshWithOpaqueMaterial" ] - }, - "node1" : { - "translation" : [ -0.5, -0.1, -0.99 ], - "meshes" : [ "meshWithSemiOpaqueMaterial0" ] - }, - "node2" : { - "translation" : [ -0.4, -0.2, -0.98 ], - "meshes" : [ "meshWithSemiOpaqueMaterial25" ] - }, - "node3" : { - "translation" : [ -0.3, -0.3, -0.97 ], - "meshes" : [ "meshWithSemiOpaqueMaterial50" ] - }, - "node4" : { - "translation" : [ -0.2, -0.4, -0.96 ], - "meshes" : [ "meshWithSemiOpaqueMaterial75" ] - }, - "node5" : { - "translation" : [ -0.1, -0.5, -0.95 ], - "meshes" : [ "meshWithSemiOpaqueMaterial100" ] - } - }, - - "meshes" : { - "meshWithOpaqueMaterial" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "opaqueMaterial" - } ] - }, - "meshWithSemiOpaqueMaterial0" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "semiOpaqueMaterial0" - } ] - }, - "meshWithSemiOpaqueMaterial25" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "semiOpaqueMaterial25" - } ] - }, - "meshWithSemiOpaqueMaterial50" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "semiOpaqueMaterial50" - } ] - }, - "meshWithSemiOpaqueMaterial75" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "semiOpaqueMaterial75" - } ] - }, - "meshWithSemiOpaqueMaterial100" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "semiOpaqueMaterial100" - } ] - } - }, - - "materials" : { - "opaqueMaterial" : { - "technique" : "opaqueTechnique", - "values": { - "diffuseParameter": [ 1.0, 0.0, 0.0, 1.0 ] - } - }, - "semiOpaqueMaterial0" : { - "technique" : "semiOpaqueTechnique", - "values": { - "opacityParameter" : [ 0.0 ], - "diffuseParameter": [ 0.0, 0.0, 1.0, 1.0 ] - } - }, - "semiOpaqueMaterial25" : { - "technique" : "semiOpaqueTechnique", - "values": { - "opacityParameter" : [ 0.25 ], - "diffuseParameter": [ 0.0, 0.0, 1.0, 1.0 ] - } - }, - "semiOpaqueMaterial50" : { - "technique" : "semiOpaqueTechnique", - "values": { - "opacityParameter" : [ 0.50 ], - "diffuseParameter": [ 0.0, 0.0, 1.0, 1.0 ] - } - }, - "semiOpaqueMaterial75" : { - "technique" : "semiOpaqueTechnique", - "values": { - "opacityParameter" : [ 0.75 ], - "diffuseParameter": [ 0.0, 0.0, 1.0, 1.0 ] - } - }, - "semiOpaqueMaterial100" : { - "technique" : "semiOpaqueTechnique", - "values": { - "opacityParameter" : [ 1.0 ], - "diffuseParameter": [ 0.0, 0.0, 1.0, 1.0 ] - } - } - }, - "techniques": { - - "opaqueTechnique": { - "program": "opacityProgram", - "attributes": { - "a_position": "positionParameter", - "a_normal": "normalParameter" - }, - "uniforms": { - "u_modelViewMatrix": "modelViewMatrixParameter", - "u_normalMatrix": "normalMatrixParameter", - "u_projectionMatrix": "projectionMatrixParameter", - "u_ambient": "ambientParameter", - "u_diffuse": "diffuseParameter", - "u_specular": "specularParameter", - "u_shininess": "shininessParameter", - "u_opacity": "opacityParameter" - }, - "parameters": { - "positionParameter" : { - "type": 35665, - "semantic": "POSITION" - }, - "normalParameter" : { - "type": 35665, - "semantic": "NORMAL" - }, - "modelViewMatrixParameter": { - "type": 35676, - "semantic": "MODELVIEW" - }, - "normalMatrixParameter": { - "type": 35675, - "semantic": "MODELVIEWINVERSETRANSPOSE" - }, - "projectionMatrixParameter": { - "type": 35676, - "semantic": "PROJECTION" - }, - "ambientParameter": { - "type": 35666, - "value": [ 0.1, 0.1, 0.1, 1.0 ] - }, - "diffuseParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "specularParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "shininessParameter": { - "type": 5126, - "value": [ 100.0 ] - }, - "opacityParameter": { - "type": 5126, - "value": [ 1.0 ] - } - }, - "states": { - "enable": [ 2929 ] - } - }, - - "semiOpaqueTechnique": { - "program": "opacityProgram", - "attributes": { - "a_position": "positionParameter", - "a_normal": "normalParameter" - }, - "uniforms": { - "u_modelViewMatrix": "modelViewMatrixParameter", - "u_normalMatrix": "normalMatrixParameter", - "u_projectionMatrix": "projectionMatrixParameter", - "u_ambient": "ambientParameter", - "u_diffuse": "diffuseParameter", - "u_specular": "specularParameter", - "u_shininess": "shininessParameter", - "u_opacity": "opacityParameter" - }, - "parameters": { - "positionParameter" : { - "type": 35665, - "semantic": "POSITION" - }, - "normalParameter" : { - "type": 35665, - "semantic": "NORMAL" - }, - "modelViewMatrixParameter": { - "type": 35676, - "semantic": "MODELVIEW" - }, - "normalMatrixParameter": { - "type": 35675, - "semantic": "MODELVIEWINVERSETRANSPOSE" - }, - "projectionMatrixParameter": { - "type": 35676, - "semantic": "PROJECTION" - }, - "ambientParameter": { - "type": 35666, - "value": [ 0.1, 0.1, 0.1, 1.0 ] - }, - "diffuseParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "specularParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "shininessParameter": { - "type": 5126, - "value": [ 100.0 ] - }, - "opacityParameter": { - "type": 5126, - "value": [ 0.5 ] - } - }, - "states": { - "enable": [ 2929, 3042 ], - "functions": { - "blendEquationSeparate": [ 32774, 32774 ], - "blendFuncSeparate": [ 770, 771, 770, 771], - "depthMask": [false] - } - } - } - - }, - "programs": { - "opacityProgram": { - "vertexShader": "opacityVertexShader", - "fragmentShader": "opacityFragmentShader", - "attributes": [ - "a_position", - "a_normal" - ] - } - }, - "shaders": { - "opacityVertexShader": { - "type": 35633, - "uri": "opacity.vert" - }, - "opacityFragmentShader": { - "type": 35632, - "uri": "opacity.frag" - } - }, - - "buffers" : { - "geometryBuffer" : { - "uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8=", - "byteLength" : 80 - } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 0, - "byteLength" : 6, - "target" : 34963 - }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 8, - "byteLength" : 72, - "target" : 34962 - } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", - "byteOffset" : 0, - "componentType" : 5123, - "count" : 3, - "type" : "SCALAR", - "max" : [ 2 ], - "min" : [ 0 ] - }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 3, - "type" : "VEC3", - "max" : [ 1.0, 1.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0 ] - }, - "normalsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 36, - "componentType" : 5126, - "count" : 3, - "type" : "VEC3", - "max" : [ 0.0, 0.0, 1.0 ], - "min" : [ 0.0, 0.0, 1.0 ] - } - }, - "asset" : { - "version" : "1.1" - } -} diff --git a/2.0/SimpleOpacity/glTF-Embedded-buffer/opacity.frag b/2.0/SimpleOpacity/glTF-Embedded-buffer/opacity.frag deleted file mode 100644 index 6c543c8e..00000000 --- a/2.0/SimpleOpacity/glTF-Embedded-buffer/opacity.frag +++ /dev/null @@ -1,44 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -varying vec3 v_position; -varying vec3 v_normal; - -uniform vec4 u_ambient; -uniform vec4 u_diffuse; -uniform vec4 u_specular; -uniform float u_shininess; -uniform float u_opacity; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec3 normal = normalize(v_normal); - vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - vec3 diffuseLight = vec3(0.0, 0.0, 0.0); - vec3 lightColor = vec3(1.0, 1.0, 1.0); - vec4 ambient = u_ambient; - vec4 diffuse = u_diffuse; - vec4 specular = u_specular; - - vec3 specularLight = vec3(0.0, 0.0, 0.0); - { - float specularIntensity = 0.0; - float attenuation = 1.0; - vec3 l = normalize(v_light0Direction); - vec3 viewDir = -normalize(v_position); - vec3 h = normalize(l+viewDir); - specularIntensity = max(0.0, pow(max(dot(normal,h), 0.0) , u_shininess)) * attenuation; - specularLight += lightColor * specularIntensity; - diffuseLight += lightColor * max(dot(normal,l), 0.0) * attenuation; - } - specular.rgb *= specularLight; - diffuse.rgb *= diffuseLight; - color.rgb += ambient.rgb; - color.rgb += diffuse.rgb; - color.rgb += specular.rgb; - color.a = diffuse.a * u_opacity; - gl_FragColor = color; -} diff --git a/2.0/SimpleOpacity/glTF-Embedded-buffer/opacity.vert b/2.0/SimpleOpacity/glTF-Embedded-buffer/opacity.vert deleted file mode 100644 index e5d134ad..00000000 --- a/2.0/SimpleOpacity/glTF-Embedded-buffer/opacity.vert +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -attribute vec3 a_position; -attribute vec3 a_normal; - -uniform mat3 u_normalMatrix; -uniform mat4 u_modelViewMatrix; -uniform mat4 u_projectionMatrix; - -varying vec3 v_position; -varying vec3 v_normal; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec4 pos = u_modelViewMatrix * vec4(a_position, 1.0); - v_normal = u_normalMatrix * a_normal; - v_position = pos.xyz; - v_light0Direction = mat3(u_modelViewMatrix) * vec3(1.0, 1.0, 1.0); - gl_Position = u_projectionMatrix * pos; -} diff --git a/2.0/SimpleOpacity/glTF/SimpleOpacity.gltf b/2.0/SimpleOpacity/glTF/SimpleOpacity.gltf deleted file mode 100644 index 03953b8c..00000000 --- a/2.0/SimpleOpacity/glTF/SimpleOpacity.gltf +++ /dev/null @@ -1,348 +0,0 @@ -{ - "scene" : "scene0", - "scenes" : { - "scene0" : { - "nodes" : [ "node0", "node1", "node2", "node3", "node4", "node5" ] - } - }, - "nodes" : { - "node0" : { - "translation" : [ -0.5, -0.5, -1.0 ], - "meshes" : [ "meshWithOpaqueMaterial" ] - }, - "node1" : { - "translation" : [ -0.5, -0.1, -0.99 ], - "meshes" : [ "meshWithSemiOpaqueMaterial0" ] - }, - "node2" : { - "translation" : [ -0.4, -0.2, -0.98 ], - "meshes" : [ "meshWithSemiOpaqueMaterial25" ] - }, - "node3" : { - "translation" : [ -0.3, -0.3, -0.97 ], - "meshes" : [ "meshWithSemiOpaqueMaterial50" ] - }, - "node4" : { - "translation" : [ -0.2, -0.4, -0.96 ], - "meshes" : [ "meshWithSemiOpaqueMaterial75" ] - }, - "node5" : { - "translation" : [ -0.1, -0.5, -0.95 ], - "meshes" : [ "meshWithSemiOpaqueMaterial100" ] - } - }, - - "meshes" : { - "meshWithOpaqueMaterial" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "opaqueMaterial" - } ] - }, - "meshWithSemiOpaqueMaterial0" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "semiOpaqueMaterial0" - } ] - }, - "meshWithSemiOpaqueMaterial25" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "semiOpaqueMaterial25" - } ] - }, - "meshWithSemiOpaqueMaterial50" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "semiOpaqueMaterial50" - } ] - }, - "meshWithSemiOpaqueMaterial75" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "semiOpaqueMaterial75" - } ] - }, - "meshWithSemiOpaqueMaterial100" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "semiOpaqueMaterial100" - } ] - } - }, - - "materials" : { - "opaqueMaterial" : { - "technique" : "opaqueTechnique", - "values": { - "diffuseParameter": [ 1.0, 0.0, 0.0, 1.0 ] - } - }, - "semiOpaqueMaterial0" : { - "technique" : "semiOpaqueTechnique", - "values": { - "opacityParameter" : [ 0.0 ], - "diffuseParameter": [ 0.0, 0.0, 1.0, 1.0 ] - } - }, - "semiOpaqueMaterial25" : { - "technique" : "semiOpaqueTechnique", - "values": { - "opacityParameter" : [ 0.25 ], - "diffuseParameter": [ 0.0, 0.0, 1.0, 1.0 ] - } - }, - "semiOpaqueMaterial50" : { - "technique" : "semiOpaqueTechnique", - "values": { - "opacityParameter" : [ 0.50 ], - "diffuseParameter": [ 0.0, 0.0, 1.0, 1.0 ] - } - }, - "semiOpaqueMaterial75" : { - "technique" : "semiOpaqueTechnique", - "values": { - "opacityParameter" : [ 0.75 ], - "diffuseParameter": [ 0.0, 0.0, 1.0, 1.0 ] - } - }, - "semiOpaqueMaterial100" : { - "technique" : "semiOpaqueTechnique", - "values": { - "opacityParameter" : [ 1.0 ], - "diffuseParameter": [ 0.0, 0.0, 1.0, 1.0 ] - } - } - }, - "techniques": { - - "opaqueTechnique": { - "program": "opacityProgram", - "attributes": { - "a_position": "positionParameter", - "a_normal": "normalParameter" - }, - "uniforms": { - "u_modelViewMatrix": "modelViewMatrixParameter", - "u_normalMatrix": "normalMatrixParameter", - "u_projectionMatrix": "projectionMatrixParameter", - "u_ambient": "ambientParameter", - "u_diffuse": "diffuseParameter", - "u_specular": "specularParameter", - "u_shininess": "shininessParameter", - "u_opacity": "opacityParameter" - }, - "parameters": { - "positionParameter" : { - "type": 35665, - "semantic": "POSITION" - }, - "normalParameter" : { - "type": 35665, - "semantic": "NORMAL" - }, - "modelViewMatrixParameter": { - "type": 35676, - "semantic": "MODELVIEW" - }, - "normalMatrixParameter": { - "type": 35675, - "semantic": "MODELVIEWINVERSETRANSPOSE" - }, - "projectionMatrixParameter": { - "type": 35676, - "semantic": "PROJECTION" - }, - "ambientParameter": { - "type": 35666, - "value": [ 0.1, 0.1, 0.1, 1.0 ] - }, - "diffuseParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "specularParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "shininessParameter": { - "type": 5126, - "value": [ 100.0 ] - }, - "opacityParameter": { - "type": 5126, - "value": [ 1.0 ] - } - }, - "states": { - "enable": [ 2929 ] - } - }, - - "semiOpaqueTechnique": { - "program": "opacityProgram", - "attributes": { - "a_position": "positionParameter", - "a_normal": "normalParameter" - }, - "uniforms": { - "u_modelViewMatrix": "modelViewMatrixParameter", - "u_normalMatrix": "normalMatrixParameter", - "u_projectionMatrix": "projectionMatrixParameter", - "u_ambient": "ambientParameter", - "u_diffuse": "diffuseParameter", - "u_specular": "specularParameter", - "u_shininess": "shininessParameter", - "u_opacity": "opacityParameter" - }, - "parameters": { - "positionParameter" : { - "type": 35665, - "semantic": "POSITION" - }, - "normalParameter" : { - "type": 35665, - "semantic": "NORMAL" - }, - "modelViewMatrixParameter": { - "type": 35676, - "semantic": "MODELVIEW" - }, - "normalMatrixParameter": { - "type": 35675, - "semantic": "MODELVIEWINVERSETRANSPOSE" - }, - "projectionMatrixParameter": { - "type": 35676, - "semantic": "PROJECTION" - }, - "ambientParameter": { - "type": 35666, - "value": [ 0.1, 0.1, 0.1, 1.0 ] - }, - "diffuseParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "specularParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "shininessParameter": { - "type": 5126, - "value": [ 100.0 ] - }, - "opacityParameter": { - "type": 5126, - "value": [ 0.5 ] - } - }, - "states": { - "enable": [ 2929, 3042 ], - "functions": { - "blendEquationSeparate": [ 32774, 32774 ], - "blendFuncSeparate": [ 770, 771, 770, 771], - "depthMask": [false] - } - } - } - - }, - "programs": { - "opacityProgram": { - "vertexShader": "opacityVertexShader", - "fragmentShader": "opacityFragmentShader", - "attributes": [ - "a_position", - "a_normal" - ] - } - }, - "shaders": { - "opacityVertexShader": { - "type": 35633, - "uri": "opacity.vert" - }, - "opacityFragmentShader": { - "type": 35632, - "uri": "opacity.frag" - } - }, - - "buffers" : { - "geometryBuffer" : { - "uri" : "triangle.bin", - "byteLength" : 80 - } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 0, - "byteLength" : 6, - "target" : 34963 - }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 8, - "byteLength" : 72, - "target" : 34962 - } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", - "byteOffset" : 0, - "componentType" : 5123, - "count" : 3, - "type" : "SCALAR", - "max" : [ 2 ], - "min" : [ 0 ] - }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 3, - "type" : "VEC3", - "max" : [ 1.0, 1.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0 ] - }, - "normalsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 36, - "componentType" : 5126, - "count" : 3, - "type" : "VEC3", - "max" : [ 0.0, 0.0, 1.0 ], - "min" : [ 0.0, 0.0, 1.0 ] - } - }, - "asset" : { - "version" : "1.1" - } -} diff --git a/2.0/SimpleOpacity/glTF/opacity.frag b/2.0/SimpleOpacity/glTF/opacity.frag deleted file mode 100644 index 6c543c8e..00000000 --- a/2.0/SimpleOpacity/glTF/opacity.frag +++ /dev/null @@ -1,44 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -varying vec3 v_position; -varying vec3 v_normal; - -uniform vec4 u_ambient; -uniform vec4 u_diffuse; -uniform vec4 u_specular; -uniform float u_shininess; -uniform float u_opacity; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec3 normal = normalize(v_normal); - vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - vec3 diffuseLight = vec3(0.0, 0.0, 0.0); - vec3 lightColor = vec3(1.0, 1.0, 1.0); - vec4 ambient = u_ambient; - vec4 diffuse = u_diffuse; - vec4 specular = u_specular; - - vec3 specularLight = vec3(0.0, 0.0, 0.0); - { - float specularIntensity = 0.0; - float attenuation = 1.0; - vec3 l = normalize(v_light0Direction); - vec3 viewDir = -normalize(v_position); - vec3 h = normalize(l+viewDir); - specularIntensity = max(0.0, pow(max(dot(normal,h), 0.0) , u_shininess)) * attenuation; - specularLight += lightColor * specularIntensity; - diffuseLight += lightColor * max(dot(normal,l), 0.0) * attenuation; - } - specular.rgb *= specularLight; - diffuse.rgb *= diffuseLight; - color.rgb += ambient.rgb; - color.rgb += diffuse.rgb; - color.rgb += specular.rgb; - color.a = diffuse.a * u_opacity; - gl_FragColor = color; -} diff --git a/2.0/SimpleOpacity/glTF/opacity.vert b/2.0/SimpleOpacity/glTF/opacity.vert deleted file mode 100644 index e5d134ad..00000000 --- a/2.0/SimpleOpacity/glTF/opacity.vert +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -attribute vec3 a_position; -attribute vec3 a_normal; - -uniform mat3 u_normalMatrix; -uniform mat4 u_modelViewMatrix; -uniform mat4 u_projectionMatrix; - -varying vec3 v_position; -varying vec3 v_normal; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec4 pos = u_modelViewMatrix * vec4(a_position, 1.0); - v_normal = u_normalMatrix * a_normal; - v_position = pos.xyz; - v_light0Direction = mat3(u_modelViewMatrix) * vec3(1.0, 1.0, 1.0); - gl_Position = u_projectionMatrix * pos; -} diff --git a/2.0/SimpleOpacity/glTF/triangle.bin b/2.0/SimpleOpacity/glTF/triangle.bin deleted file mode 100644 index 291b43ca..00000000 Binary files a/2.0/SimpleOpacity/glTF/triangle.bin and /dev/null differ diff --git a/2.0/SimpleOpacity/screenshot/screenshot.png b/2.0/SimpleOpacity/screenshot/screenshot.png deleted file mode 100644 index 1eaa204a..00000000 Binary files a/2.0/SimpleOpacity/screenshot/screenshot.png and /dev/null differ diff --git a/2.0/SimpleOpacity/screenshot/triangle.png b/2.0/SimpleOpacity/screenshot/triangle.png deleted file mode 100644 index b4c5829d..00000000 Binary files a/2.0/SimpleOpacity/screenshot/triangle.png and /dev/null differ diff --git a/2.0/SimpleSkin/README.md b/2.0/SimpleSkin/README.md deleted file mode 100644 index 2037c9dd..00000000 --- a/2.0/SimpleSkin/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# SimpleSkin - -## Under construction! - -Parts of the skinning specification may be changed for glTF 1.1 - -## Screenshot - -![screenshot](screenshot/screenshot.gif) - -## License Information - -Public domain ([CC0](https://creativecommons.org/publicdomain/zero/1.0/)) - -## Data layout - -The following images show the data layout of this sample: - -![skinGeometry](screenshot/skinGeometry.png) -![skinAnimation](screenshot/skinAnimation.png) -![inverseBindMatrices](screenshot/inverseBindMatrices.png) -![skinningData](screenshot/skinningData.png) - diff --git a/2.0/SimpleSkin/glTF-Embedded-buffers/SimpleSkin.gltf b/2.0/SimpleSkin/glTF-Embedded-buffers/SimpleSkin.gltf deleted file mode 100644 index 77c24490..00000000 --- a/2.0/SimpleSkin/glTF-Embedded-buffers/SimpleSkin.gltf +++ /dev/null @@ -1,268 +0,0 @@ -{ - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] - } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ], - "skeletons": [ "jointNode0" ], - "skin": "simpleSkin" - }, - "jointNode0" : { - "jointName" : "joint0", - "children" : [ "jointNode1" ], - "translation" : [ 0.0, 1.0, 0.0 ] - }, - "jointNode1" : { - "jointName" : "joint1", - "rotation" : [ 0.0, 0.0, 0.0, 1.0 ] - } - }, - - "skins": { - "simpleSkin": { - "bindShapeMatrix": [ - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - -0.5, 0.0, 0.0, 1.0 - ], - "jointNames": [ - "joint0", - "joint1" - ], - "inverseBindMatrices": "inverseBindMatricesAccessor" - } - }, - - "animations": { - "animation0": { - "samplers" : { - "rotationSampler" : { - "input" : "TIMEAccessor", - "interpolation" : "LINEAR", - "output" : "rotationAccessor" - } - }, - "channels" : [ { - "sampler" : "rotationSampler", - "target" : { - "id" : "jointNode1", - "path" : "rotation" - } - } ] - } - }, - - "meshes" : { - "mesh0" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "JOINT" : "jointsAccessor", - "WEIGHT" : "weightsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "simpleSkinMaterial" - } ] - } - }, - - - "materials": { - "simpleSkinMaterial": { - "technique": "simpleSkinTechnique" - } - }, - - "techniques": { - "simpleSkinTechnique": { - "attributes": { - "a_position": "position", - "a_joint": "joint", - "a_weight": "weight" - }, - "uniforms": { - "u_jointMat": "jointMat", - "u_modelViewMatrix": "modelViewMatrix", - "u_projectionMatrix": "projectionMatrix" - }, - "parameters": { - "position": { - "semantic": "POSITION", - "type": 35665 - }, - "joint": { - "semantic": "JOINT", - "type": 35666 - }, - "weight": { - "semantic": "WEIGHT", - "type": 35666 - }, - "jointMat": { - "count": 2, - "semantic": "JOINTMATRIX", - "type": 35676 - }, - "modelViewMatrix": { - "semantic": "MODELVIEW", - "type": 35676 - }, - "projectionMatrix": { - "semantic": "PROJECTION", - "type": 35676 - } - }, - "program": "simpleSkinProgram", - "states": { - "enable": [ - 2929 - ] - } - } - }, - - "programs": { - "simpleSkinProgram": { - "attributes": [ - "a_position", - "a_joint", - "a_weight" - ], - "vertexShader": "simpleSkinVertexShader", - "fragmentShader": "simpleSkinFragmentShader" - } - }, - "shaders": { - "simpleSkinVertexShader": { - "type": 35633, - "uri": "simpleSkin.vert" - }, - "simpleSkinFragmentShader": { - "type": 35632, - "uri": "simpleSkin.frag" - } - }, - - - "buffers" : { - "geometryBuffer" : { - "uri" : "data:application/octet-stream;base64,AAABAAMAAAADAAIAAgADAAUAAgAFAAQABAAFAAcABAAHAAYABgAHAAkABgAJAAgAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAD8AAAAAAACAPwAAAD8AAAAAAAAAAAAAgD8AAAAAAACAPwAAgD8AAAAAAAAAAAAAwD8AAAAAAACAPwAAwD8AAAAAAAAAAAAAAEAAAAAAAACAPwAAAEAAAAAA", - "byteLength" : 168 - }, - "skinningBuffer" : { - "uri" : "data:application/octet-stream;base64,AAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAABAPwAAgD4AAAAAAAAAAAAAQD8AAIA+AAAAAAAAAAAAAAA/AAAAPwAAAAAAAAAAAAAAPwAAAD8AAAAAAAAAAAAAgD4AAEA/AAAAAAAAAAAAAIA+AABAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAA=", - "byteLength" : 320 - }, - "inverseBindMatricesBuffer" : { - "uri" : "data:application/octet-stream;base64,AACAPwAAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAgL8AAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIC/AAAAAAAAgD8=", - "byteLength" : 128 - }, - "animationBuffer" : { - "uri" : "data:application/octet-stream;base64,AAAAAAAAAD8AAIA/AADAPwAAAEAAACBAAABAQAAAYEAAAIBAAACQQAAAoEAAALBAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAkxjEPkSLbD8AAAAAAAAAAPT9ND/0/TQ/AAAAAAAAAAD0/TQ/9P00PwAAAAAAAAAAkxjEPkSLbD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAkxjEvkSLbD8AAAAAAAAAAPT9NL/0/TQ/AAAAAAAAAAD0/TS/9P00PwAAAAAAAAAAkxjEvkSLbD8AAAAAAAAAAAAAAAAAAIA/", - "byteLength" : 240 - } - }, - - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 0, - "byteLength" : 48, - "target" : 34963 - }, - "positionsBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 48, - "byteLength" : 120, - "target" : 34962 - }, - "skinningBufferView" : { - "buffer" : "skinningBuffer", - "byteOffset" : 0, - "byteLength" : 320, - "target" : 34962 - }, - "inverseBindMatricesBufferView" : { - "buffer" : "inverseBindMatricesBuffer", - "byteOffset" : 0, - "byteLength" : 128 - }, - "animationBufferView" : { - "buffer" : "animationBuffer", - "byteOffset" : 0, - "byteLength" : 240 - } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", - "byteOffset" : 0, - "componentType" : 5123, - "count" : 24, - "type" : "SCALAR", - "max" : [ 9 ], - "min" : [ 0 ] - }, - "positionsAccessor" : { - "bufferView" : "positionsBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 10, - "type" : "VEC3", - "max" : [ 1.0, 2.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0 ] - }, - "jointsAccessor" : { - "bufferView" : "skinningBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 10, - "type" : "VEC4", - "max" : [ 1.0, 1.0, 0.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0, 0.0 ] - }, - "weightsAccessor" : { - "bufferView" : "skinningBufferView", - "byteOffset" : 160, - "componentType" : 5126, - "count" : 10, - "type" : "VEC4", - "max" : [ 1.0, 1.0, 0.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0, 0.0 ] - }, - "inverseBindMatricesAccessor" : { - "bufferView" : "inverseBindMatricesBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 2, - "type" : "MAT4", - "max" : [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.0, 1.0], - "min" : [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -2.0, 0.0, 1.0] - }, - "TIMEAccessor" : { - "bufferView" : "animationBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 12, - "type" : "SCALAR", - "max" : [ 1.0 ], - "min" : [ 0.0 ] - }, - "rotationAccessor" : { - "bufferView" : "animationBufferView", - "byteOffset" : 48, - "componentType" : 5126, - "count" : 12, - "type" : "VEC4", - "max" : [ 0.0, 0.0, 0.707, 1.0 ], - "min" : [ 0.0, 0.0, -0.707, -0.707 ] - } - }, - "asset" : { - "version" : "1.1" - } -} diff --git a/2.0/SimpleSkin/glTF-Embedded-buffers/simpleSkin.frag b/2.0/SimpleSkin/glTF-Embedded-buffers/simpleSkin.frag deleted file mode 100644 index 1adc8d71..00000000 --- a/2.0/SimpleSkin/glTF-Embedded-buffers/simpleSkin.frag +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -void main(void) -{ - gl_FragColor = vec4(0.8, 0.5, 0.1, 1.0); -} diff --git a/2.0/SimpleSkin/glTF-Embedded-buffers/simpleSkin.vert b/2.0/SimpleSkin/glTF-Embedded-buffers/simpleSkin.vert deleted file mode 100644 index 0950813d..00000000 --- a/2.0/SimpleSkin/glTF-Embedded-buffers/simpleSkin.vert +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -attribute vec3 a_position; - -attribute vec4 a_joint; -attribute vec4 a_weight; - -uniform mat4 u_jointMat[2]; - -uniform mat4 u_modelViewMatrix; -uniform mat4 u_projectionMatrix; - -void main(void) -{ - mat4 skinMat = - a_weight.x * u_jointMat[int(a_joint.x)] + - a_weight.y * u_jointMat[int(a_joint.y)] + - a_weight.z * u_jointMat[int(a_joint.z)] + - a_weight.w * u_jointMat[int(a_joint.w)]; - vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0); - gl_Position = u_projectionMatrix * pos; -} diff --git a/2.0/SimpleSkin/glTF/SimpleSkin.gltf b/2.0/SimpleSkin/glTF/SimpleSkin.gltf deleted file mode 100644 index 97f06b8e..00000000 --- a/2.0/SimpleSkin/glTF/SimpleSkin.gltf +++ /dev/null @@ -1,268 +0,0 @@ -{ - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] - } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ], - "skeletons": [ "jointNode0" ], - "skin": "simpleSkin" - }, - "jointNode0" : { - "jointName" : "joint0", - "children" : [ "jointNode1" ], - "translation" : [ 0.0, 1.0, 0.0 ] - }, - "jointNode1" : { - "jointName" : "joint1", - "rotation" : [ 0.0, 0.0, 0.0, 1.0 ] - } - }, - - "skins": { - "simpleSkin": { - "bindShapeMatrix": [ - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - -0.5, 0.0, 0.0, 1.0 - ], - "jointNames": [ - "joint0", - "joint1" - ], - "inverseBindMatrices": "inverseBindMatricesAccessor" - } - }, - - "animations": { - "animation0": { - "samplers" : { - "rotationSampler" : { - "input" : "TIMEAccessor", - "interpolation" : "LINEAR", - "output" : "rotationAccessor" - } - }, - "channels" : [ { - "sampler" : "rotationSampler", - "target" : { - "id" : "jointNode1", - "path" : "rotation" - } - } ] - } - }, - - "meshes" : { - "mesh0" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "JOINT" : "jointsAccessor", - "WEIGHT" : "weightsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "simpleSkinMaterial" - } ] - } - }, - - - "materials": { - "simpleSkinMaterial": { - "technique": "simpleSkinTechnique" - } - }, - - "techniques": { - "simpleSkinTechnique": { - "attributes": { - "a_position": "position", - "a_joint": "joint", - "a_weight": "weight" - }, - "uniforms": { - "u_jointMat": "jointMat", - "u_modelViewMatrix": "modelViewMatrix", - "u_projectionMatrix": "projectionMatrix" - }, - "parameters": { - "position": { - "semantic": "POSITION", - "type": 35665 - }, - "joint": { - "semantic": "JOINT", - "type": 35666 - }, - "weight": { - "semantic": "WEIGHT", - "type": 35666 - }, - "jointMat": { - "count": 2, - "semantic": "JOINTMATRIX", - "type": 35676 - }, - "modelViewMatrix": { - "semantic": "MODELVIEW", - "type": 35676 - }, - "projectionMatrix": { - "semantic": "PROJECTION", - "type": 35676 - } - }, - "program": "simpleSkinProgram", - "states": { - "enable": [ - 2929 - ] - } - } - }, - - "programs": { - "simpleSkinProgram": { - "attributes": [ - "a_position", - "a_joint", - "a_weight" - ], - "vertexShader": "simpleSkinVertexShader", - "fragmentShader": "simpleSkinFragmentShader" - } - }, - "shaders": { - "simpleSkinVertexShader": { - "type": 35633, - "uri": "simpleSkin.vert" - }, - "simpleSkinFragmentShader": { - "type": 35632, - "uri": "simpleSkin.frag" - } - }, - - - "buffers" : { - "geometryBuffer" : { - "uri" : "skinGeometry.bin", - "byteLength" : 168 - }, - "skinningBuffer" : { - "uri" : "skinningData.bin", - "byteLength" : 320 - }, - "inverseBindMatricesBuffer" : { - "uri" : "inverseBindMatrices.bin", - "byteLength" : 128 - }, - "animationBuffer" : { - "uri" : "skinAnimation.bin", - "byteLength" : 240 - } - }, - - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 0, - "byteLength" : 48, - "target" : 34963 - }, - "positionsBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 48, - "byteLength" : 120, - "target" : 34962 - }, - "skinningBufferView" : { - "buffer" : "skinningBuffer", - "byteOffset" : 0, - "byteLength" : 320, - "target" : 34962 - }, - "inverseBindMatricesBufferView" : { - "buffer" : "inverseBindMatricesBuffer", - "byteOffset" : 0, - "byteLength" : 128 - }, - "animationBufferView" : { - "buffer" : "animationBuffer", - "byteOffset" : 0, - "byteLength" : 240 - } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", - "byteOffset" : 0, - "componentType" : 5123, - "count" : 24, - "type" : "SCALAR", - "max" : [ 9 ], - "min" : [ 0 ] - }, - "positionsAccessor" : { - "bufferView" : "positionsBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 10, - "type" : "VEC3", - "max" : [ 1.0, 2.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0 ] - }, - "jointsAccessor" : { - "bufferView" : "skinningBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 10, - "type" : "VEC4", - "max" : [ 1.0, 1.0, 0.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0, 0.0 ] - }, - "weightsAccessor" : { - "bufferView" : "skinningBufferView", - "byteOffset" : 160, - "componentType" : 5126, - "count" : 10, - "type" : "VEC4", - "max" : [ 1.0, 1.0, 0.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0, 0.0 ] - }, - "inverseBindMatricesAccessor" : { - "bufferView" : "inverseBindMatricesBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 2, - "type" : "MAT4", - "max" : [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.0, 1.0], - "min" : [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -2.0, 0.0, 1.0] - }, - "TIMEAccessor" : { - "bufferView" : "animationBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 12, - "type" : "SCALAR", - "max" : [ 1.0 ], - "min" : [ 0.0 ] - }, - "rotationAccessor" : { - "bufferView" : "animationBufferView", - "byteOffset" : 48, - "componentType" : 5126, - "count" : 12, - "type" : "VEC4", - "max" : [ 0.0, 0.0, 0.707, 1.0 ], - "min" : [ 0.0, 0.0, -0.707, -0.707 ] - } - }, - "asset" : { - "version" : "1.1" - } -} diff --git a/2.0/SimpleSkin/glTF/inverseBindMatrices.bin b/2.0/SimpleSkin/glTF/inverseBindMatrices.bin deleted file mode 100644 index 0bd11466..00000000 Binary files a/2.0/SimpleSkin/glTF/inverseBindMatrices.bin and /dev/null differ diff --git a/2.0/SimpleSkin/glTF/simpleSkin.frag b/2.0/SimpleSkin/glTF/simpleSkin.frag deleted file mode 100644 index 1adc8d71..00000000 --- a/2.0/SimpleSkin/glTF/simpleSkin.frag +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -void main(void) -{ - gl_FragColor = vec4(0.8, 0.5, 0.1, 1.0); -} diff --git a/2.0/SimpleSkin/glTF/simpleSkin.vert b/2.0/SimpleSkin/glTF/simpleSkin.vert deleted file mode 100644 index 0950813d..00000000 --- a/2.0/SimpleSkin/glTF/simpleSkin.vert +++ /dev/null @@ -1,24 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -attribute vec3 a_position; - -attribute vec4 a_joint; -attribute vec4 a_weight; - -uniform mat4 u_jointMat[2]; - -uniform mat4 u_modelViewMatrix; -uniform mat4 u_projectionMatrix; - -void main(void) -{ - mat4 skinMat = - a_weight.x * u_jointMat[int(a_joint.x)] + - a_weight.y * u_jointMat[int(a_joint.y)] + - a_weight.z * u_jointMat[int(a_joint.z)] + - a_weight.w * u_jointMat[int(a_joint.w)]; - vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0); - gl_Position = u_projectionMatrix * pos; -} diff --git a/2.0/SimpleSkin/glTF/skinAnimation.bin b/2.0/SimpleSkin/glTF/skinAnimation.bin deleted file mode 100644 index ff550c6f..00000000 Binary files a/2.0/SimpleSkin/glTF/skinAnimation.bin and /dev/null differ diff --git a/2.0/SimpleSkin/glTF/skinGeometry.bin b/2.0/SimpleSkin/glTF/skinGeometry.bin deleted file mode 100644 index 941dce11..00000000 Binary files a/2.0/SimpleSkin/glTF/skinGeometry.bin and /dev/null differ diff --git a/2.0/SimpleSkin/glTF/skinningData.bin b/2.0/SimpleSkin/glTF/skinningData.bin deleted file mode 100644 index 80712b29..00000000 Binary files a/2.0/SimpleSkin/glTF/skinningData.bin and /dev/null differ diff --git a/2.0/SimpleSkin/screenshot/inverseBindMatrices.png b/2.0/SimpleSkin/screenshot/inverseBindMatrices.png deleted file mode 100644 index 20218e9e..00000000 Binary files a/2.0/SimpleSkin/screenshot/inverseBindMatrices.png and /dev/null differ diff --git a/2.0/SimpleSkin/screenshot/screenshot.gif b/2.0/SimpleSkin/screenshot/screenshot.gif deleted file mode 100644 index 6b161efc..00000000 Binary files a/2.0/SimpleSkin/screenshot/screenshot.gif and /dev/null differ diff --git a/2.0/SimpleSkin/screenshot/skinAnimation.png b/2.0/SimpleSkin/screenshot/skinAnimation.png deleted file mode 100644 index 84f45834..00000000 Binary files a/2.0/SimpleSkin/screenshot/skinAnimation.png and /dev/null differ diff --git a/2.0/SimpleSkin/screenshot/skinGeometry.png b/2.0/SimpleSkin/screenshot/skinGeometry.png deleted file mode 100644 index 8734ab2c..00000000 Binary files a/2.0/SimpleSkin/screenshot/skinGeometry.png and /dev/null differ diff --git a/2.0/SimpleSkin/screenshot/skinningData.png b/2.0/SimpleSkin/screenshot/skinningData.png deleted file mode 100644 index ee62ba8a..00000000 Binary files a/2.0/SimpleSkin/screenshot/skinningData.png and /dev/null differ diff --git a/2.0/SimpleTexture/README.md b/2.0/SimpleTexture/README.md deleted file mode 100644 index 2a286077..00000000 --- a/2.0/SimpleTexture/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# SimpleOpacity - -## Screenshot - -![screenshot](screenshot/screenshot.png) - -## License Information - -Public domain ([CC0](https://creativecommons.org/publicdomain/zero/1.0/)) - -## Data layout - -The following image shows the data layout of this sample: - -![square](screenshot/square.png) diff --git a/2.0/SimpleTexture/glTF-Embedded-buffer/SimpleTexture.gltf b/2.0/SimpleTexture/glTF-Embedded-buffer/SimpleTexture.gltf deleted file mode 100644 index 29b65564..00000000 --- a/2.0/SimpleTexture/glTF-Embedded-buffer/SimpleTexture.gltf +++ /dev/null @@ -1,208 +0,0 @@ -{ - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] - } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] - } - }, - - "meshes" : { - "mesh0" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor", - "TEXCOORD_0" : "texCoordsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "textureMaterial" - } ] - } - }, - - "materials" : { - "textureMaterial" : { - "technique" : "textureTechnique" - } - }, - "techniques": { - "textureTechnique": { - "program": "textureProgram", - "attributes": { - "a_position": "positionParameter", - "a_normal": "normalParameter", - "a_texcoord0": "texcoord0Parameter" - }, - "uniforms": { - "u_modelViewMatrix": "modelViewMatrixParameter", - "u_normalMatrix": "normalMatrixParameter", - "u_projectionMatrix": "projectionMatrixParameter", - "u_ambient": "ambientParameter", - "u_diffuse": "diffuseParameter", - "u_specular": "specularParameter", - "u_shininess": "shininessParameter" - }, - "parameters": { - "positionParameter" : { - "type": 35665, - "semantic": "POSITION" - }, - "normalParameter" : { - "type": 35665, - "semantic": "NORMAL" - }, - "texcoord0Parameter" : { - "type": 35664, - "semantic": "TEXCOORD_0" - }, - "modelViewMatrixParameter": { - "type": 35676, - "semantic": "MODELVIEW" - }, - "normalMatrixParameter": { - "type": 35675, - "semantic": "MODELVIEWINVERSETRANSPOSE" - }, - "projectionMatrixParameter": { - "type": 35676, - "semantic": "PROJECTION" - }, - "ambientParameter": { - "type": 35666, - "value": [ 0.1, 0.1, 0.1, 1.0 ] - }, - "diffuseParameter": { - "type": 35678, - "value": [ "exampleTexture" ] - }, - "specularParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "shininessParameter": { - "type": 5126, - "value": [ 40.0 ] - } - }, - "states": { - "enable": [ - 2929 - ] - } - } - }, - "programs": { - "textureProgram": { - "vertexShader": "textureVertexShader", - "fragmentShader": "textureFragmentShader", - "attributes": [ - "a_position", - "a_normal", - "a_texcoord0" - ] - } - }, - "shaders": { - "textureVertexShader": { - "type": 35633, - "uri": "texture.vert" - }, - "textureFragmentShader": { - "type": 35632, - "uri": "texture.frag" - } - }, - - - "textures": { - "exampleTexture": { - "target": 3553, - "internalFormat": 6408, - "format": 6408, - "type": 5121, - "source": "exampleImage", - "sampler": "exampleSampler" - } - }, - "images": { - "exampleImage": { - "uri": "testTexture.png" - } - }, - "samplers": { - "exampleSampler": { - "magFilter": 9729, - "minFilter": 9987, - "wrapS": 33648, - "wrapT": 33648 - } - }, - - - "buffers" : { - "geometryBuffer" : { - "uri" : "data:application/octet-stream;base64,AAABAAIAAQADAAIAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AACAPwAAgD8=", - "byteLength" : 140 - } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 0, - "byteLength" : 12, - "target" : 34963 - }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 12, - "byteLength" : 128, - "target" : 34962 - } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", - "byteOffset" : 0, - "componentType" : 5123, - "count" : 6, - "type" : "SCALAR", - "max" : [ 3 ], - "min" : [ 0 ] - }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 4, - "type" : "VEC3", - "max" : [ 1.0, 1.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0 ] - }, - "normalsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 48, - "componentType" : 5126, - "count" : 4, - "type" : "VEC3", - "max" : [ 0.0, 0.0, 1.0 ], - "min" : [ 0.0, 0.0, 1.0 ] - }, - "texCoordsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 96, - "componentType" : 5126, - "count" : 4, - "type" : "VEC2", - "max" : [ 1.0, 1.0 ], - "min" : [ 0.0, 0.0 ] - } - }, - - "asset" : { - "version" : "1.1" - } -} diff --git a/2.0/SimpleTexture/glTF-Embedded-buffer/testTexture.png b/2.0/SimpleTexture/glTF-Embedded-buffer/testTexture.png deleted file mode 100644 index c3958476..00000000 Binary files a/2.0/SimpleTexture/glTF-Embedded-buffer/testTexture.png and /dev/null differ diff --git a/2.0/SimpleTexture/glTF-Embedded-buffer/texture.frag b/2.0/SimpleTexture/glTF-Embedded-buffer/texture.frag deleted file mode 100644 index d5d47d7f..00000000 --- a/2.0/SimpleTexture/glTF-Embedded-buffer/texture.frag +++ /dev/null @@ -1,44 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -varying vec3 v_position; -varying vec3 v_normal; -varying vec2 v_texcoord0; - -uniform vec4 u_ambient; -uniform sampler2D u_diffuse; -uniform vec4 u_specular; -uniform float u_shininess; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec3 normal = normalize(v_normal); - vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - vec3 diffuseLight = vec3(0.0, 0.0, 0.0); - vec3 lightColor = vec3(1.0, 1.0, 1.0); - vec4 ambient = u_ambient; - vec4 diffuse = texture2D(u_diffuse, v_texcoord0); - vec4 specular = u_specular; - - vec3 specularLight = vec3(0.0, 0.0, 0.0); - { - float specularIntensity = 0.0; - float attenuation = 1.0; - vec3 l = normalize(v_light0Direction); - vec3 viewDir = -normalize(v_position); - vec3 h = normalize(l+viewDir); - specularIntensity = max(0.0, pow(max(dot(normal,h), 0.0) , u_shininess)) * attenuation; - specularLight += lightColor * specularIntensity; - diffuseLight += lightColor * max(dot(normal,l), 0.0) * attenuation; - } - specular.rgb *= specularLight; - diffuse.rgb *= diffuseLight; - color.rgb += ambient.rgb; - color.rgb += diffuse.rgb; - color.rgb += specular.rgb; - color.a = diffuse.a; - gl_FragColor = color; -} diff --git a/2.0/SimpleTexture/glTF-Embedded-buffer/texture.vert b/2.0/SimpleTexture/glTF-Embedded-buffer/texture.vert deleted file mode 100644 index 95128334..00000000 --- a/2.0/SimpleTexture/glTF-Embedded-buffer/texture.vert +++ /dev/null @@ -1,27 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -attribute vec3 a_position; -attribute vec3 a_normal; -attribute vec2 a_texcoord0; - -uniform mat3 u_normalMatrix; -uniform mat4 u_modelViewMatrix; -uniform mat4 u_projectionMatrix; - -varying vec3 v_position; -varying vec3 v_normal; -varying vec2 v_texcoord0; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec4 pos = u_modelViewMatrix * vec4(a_position, 1.0); - v_normal = u_normalMatrix * a_normal; - v_position = pos.xyz; - v_light0Direction = mat3(u_modelViewMatrix) * vec3(1.0, 1.0, 1.0); - v_texcoord0 = a_texcoord0; - gl_Position = u_projectionMatrix * pos; -} diff --git a/2.0/SimpleTexture/glTF/SimpleTexture.gltf b/2.0/SimpleTexture/glTF/SimpleTexture.gltf deleted file mode 100644 index 62a2d086..00000000 --- a/2.0/SimpleTexture/glTF/SimpleTexture.gltf +++ /dev/null @@ -1,208 +0,0 @@ -{ - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] - } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] - } - }, - - "meshes" : { - "mesh0" : { - "primitives" : [ { - "attributes" : { - "POSITION" : "positionsAccessor", - "NORMAL" : "normalsAccessor", - "TEXCOORD_0" : "texCoordsAccessor" - }, - "indices" : "indicesAccessor", - "material" : "textureMaterial" - } ] - } - }, - - "materials" : { - "textureMaterial" : { - "technique" : "textureTechnique" - } - }, - "techniques": { - "textureTechnique": { - "program": "textureProgram", - "attributes": { - "a_position": "positionParameter", - "a_normal": "normalParameter", - "a_texcoord0": "texcoord0Parameter" - }, - "uniforms": { - "u_modelViewMatrix": "modelViewMatrixParameter", - "u_normalMatrix": "normalMatrixParameter", - "u_projectionMatrix": "projectionMatrixParameter", - "u_ambient": "ambientParameter", - "u_diffuse": "diffuseParameter", - "u_specular": "specularParameter", - "u_shininess": "shininessParameter" - }, - "parameters": { - "positionParameter" : { - "type": 35665, - "semantic": "POSITION" - }, - "normalParameter" : { - "type": 35665, - "semantic": "NORMAL" - }, - "texcoord0Parameter" : { - "type": 35664, - "semantic": "TEXCOORD_0" - }, - "modelViewMatrixParameter": { - "type": 35676, - "semantic": "MODELVIEW" - }, - "normalMatrixParameter": { - "type": 35675, - "semantic": "MODELVIEWINVERSETRANSPOSE" - }, - "projectionMatrixParameter": { - "type": 35676, - "semantic": "PROJECTION" - }, - "ambientParameter": { - "type": 35666, - "value": [ 0.1, 0.1, 0.1, 1.0 ] - }, - "diffuseParameter": { - "type": 35678, - "value": [ "exampleTexture" ] - }, - "specularParameter": { - "type": 35666, - "value": [ 1.0, 1.0, 1.0, 1.0 ] - }, - "shininessParameter": { - "type": 5126, - "value": [ 40.0 ] - } - }, - "states": { - "enable": [ - 2929 - ] - } - } - }, - "programs": { - "textureProgram": { - "vertexShader": "textureVertexShader", - "fragmentShader": "textureFragmentShader", - "attributes": [ - "a_position", - "a_normal", - "a_texcoord0" - ] - } - }, - "shaders": { - "textureVertexShader": { - "type": 35633, - "uri": "texture.vert" - }, - "textureFragmentShader": { - "type": 35632, - "uri": "texture.frag" - } - }, - - - "textures": { - "exampleTexture": { - "target": 3553, - "internalFormat": 6408, - "format": 6408, - "type": 5121, - "source": "exampleImage", - "sampler": "exampleSampler" - } - }, - "images": { - "exampleImage": { - "uri": "testTexture.png" - } - }, - "samplers": { - "exampleSampler": { - "magFilter": 9729, - "minFilter": 9987, - "wrapS": 33648, - "wrapT": 33648 - } - }, - - - "buffers" : { - "geometryBuffer" : { - "uri" : "square.bin", - "byteLength" : 140 - } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 0, - "byteLength" : 12, - "target" : 34963 - }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", - "byteOffset" : 12, - "byteLength" : 128, - "target" : 34962 - } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", - "byteOffset" : 0, - "componentType" : 5123, - "count" : 6, - "type" : "SCALAR", - "max" : [ 3 ], - "min" : [ 0 ] - }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 0, - "componentType" : 5126, - "count" : 4, - "type" : "VEC3", - "max" : [ 1.0, 1.0, 0.0 ], - "min" : [ 0.0, 0.0, 0.0 ] - }, - "normalsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 48, - "componentType" : 5126, - "count" : 4, - "type" : "VEC3", - "max" : [ 0.0, 0.0, 1.0 ], - "min" : [ 0.0, 0.0, 1.0 ] - }, - "texCoordsAccessor" : { - "bufferView" : "attributesBufferView", - "byteOffset" : 96, - "componentType" : 5126, - "count" : 4, - "type" : "VEC2", - "max" : [ 1.0, 1.0 ], - "min" : [ 0.0, 0.0 ] - } - }, - - "asset" : { - "version" : "1.1" - } -} diff --git a/2.0/SimpleTexture/glTF/square.bin b/2.0/SimpleTexture/glTF/square.bin deleted file mode 100644 index 774ec7ec..00000000 Binary files a/2.0/SimpleTexture/glTF/square.bin and /dev/null differ diff --git a/2.0/SimpleTexture/glTF/testTexture.png b/2.0/SimpleTexture/glTF/testTexture.png deleted file mode 100644 index c3958476..00000000 Binary files a/2.0/SimpleTexture/glTF/testTexture.png and /dev/null differ diff --git a/2.0/SimpleTexture/glTF/texture.frag b/2.0/SimpleTexture/glTF/texture.frag deleted file mode 100644 index d5d47d7f..00000000 --- a/2.0/SimpleTexture/glTF/texture.frag +++ /dev/null @@ -1,44 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -varying vec3 v_position; -varying vec3 v_normal; -varying vec2 v_texcoord0; - -uniform vec4 u_ambient; -uniform sampler2D u_diffuse; -uniform vec4 u_specular; -uniform float u_shininess; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec3 normal = normalize(v_normal); - vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - vec3 diffuseLight = vec3(0.0, 0.0, 0.0); - vec3 lightColor = vec3(1.0, 1.0, 1.0); - vec4 ambient = u_ambient; - vec4 diffuse = texture2D(u_diffuse, v_texcoord0); - vec4 specular = u_specular; - - vec3 specularLight = vec3(0.0, 0.0, 0.0); - { - float specularIntensity = 0.0; - float attenuation = 1.0; - vec3 l = normalize(v_light0Direction); - vec3 viewDir = -normalize(v_position); - vec3 h = normalize(l+viewDir); - specularIntensity = max(0.0, pow(max(dot(normal,h), 0.0) , u_shininess)) * attenuation; - specularLight += lightColor * specularIntensity; - diffuseLight += lightColor * max(dot(normal,l), 0.0) * attenuation; - } - specular.rgb *= specularLight; - diffuse.rgb *= diffuseLight; - color.rgb += ambient.rgb; - color.rgb += diffuse.rgb; - color.rgb += specular.rgb; - color.a = diffuse.a; - gl_FragColor = color; -} diff --git a/2.0/SimpleTexture/glTF/texture.vert b/2.0/SimpleTexture/glTF/texture.vert deleted file mode 100644 index 95128334..00000000 --- a/2.0/SimpleTexture/glTF/texture.vert +++ /dev/null @@ -1,27 +0,0 @@ -#ifdef GL_ES - precision highp float; -#endif - -attribute vec3 a_position; -attribute vec3 a_normal; -attribute vec2 a_texcoord0; - -uniform mat3 u_normalMatrix; -uniform mat4 u_modelViewMatrix; -uniform mat4 u_projectionMatrix; - -varying vec3 v_position; -varying vec3 v_normal; -varying vec2 v_texcoord0; - -varying vec3 v_light0Direction; - -void main(void) -{ - vec4 pos = u_modelViewMatrix * vec4(a_position, 1.0); - v_normal = u_normalMatrix * a_normal; - v_position = pos.xyz; - v_light0Direction = mat3(u_modelViewMatrix) * vec3(1.0, 1.0, 1.0); - v_texcoord0 = a_texcoord0; - gl_Position = u_projectionMatrix * pos; -} diff --git a/2.0/SimpleTexture/screenshot/screenshot.png b/2.0/SimpleTexture/screenshot/screenshot.png deleted file mode 100644 index 9a1c4def..00000000 Binary files a/2.0/SimpleTexture/screenshot/screenshot.png and /dev/null differ diff --git a/2.0/SimpleTexture/screenshot/square.png b/2.0/SimpleTexture/screenshot/square.png deleted file mode 100644 index 30180e8c..00000000 Binary files a/2.0/SimpleTexture/screenshot/square.png and /dev/null differ diff --git a/2.0/Triangle/glTF-Embedded/Triangle.gltf b/2.0/Triangle/glTF-Embedded/Triangle.gltf index f495cf45..5d875a61 100644 --- a/2.0/Triangle/glTF-Embedded/Triangle.gltf +++ b/2.0/Triangle/glTF-Embedded/Triangle.gltf @@ -1,49 +1,50 @@ { - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] + "scenes" : [ + { + "nodes" : [ 0 ] } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] + ], + + "nodes" : [ + { + "mesh" : 0 } - }, + ], - "meshes" : { - "mesh0" : { + "meshes" : [ + { "primitives" : [ { "attributes" : { - "POSITION" : "positionsAccessor" + "POSITION" : 1 }, - "indices" : "indicesAccessor" + "indices" : 0 } ] } - }, + ], - "buffers" : { - "geometryBuffer" : { + "buffers" : [ + { "uri" : "data:application/octet-stream;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAA=", "byteLength" : 44 } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", + ], + "bufferViews" : [ + { + "buffer" : 0, "byteOffset" : 0, "byteLength" : 6, "target" : 34963 }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", + { + "buffer" : 0, "byteOffset" : 8, "byteLength" : 36, "target" : 34962 } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", + ], + "accessors" : [ + { + "bufferView" : 0, "byteOffset" : 0, "componentType" : 5123, "count" : 3, @@ -51,8 +52,8 @@ "max" : [ 2 ], "min" : [ 0 ] }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", + { + "bufferView" : 1, "byteOffset" : 0, "componentType" : 5126, "count" : 3, @@ -60,8 +61,9 @@ "max" : [ 1.0, 1.0, 0.0 ], "min" : [ 0.0, 0.0, 0.0 ] } - }, + ], + "asset" : { - "version" : "1.1" + "version" : "2.0" } } diff --git a/2.0/Triangle/glTF/Triangle.gltf b/2.0/Triangle/glTF/Triangle.gltf index c45cb8b4..c0b59f93 100644 --- a/2.0/Triangle/glTF/Triangle.gltf +++ b/2.0/Triangle/glTF/Triangle.gltf @@ -1,49 +1,50 @@ { - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] + "scenes" : [ + { + "nodes" : [ 0 ] } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] + ], + + "nodes" : [ + { + "mesh" : 0 } - }, + ], - "meshes" : { - "mesh0" : { + "meshes" : [ + { "primitives" : [ { "attributes" : { - "POSITION" : "positionsAccessor" + "POSITION" : 1 }, - "indices" : "indicesAccessor" + "indices" : 0 } ] } - }, + ], - "buffers" : { - "geometryBuffer" : { + "buffers" : [ + { "uri" : "simpleTriangle.bin", "byteLength" : 44 } - }, - "bufferViews" : { - "indicesBufferView" : { - "buffer" : "geometryBuffer", + ], + "bufferViews" : [ + { + "buffer" : 0, "byteOffset" : 0, "byteLength" : 6, "target" : 34963 }, - "attributesBufferView" : { - "buffer" : "geometryBuffer", + { + "buffer" : 0, "byteOffset" : 8, "byteLength" : 36, "target" : 34962 } - }, - "accessors" : { - "indicesAccessor" : { - "bufferView" : "indicesBufferView", + ], + "accessors" : [ + { + "bufferView" : 0, "byteOffset" : 0, "componentType" : 5123, "count" : 3, @@ -51,8 +52,8 @@ "max" : [ 2 ], "min" : [ 0 ] }, - "positionsAccessor" : { - "bufferView" : "attributesBufferView", + { + "bufferView" : 1, "byteOffset" : 0, "componentType" : 5126, "count" : 3, @@ -60,8 +61,9 @@ "max" : [ 1.0, 1.0, 0.0 ], "min" : [ 0.0, 0.0, 0.0 ] } - }, + ], + "asset" : { - "version" : "1.1" + "version" : "2.0" } } diff --git a/2.0/TriangleWithoutIndices/glTF-Embedded/TriangleWithoutIndices.gltf b/2.0/TriangleWithoutIndices/glTF-Embedded/TriangleWithoutIndices.gltf index c674edd6..06632b57 100644 --- a/2.0/TriangleWithoutIndices/glTF-Embedded/TriangleWithoutIndices.gltf +++ b/2.0/TriangleWithoutIndices/glTF-Embedded/TriangleWithoutIndices.gltf @@ -1,42 +1,43 @@ { - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] + "scenes" : [ + { + "nodes" : [ 0 ] } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] + ], + + "nodes" : [ + { + "mesh" : 0 } - }, + ], - "meshes" : { - "mesh0" : { + "meshes" : [ + { "primitives" : [ { "attributes" : { - "POSITION" : "positionsAccessor" + "POSITION" : 0 } } ] } - }, + ], - "buffers" : { - "geometryBuffer" : { + "buffers" : [ + { "uri" : "data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAA", "byteLength" : 36 } - }, - "bufferViews" : { - "attributesBufferView" : { - "buffer" : "geometryBuffer", + ], + "bufferViews" : [ + { + "buffer" : 0, "byteOffset" : 0, "byteLength" : 36, "target" : 34962 } - }, - "accessors" : { - "positionsAccessor" : { - "bufferView" : "attributesBufferView", + ], + "accessors" : [ + { + "bufferView" : 0, "byteOffset" : 0, "componentType" : 5126, "count" : 3, @@ -44,9 +45,9 @@ "max" : [ 1.0, 1.0, 0.0 ], "min" : [ 0.0, 0.0, 0.0 ] } - }, + ], "asset" : { - "version" : "1.1" + "version" : "2.0" } } \ No newline at end of file diff --git a/2.0/TriangleWithoutIndices/glTF/TriangleWithoutIndices.gltf b/2.0/TriangleWithoutIndices/glTF/TriangleWithoutIndices.gltf index 1dc6cd39..148a778c 100644 --- a/2.0/TriangleWithoutIndices/glTF/TriangleWithoutIndices.gltf +++ b/2.0/TriangleWithoutIndices/glTF/TriangleWithoutIndices.gltf @@ -1,42 +1,43 @@ { - "scenes" : { - "scene0" : { - "nodes" : [ "node0" ] + "scenes" : [ + { + "nodes" : [ 0 ] } - }, - "nodes" : { - "node0" : { - "meshes" : [ "mesh0" ] - } - }, + ], - "meshes" : { - "mesh0" : { + "nodes" : [ + { + "mesh" : 0 + } + ], + + "meshes" : [ + { "primitives" : [ { "attributes" : { - "POSITION" : "positionsAccessor" + "POSITION" : 0 } } ] } - }, + ], - "buffers" : { - "geometryBuffer" : { + "buffers" : [ + { "uri" : "triangleWithoutIndices.bin", "byteLength" : 36 } - }, - "bufferViews" : { - "attributesBufferView" : { - "buffer" : "geometryBuffer", + ], + "bufferViews" : [ + { + "buffer" : 0, "byteOffset" : 0, "byteLength" : 36, "target" : 34962 } - }, - "accessors" : { - "positionsAccessor" : { - "bufferView" : "attributesBufferView", + ], + "accessors" : [ + { + "bufferView" : 0, "byteOffset" : 0, "componentType" : 5126, "count" : 3, @@ -44,8 +45,10 @@ "max" : [ 1.0, 1.0, 0.0 ], "min" : [ 0.0, 0.0, 0.0 ] } - }, + ], + "asset" : { - "version" : "1.1" + "version" : "2.0" } } +