{"id":17773637,"url":"https://github.com/shrekshao/minimal-gltf-loader","last_synced_at":"2025-03-15T16:32:27.215Z","repository":{"id":45575086,"uuid":"61250491","full_name":"shrekshao/minimal-gltf-loader","owner":"shrekshao","description":"A minimal, engine-agnostic JavaScript glTF Loader.","archived":false,"fork":false,"pushed_at":"2021-12-07T18:55:49.000Z","size":206824,"stargazers_count":183,"open_issues_count":6,"forks_count":32,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-15T02:39:41.273Z","etag":null,"topics":["gltf","gltf2","loader","pbr","skin","webgl2"],"latest_commit_sha":null,"homepage":"https://shrekshao.github.io/minimal-gltf-loader/examples/webgl2-renderer.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shrekshao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-16T00:43:25.000Z","updated_at":"2024-11-10T11:10:03.000Z","dependencies_parsed_at":"2022-09-21T12:03:11.942Z","dependency_job_id":null,"html_url":"https://github.com/shrekshao/minimal-gltf-loader","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrekshao%2Fminimal-gltf-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrekshao%2Fminimal-gltf-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrekshao%2Fminimal-gltf-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrekshao%2Fminimal-gltf-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shrekshao","download_url":"https://codeload.github.com/shrekshao/minimal-gltf-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243760345,"owners_count":20343626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gltf","gltf2","loader","pbr","skin","webgl2"],"created_at":"2024-10-26T21:45:40.842Z","updated_at":"2025-03-15T16:32:22.200Z","avatar_url":"https://github.com/shrekshao.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# minimal-gltf-loader\n[![Build Status](https://travis-ci.org/shrekshao/minimal-gltf-loader.svg?branch=master)](https://travis-ci.org/shrekshao/minimal-gltf-loader)\n[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/shrekshao/minimal-gltf-loader/blob/master/LICENSE.md)\n\nA minimal, engine-agnostic JavaScript glTF Loader, with a raw WebGL 2 simple renderer example using the loader.\n\n## Viewer Screenshot\n![](img/drone.gif)\n![](img/helmet-pbr.png)\n![](img/skin.gif)\n![](img/viewer-screenshot-buggy-bbox.png)\n\n## Live Demo\n\n[click here for live demo](https://shrekshao.github.io/minimal-gltf-loader/examples/webgl2-renderer.html)\n\n# Usage\n\n```javascript\nimport {vec3, vec4, quat, mat4} from 'gl-matrix';\nvar MinimalGLTFLoader = require('build/minimal-gltf-loader.js');\n\nvar glTFLoader = new MinimalGLTFLoader.glTFLoader();\nglTFLoader.loadGLTF(url, function(glTF){\n    //...\n});\n```\n\n\n## Loading Features\n\n* [x] Accessors\n    - [ ] Progressive loading / rendering\n* [x] Buffers\n* [x] BufferViews\n* [x] Images\n* [x] Meshes\n* [x] Nodes\n* [x] Primitives\n* [x] Samplers\n* [x] Textures\n* [x] ~~Shader Loader~~ (not part of the core of glTF 2.0)\n* [x] Animations\n* [x] Cameras\n* [x] Materials\n* [x] Skins\n\n## Formats\n\n* [x] glTF (.gltf) with separate resources: .bin (geometry, animation, skins), .glsl (shaders), and image files\n* [ ] glTF (.gltf) with embedded resources\n* [ ] Binary glTF (.glb) using the [KHR_binary_glTF](https://github.com/KhronosGroup/glTF/blob/master/extensions/Khronos/KHR_binary_glTF/README.md) extension\n\n## Examples\n\n* [x] WebGL 2 simple renderer\n    * [x] baseColorFactor\n    * [x] baseColorTexture\n    * [x] normalTexture\n    * [x] Skybox\n    * [x] PBR\n    * [x] Animation\n    * [ ] Interpolations\n        - [x] LINEAR\n        - [ ] STEP\n        - [ ] CATMULLROMSPLINE\n        - [ ] CUBICSPLINE\n    * [x] Skin\n    * [ ] Camera (from glTF)\n    * [ ] Progressive rendering (No plan for this)\n    * [ ] Occlusion Culling experiment \n        * [x] Bounding Box\n            * [x] AABB (Axis Aligned Bounding Box, *static)\n            * [x] OBB (Object/Oriented Bounding Box)\n        * [x] Scene Bounding Box (fast iterated) And auto centered and scaled\n        * [ ] Build octree\n        * [ ] Occlusion Query with hierarchy\n\n\n## Credits\n\n* [glTF sample Model](https://github.com/KhronosGroup/glTF-Sample-Models) and [Buster Drone By LaVADraGoN](https://sketchfab.com/models/294e79652f494130ad2ab00a13fdbafd)\n* Great thanks to Trung Le ([@trungtle](https://github.com/trungtle)) and Patrick Cozzi ([@pjcozzi](https://github.com/pjcozzi)) for contributing and advising. \n* gl-Matrix by Brandon Jones ([@toji](https://github.com/toji)) and Colin MacKenzie IV ([@sinisterchipmunk](https://github.com/sinisterchipmunk))\n* [glTF-WebGL-PBR](https://github.com/KhronosGroup/glTF-WebGL-PBR)\n\n\n\n---\n# minimal-gltf-loader-typescript\n\nA minimal, engine-agnostic TypeScript glTF Loader.\n\n## What's new in gltf-loader-typescript\n\nThis loader is a new instance of the minimal-gltf-loader. \n\nIn this branch, the author updated the loading file fuction from XMLHttpRequest to fetch API and used Promise and async/await to make loading procedure much more clearer.\n\nIn glTF 2.0 standard, the target attribute on bufferView is optional. Different 3D softwares have different interpretation of glTF exporter.\nFor instance, the glTF files exported by Cinema4D have filled target attribute, but those exported by Blender 2.80+ **will NOT** have the target attribute filled. (Can see the issue in the following link:\n[KhronosGroup/glTF-Blender-IO#142](https://github.com/KhronosGroup/glTF-Blender-IO/issues/142))\nTherefore, before binding buffer, the loader should infer the target attribute is whether ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER accoring to the usage of bufferview.\n## Usage\n\n```typescript\nimport {vec3, vec4, quat, mat4} from 'gl-matrix';\nimport {GLTFLoader, GLTF} from './src/glTFLoader.ts'\n\nlet gl : WebGLRenderingContext | WebGL2RenderingContext;\n\nnew GLTFLoader(gl).loadGLTF('YourURL').then((glTF: GLTF) =\u003e {\n    // Create with glTF object, and proceed rendering process...\n}).catch (() =\u003e {\n    // Error control...\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshrekshao%2Fminimal-gltf-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshrekshao%2Fminimal-gltf-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshrekshao%2Fminimal-gltf-loader/lists"}