Add glTF PBR model loading
[opengl.git] / models / sphereMetal.gltf
diff --git a/models/sphereMetal.gltf b/models/sphereMetal.gltf
new file mode 100644 (file)
index 0000000..4b9e8cc
--- /dev/null
@@ -0,0 +1,427 @@
+{
+    "accessors" : [
+        {
+            "bufferView" : 0,
+            "componentType" : 5123,
+            "count" : 29400,
+            "max" : [
+                5003
+            ],
+            "min" : [
+                0
+            ],
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 1,
+            "componentType" : 5126,
+            "count" : 5004,
+            "max" : [
+                1.0000009536743164,
+                1.0,
+                1.0000017881393433
+            ],
+            "min" : [
+                -1.0000007152557373,
+                -1.0,
+                -1.0
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 2,
+            "componentType" : 5126,
+            "count" : 5004,
+            "max" : [
+                1.0,
+                1.0,
+                1.0
+            ],
+            "min" : [
+                -1.0,
+                -1.0,
+                -1.0
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 3,
+            "componentType" : 5126,
+            "count" : 5004,
+            "max" : [
+                0.9990525245666504,
+                0.1821206957101822,
+                0.9870549440383911,
+                1.0
+            ],
+            "min" : [
+                -0.9990525245666504,
+                -0.1808946281671524,
+                -0.987054705619812,
+                -1.0
+            ],
+            "type" : "VEC4"
+        },
+        {
+            "bufferView" : 4,
+            "componentType" : 5126,
+            "count" : 5004,
+            "max" : [
+                1.4449338912963867,
+                0.9933801889419556
+            ],
+            "min" : [
+                0.00026097893714904785,
+                0.006618916988372803
+            ],
+            "type" : "VEC2"
+        },
+        {
+            "bufferView" : 5,
+            "componentType" : 5123,
+            "count" : 118800,
+            "max" : [
+                19999
+            ],
+            "min" : [
+                0
+            ],
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 6,
+            "componentType" : 5126,
+            "count" : 20000,
+            "max" : [
+                1.0000005960464478,
+                1.0,
+                1.0000009536743164
+            ],
+            "min" : [
+                -0.9999977946281433,
+                -1.0,
+                -1.0
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 7,
+            "componentType" : 5126,
+            "count" : 20000,
+            "max" : [
+                1.0,
+                1.0,
+                1.0
+            ],
+            "min" : [
+                -1.0,
+                -1.0,
+                -0.999969482421875
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 8,
+            "componentType" : 5126,
+            "count" : 20000,
+            "max" : [
+                0.9809380769729614,
+                0.3905962109565735,
+                0.9425740242004395,
+                1.0
+            ],
+            "min" : [
+                -0.980937659740448,
+                -0.3905961215496063,
+                -0.9425736665725708,
+                1.0
+            ],
+            "type" : "VEC4"
+        },
+        {
+            "bufferView" : 9,
+            "componentType" : 5126,
+            "count" : 20000,
+            "max" : [
+                1.3736257553100586,
+                0.9968895316123962
+            ],
+            "min" : [
+                3.013014793395996e-05,
+                0.0031104683876037598
+            ],
+            "type" : "VEC2"
+        }
+    ],
+    "asset" : {
+        "generator" : "Khronos Blender glTF 2.0 exporter",
+        "version" : "2.0"
+    },
+    "bufferViews" : [
+        {
+            "buffer" : 0,
+            "byteLength" : 58800,
+            "byteOffset" : 0,
+            "target" : 34963
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 60048,
+            "byteOffset" : 58800,
+            "target" : 34962
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 60048,
+            "byteOffset" : 118848,
+            "target" : 34962
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 80064,
+            "byteOffset" : 178896,
+            "target" : 34962
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 40032,
+            "byteOffset" : 258960,
+            "target" : 34962
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 237600,
+            "byteOffset" : 298992,
+            "target" : 34963
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 240000,
+            "byteOffset" : 536592,
+            "target" : 34962
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 240000,
+            "byteOffset" : 776592,
+            "target" : 34962
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 320000,
+            "byteOffset" : 1016592,
+            "target" : 34962
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 160000,
+            "byteOffset" : 1336592,
+            "target" : 34962
+        }
+    ],
+    "buffers" : [
+        {
+            "byteLength" : 1496592,
+            "uri" : "sphereMetal.bin"
+        }
+    ],
+    "images" : [
+        {
+            "name" : "greasy-pan-2-albedo",
+            "uri" : "greasy-pan-2-albedo.png"
+        },
+        {
+            "name" : "greasy-pan-2-normal",
+            "uri" : "greasy-pan-2-normal.png"
+        },
+        {
+            "name" : "greasy-pan-2-ao",
+            "uri" : "greasy-pan-2-ao.png"
+        },
+        {
+            "name" : "greasy-pan-2-metallicroughness",
+            "uri" : "greasy-pan-2-metallicroughness.png"
+        },
+        {
+            "name" : "streakedmetal-albedo",
+            "uri" : "streakedmetal-albedo.png"
+        },
+        {
+            "name" : "streakedmetal-normal",
+            "uri" : "streakedmetal-normal.png"
+        },
+        {
+            "name" : "streakedmetal-metallicroughness",
+            "uri" : "streakedmetal-metallicroughness.png"
+        },
+        {
+            "name" : "streakedmetal-ao",
+            "uri" : "streakedmetal-ao.png"
+        }
+    ],
+    "materials" : [
+        {
+            "name" : "Greasy Metal",
+            "normalTexture" : {
+                "index" : 1
+            },
+            "occlusionTexture" : {
+                "index" : 2
+            },
+            "pbrMetallicRoughness" : {
+                "baseColorTexture" : {
+                    "index" : 0
+                },
+                "metallicRoughnessTexture" : {
+                    "index" : 3
+                }
+            }
+        },
+        {
+            "name" : "Streaked Metal",
+            "normalTexture" : {
+                "index" : 5
+            },
+            "occlusionTexture" : {
+                "index" : 7
+            },
+            "pbrMetallicRoughness" : {
+                "baseColorTexture" : {
+                    "index" : 4
+                },
+                "metallicRoughnessTexture" : {
+                    "index" : 6
+                }
+            }
+        }
+    ],
+    "meshes" : [
+        {
+            "name" : "Sphere.001",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 2,
+                        "POSITION" : 1,
+                        "TANGENT" : 3,
+                        "TEXCOORD_0" : 4
+                    },
+                    "indices" : 0,
+                    "material" : 1
+                }
+            ]
+        },
+        {
+            "name" : "Sphere",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 7,
+                        "POSITION" : 6,
+                        "TANGENT" : 8,
+                        "TEXCOORD_0" : 9
+                    },
+                    "indices" : 5,
+                    "material" : 0
+                }
+            ]
+        }
+    ],
+    "nodes" : [
+        {
+            "name" : "Camera",
+            "rotation" : [
+                0.483536034822464,
+                0.33687159419059753,
+                -0.20870360732078552,
+                0.7804827094078064
+            ],
+            "translation" : [
+                7.481131553649902,
+                5.34366512298584,
+                6.5076398849487305
+            ]
+        },
+        {
+            "name" : "Lamp",
+            "rotation" : [
+                0.16907575726509094,
+                0.7558802962303162,
+                -0.27217137813568115,
+                0.570947527885437
+            ],
+            "scale" : [
+                1.0,
+                1.0,
+                0.9999999403953552
+            ],
+            "translation" : [
+                4.076245307922363,
+                4.028226852416992,
+                -1.0054539442062378
+            ]
+        },
+        {
+            "mesh" : 1,
+            "name" : "Sphere"
+        },
+        {
+            "mesh" : 0,
+            "name" : "Sphere.001",
+            "translation" : [
+                2.5,
+                0.0,
+                -0.0
+            ]
+        }
+    ],
+    "samplers" : [
+        {}
+    ],
+    "scene" : 0,
+    "scenes" : [
+        {
+            "name" : "Scene",
+            "nodes" : [
+                3,
+                2,
+                1,
+                0
+            ]
+        }
+    ],
+    "textures" : [
+        {
+            "sampler" : 0,
+            "source" : 0
+        },
+        {
+            "sampler" : 0,
+            "source" : 1
+        },
+        {
+            "sampler" : 0,
+            "source" : 2
+        },
+        {
+            "sampler" : 0,
+            "source" : 3
+        },
+        {
+            "sampler" : 0,
+            "source" : 4
+        },
+        {
+            "sampler" : 0,
+            "source" : 5
+        },
+        {
+            "sampler" : 0,
+            "source" : 6
+        },
+        {
+            "sampler" : 0,
+            "source" : 7
+        }
+    ]
+}