{"id":15160419,"url":"https://github.com/khronosgroup/unitygltf","last_synced_at":"2026-02-05T19:01:08.113Z","repository":{"id":37972480,"uuid":"84389723","full_name":"KhronosGroup/UnityGLTF","owner":"KhronosGroup","description":"Runtime glTF 2.0 Loader for Unity3D","archived":false,"fork":false,"pushed_at":"2026-01-27T15:51:07.000Z","size":211184,"stargazers_count":2108,"open_issues_count":80,"forks_count":527,"subscribers_count":106,"default_branch":"main","last_synced_at":"2026-01-28T02:21:11.063Z","etag":null,"topics":["gltf","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","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/KhronosGroup.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-03-09T02:40:28.000Z","updated_at":"2026-01-26T10:33:47.000Z","dependencies_parsed_at":"2024-04-14T01:31:56.955Z","dependency_job_id":"643df76f-16ff-4b90-a50c-65b805f4f4ec","html_url":"https://github.com/KhronosGroup/UnityGLTF","commit_stats":{"total_commits":1662,"total_committers":82,"mean_commits":20.26829268292683,"dds":0.7075812274368232,"last_synced_commit":"e20fd5aedff6bc15cc12a083967c4a3288e6ae91"},"previous_names":[],"tags_count":188,"template":false,"template_full_name":null,"purl":"pkg:github/KhronosGroup/UnityGLTF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FUnityGLTF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FUnityGLTF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FUnityGLTF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FUnityGLTF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhronosGroup","download_url":"https://codeload.github.com/KhronosGroup/UnityGLTF/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FUnityGLTF/sbom","scorecard":{"id":78391,"data":{"date":"2025-08-11","repo":{"name":"github.com/KhronosGroup/UnityGLTF","commit":"7408dec2a53e1fac3bd06a6e28c86e7fce4243df"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 24 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-15T05:18:00.129Z","repository_id":37972480,"created_at":"2025-08-15T05:18:00.129Z","updated_at":"2025-08-15T05:18:00.129Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29130091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T18:55:47.139Z","status":"ssl_error","status_checked_at":"2026-02-05T18:55:04.010Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","unity3d"],"created_at":"2024-09-26T23:00:47.067Z","updated_at":"2026-02-05T19:01:08.105Z","avatar_url":"https://github.com/KhronosGroup.png","language":"C#","readme":"\u003cimg src=\"https://github.com/KhronosGroup/UnityGLTF/blob/e3797354f8d729156062265cbac98804a109d8f0/unitygltf-logo.png\" width=\"200\" /\u003e \n\n![Great coverage of glTF 2.0.](https://img.shields.io/badge/glTF%20Spec-2.0-brightgreen)\n![Unity 2021.3+ and URP recommended](https://img.shields.io/badge/Unity-2021.3%E2%80%936000.0%2B-brightgreen)\n\n![URP supported](https://img.shields.io/badge/Render%20Pipeline-URP-brightgreen)\n![BiRP supported with better support on 2021.3+](https://img.shields.io/badge/Render%20Pipeline-Built--in-brightgreen)\n![HDRP support is not actively maintained](https://img.shields.io/badge/Render%20Pipeline-HDRP-yellow)\n\nUnity3D library for importing and exporting [glTF 2.0](https://github.com/KhronosGroup/glTF/) assets.\n\n|        | Editor | Runtime |\n|--------|--------|---------|\n| Import | ✅      | ✅       |\n| Export | ✅      | ✅       |\n\nUnityGLTF doesn't have any native dependencies (pure C#) and thus works on all platforms that Unity supports. This includes WebGL import and export.\n\nThe library is designed to be easy to extend with additional extensions to the glTF specification. Both import and export allow attaching custom plugins and callbacks and can be heavily modified to fit into specific pipelines. Many glTF extensions are supported.\n\n## Contents \u003c!-- omit from toc --\u003e\n- [Installation](#installation)\n- [Unity Version and Render Pipeline Compatibility](#unity-version-and-render-pipeline-compatibility)\n- [UnityGLTF and glTFast](#unitygltf-and-gltfast)\n- [Supported Features and Extensions](#supported-features-and-extensions)\n  - [Import and Export](#import-and-export)\n  - [Import only](#import-only)\n  - [Export only](#export-only)\n- [glTF Interactivity](#gltf-interactivity)\n  - [Visual Scripting Graph Exporter](#visual-scripting-graph-exporter)\n  - [Features](#features)\n  - [Unsupported](#unsupported)\n  - [Viewer support](#viewer-support)\n- [glTF Materials](#gltf-materials)\n  - [Material Conversions](#material-conversions)\n  - [Material and Shader Export Compatibility](#material-and-shader-export-compatibility)\n  - [Configure for Refractive Materials (Transmission and Volume)](#configure-for-refractive-materials-transmission-and-volume)\n    - [Material Setup](#material-setup)\n    - [URP](#urp)\n    - [Built-In](#built-in)\n    - [HDRP](#hdrp)\n- [Exporting glTF Files](#exporting-gltf-files)\n  - [Testing, debugging, compatibility](#testing-debugging-compatibility)\n- [Animation Export](#animation-export)\n  - [Animator Controller](#animator-controller)\n  - [GLTFRecorder API](#gltfrecorder-api)\n  - [Timeline Recorder](#timeline-recorder)\n  - [Legacy Animation Component](#legacy-animation-component)\n  - [KHR\\_animation\\_pointer support](#khr_animation_pointer-support)\n- [Blend Shape Export](#blend-shape-export)\n- [Importing glTF files](#importing-gltf-files)\n  - [Runtime Import](#runtime-import)\n    - [Load via Gltf Component](#load-via-gltf-component)\n    - [Load via code example:](#load-via-code-example)\n  - [Ensure shaders are available in your build](#ensure-shaders-are-available-in-your-build)\n  - [Editor Import](#editor-import)\n  - [Default Importer Selection](#default-importer-selection)\n- [Animation Import](#animation-import)\n- [Extensibility](#extensibility)\n  - [Example for custom export plugin](#example-for-custom-export-plugin)\n  - [Example for custom import plugin](#example-for-custom-import-plugin)\n- [Known Issues](#known-issues)\n- [Contributing](#contributing)\n  - [Unity Package](#unity-package)\n  - [GLTFSerializer](#gltfserializer)\n  - [Tests](#tests)\n\n## Installation\n\nYou can install this package from the Needle Package Registry with a one-click installer:  \n\n1. Download [UnityGLTF Package Installer](https://package-installer.glitch.me/v1/installer/Needle/org.khronos.unitygltf?registry=https://packages.needle.tools)\n2. Drop the downloaded .unitypackage into Unity and follow the steps.\n\nYou can also install this package from git, compatible with UPM (Unity Package Manager).\n1. Open `Window \u003e Package Manager`\n2. Click \u003ckbd\u003e+\u003c/kbd\u003e\n3. Select \u003ckbd\u003eAdd Package from git URL\u003c/kbd\u003e\n4. Paste\n   ```\n   https://github.com/KhronosGroup/UnityGLTF.git\n   ```\n5. Click \u003ckbd\u003eAdd\u003c/kbd\u003e.\n\n\u003e **Note**: If you want to target a specific version, append `#release/\u003csome-tag\u003e` or a specific commit to the URL above.\n\u003e Example: `https://github.com/KhronosGroup/UnityGLTF.git#release/2.14.1`.\n\n## Unity Version and Render Pipeline Compatibility\n\nPlease use Long-Term Support versions of Unity (2021.3+, 2022.3+, 6000.0+).\n\n**Recommended:**\n- Unity 2021.3+, Unity 2022.3+, Unity 6+\n- Linear colorspace\n- Universal Render Pipeline (URP) and Built-In Render Pipeline (BiRP)\n\n**HDRP**:\n- Currently limited functionality.\n\n**Legacy:**\n- When using Unity 2020.3, please use an older version of UnityGLTF, like 2.9.1-rc and before.\n\n\u003e **Note:** Issues on non-LTS Unity versions (not on 2021.3, 2022.3, 6000.0...) will most likely not be addressed. Please use LTS (Long-Term Support) versions where possible.\n\n## UnityGLTF and glTFast\n\nA separate glTF implementation for Unity, [glTFast](https://docs.unity3d.com/Packages/com.unity.cloud.gltfast@latest), is available from the Unity Registry.  \nglTFast being supported by Unity means, in a nutshell, that it sticks to standards pretty strictly and can't easily ship non-ratified extensions or experimental features that work for the majority, but not all, of users.  \n- UnityGLTF aims to be the more _flexible_ framework, with extensive import/export plugin support and useful plugins out of the box.  \n- glTFast aims to be the more _performant_ framework, with a focus on leveraging Unity-specific features such as Burst and Jobs.  \n- UnityGLTF has a versatile plugin/extension infrastructure. This allows for a lot of flexibility during import/export.\n- UnityGLTF enables the use of and ships with non-ratified extensions such as `KHR_animation_pointer`, `KHR_audio`, and `KHR_materials_variants`.\n- glTFast leverages Unity-specific features such as Burst and Jobs and thus can have better performance in some cases.\n- glTFast has better HDRP support.\n\nglTFast and UnityGLTF can **coexist in the same project**; you can for example use glTFast for import and UnityGLTF for export.  \nFor imported assets, you can choose which importer to use with a dropdown.  \nglTFast import has precedence if both are in the same project. See also [Default Importer Selection](#default-importer-selection).\n\n## Supported Features and Extensions\nThe lists below are non-conclusive and in no particular order. Note that there are gaps where features could easily be supported for im- and export but currently aren't. PRs welcome!\n\n### Import and Export\n\n- Animation and Animator with multiple clips\n- Skinned Mesh Renderers\n- Blend Shapes\n  - Sparse accessors for Blend Shapes\n- Linear and Gamma colorspace support (Gamma won't be maintained anymore)\n- Vertex Colors\n- Cameras (perspective, orthographic)\n- URP and Built-In Render Pipeline [Learn More](#material-and-shader-export-compatibility)\n- [KHR_lights_punctual](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_lights_punctual/README.md) (point, spot, and directional lights)\n- [KHR_texture_transform](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_texture_transform/README.md) (UV offset, scale, rotation)\n- [KHR_materials_unlit](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_unlit/README.md) (unlit surfaces)\n- [KHR_materials_transmission](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/README.md) (glass-like materials)\n- [KHR_materials_volume](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_volume/README.md) (refractive materials)\n- [KHR_materials_ior](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_ior/README.md) (for transmission and volume)\n- [KHR_materials_emissive_strength](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_emissive_strength/README.md) (emissive values greater than 1)\n- [KHR_materials_iridescence](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_iridescence/README.md) (thin-film interference, like oil on water)\n- [KHR_materials_clearcoat](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_clearcoat/README.md) (secondary specular layer, like a coat of varnish)\n- [KHR_materials_sheen](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_sheen/README.md) (fabric surfaces)\n- [KHR_materials_specular](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_specular/README.md) (partial support)\n- [KHR_materials_dispersion](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_dispersion/README.md) (refractive index dispersion)\n- [KHR_animation_pointer](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_animation_pointer/README.md) (arbitrary property animations)\n- [MSFT_lod](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/MSFT_lod/README.md) (level of detail) ![Vendor-specific Extension](https://img.shields.io/badge/⚠️%20Vendor--specific%20Extension-gray)\n- [KHR_node_visibility](https://github.com/KhronosGroup/glTF/blob/fbe806836526cdd8cd99ed3770b1c56df56c6863/extensions/2.0/Khronos/KHR_node_visibility/README.md) (GameObject active state) ![Non-Ratified Extension](https://img.shields.io/badge/⚠️%20Non--Ratified%20Extension-gray)\n- [`KHR_node_hoverability`](https://github.com/KhronosGroup/glTF/pull/2426) ![Non-Ratified Extension](https://img.shields.io/badge/⚠️%20Non--Ratified%20Extension-gray)\n- [`KHR_node_selectability`](https://github.com/KhronosGroup/glTF/pull/2422) ![Non-Ratified Extension](https://img.shields.io/badge/⚠️%20Non--Ratified%20Extension-gray)\n- [KHR_interactivity](https://github.com/KhronosGroup/glTF/blob/220ca407a2ce1f8463855803778edf73a885b7e9/extensions/2.0/Khronos/KHR_interactivity/Specification.adoc) (Visual Scripting export as interactivity graph) ![Non-Ratified Extension](https://img.shields.io/badge/⚠️%20Non--Ratified%20Extension-gray)\n\n### Import only\n\n- [KHR_mesh_quantization](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_mesh_quantization/README.md) (smaller buffers / smaller filesize)\n- [KHR_draco_mesh_compression](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md) (requires [`com.unity.cloud.draco`](https://docs.unity3d.com/Packages/com.unity.cloud.draco@latest))\n- [KHR_texture_basisu](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_texture_basisu/README.md) (requires [`com.unity.cloud.ktx`](https://docs.unity3d.com/Packages/com.unity.cloud.ktx@latest))\n- [EXT_mesh_gpu_instancing](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md) (instance data) ![Vendor-specific Extension](https://img.shields.io/badge/⚠️%20Vendor--specific%20Extension-gray)\n- [EXT_meshopt_compression](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/README.md) (requires [`com.unity.meshopt.decompress`](https://docs.unity3d.com/Packages/com.unity.meshopt.decompress@latest)) ![Vendor-specific Extension](https://img.shields.io/badge/⚠️%20Vendor--specific%20Extension-gray)\n\n### Export only\n\n- [KHR_materials_variants](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_variants/README.md)\n- [KHR_interactivity](https://github.com/KhronosGroup/glTF/blob/interactivity/extensions/2.0/Khronos/KHR_interactivity/Specification.adoc) (Visual Scripting Graph exporter) ![Non-Ratified Extension](https://img.shields.io/badge/⚠️%20Non--Ratified%20Extension-gray)\n- Timeline recorder track for exporting animations in the editor and at runtime\n- Lossless keyframe optimization on export\n- All 2D textures can be exported, RenderTextures included – they're baked at export.\n- Optional plugin: Bake TMPro 3D objects to meshes on export\n- Optional plugin: Bake Particle Systems to meshes on export\n- Optional plugin: Bake Canvas to meshes on export\n- Included plugin sample: [KHR_audio_emitter](https://github.com/KhronosGroup/glTF/pull/2137) ![Non-Ratified Extension](https://img.shields.io/badge/⚠️%20Non--Ratified%20Extension-gray)\n\n## glTF Interactivity\n### Visual Scripting Graph Exporter\n\nThis plugin allows you to export VisualScripting Graphs as KHR_interactivity graphs in glTF files.\n\u003e [!NOTE]  \n\u003e Because the specification of KHR_interactivity is still in development, the plugin is disabled by default. To enable it, go to `Project Settings \u003e UnityGLTF \u003e Export` and enable the 'KHR_interactivity (VisualScripting)' plugin.\nPlease keep in mind that until ratification of the extension, exported glTF files with the KHR_interactivity extension might be outdated and not valid anymore with new specification updates.\n\n### Features\n\nA wide range of nodes are supported for export. Additionally, many features that Unity's Visual Scripting has, but that are lacking in the KHR_interactivity extension, are \"flattened\" on export into compatible graph logic. For example, scoped variables get exported as variables with unique names, so that there are no conflicts in the exported graph. This allows a lot of flexibility for building complex graphs in the Unity editor, while still being able to export to a glTF file. \n\n- SubGraph support\n  - SubGraphs will be flattened on export\n- Variables\n  - \"Saved\" variables are not supported\n- Custom Events\n- Coroutines\n- Multiple Visual Scripting Graphs in one glTF file\n  - Multiple graphs will be merged into a single KHR_interactivity graph\n- Partial List/Array support\n  - Capacity of lists can't be changed at runtime, so make sure you create a List with enough size in the Visual Scripting graph.\n- Math, Vector, Matrix operations\n- Partial Animator support\n  - Starting an animation is supported. Automatic graph transitions are currently not supported.\n- Logic operations\n- Material editing: Get/Set of floats, colors, texture offset/scale\n- Property interpolation: Use the \"Interpolate ...\" family of nodes\n\nA lot of Visual Scripting nodes are already supported. To see the full list of supported nodes, click on the button `Project Settings \u003e UnityGLTF \u003e Export \u003e KHR_interactivity (VisualScripting) \u003e Log supported Visual Scripting Units` to see the full list of supported nodes in the console.\n\n\u003e [!TIP]  \n\u003e When the interactivity extension is enabled, you can also see in the Visual Scripting Editor which nodes are supported by the extension. You can also see any warnings/errors from the last exporting there (sometimes the editor will not be immediately updates the view and need some time).  \n\u003e ![image](https://github.com/user-attachments/assets/df9d4e8e-fd8d-4c5a-a6a4-15812a5ea484)\n\u003e _Example: `On Pointer Click` is supported, while `On Pointer Up` is not supported for export._\n\n### Unsupported\n- String manipulation (not supported by the KHR_interactivity extension)\n- Some nodes have additional limitations. You can see these in the Script Graph:  \n  ![image](https://github.com/user-attachments/assets/011618d4-623e-4aa9-b343-bdbeb06df141)\n\n### Viewer support\nThese viewers support the current KHR_interactivity specification and have been extensively tested with the UnityGLTF exporter:  \n- Babylon: https://sandbox.babylonjs.com/  \n- Khronos Interactivity Graph Authoring Tool https://github.khronos.org/glTF-InteractivityGraph-AuthoringTool/  \n\n## glTF Materials\n\nThe glTF shading model is physically based and supports many different types of surfaces. To use this extended material model of glTF in Unity, use the `UnityGLTF/PBRGraph` material.  \nIt allows the use of various glTF material extensions for import, export, and inside Unity. The shader includes a number of features that URP is missing, such as transmission and rough refraction, sheen and clearcoat, and per-texture UV control. For unlit materials, use `UnityGLTF/UnlitGraph`.\n\n### Material Conversions\n\nUnityGLTF contains helpers to make converting to UnityGLTF/PBRGraph easy.  \nWhen you switch a material from any shader to PBRGraph, an automatic conversion can run to bring the properties over.  \nSome shaders already come with automatic conversions, please see the table below.\n\nWhen a shader doesn't have a converter yet, UnityGLTF will ask if you want to create a *Conversion Script*.  These scripts contain all properties of the source shader and the target shader, but no specified mapping yet (as that depends on the intent of the shader author).  \nAfter the conversion script has been created, you can edit it to correctly map from the source shader's properties to PBRGraph properties.   \nWhen you switch such a shader to PBRGraph the next time, your conversion script will run and automatically translate the materials in the specified way.\n\n\u003e **Note:** Currently, custom conversion scripts aren't used automatically on glTF export. For best results, convert materials in the Editor.\n\n### Material and Shader Export Compatibility\n\nIf you want to design for glTF export, it's recommended to use Unity 2021.3+ with URP and the **UnityGLTF/PBRGraph** material. It comes with support for modern material extensions like refraction and iridescence, and allows for perfect roundtrips. This material works great for building glTF pipelines in and out of Unity.\n\n| Render Pipeline                        | Used Shader                                                       | Notes                                  | Source             | \n|----------------------------------------|--------------------------------------------------------------|----------------------------------------|--------------------| \n| URP on 2020.3+\u003cbr/\u003eBuilt-In on 2021.3+ | **UnityGLTF/PBRGraph** \u003cbr/\u003e☝️ *Use this if you're not sure* | Perfect roundtrip, Material Extensions | UnityGLTF          |\n|                                        | UnityGLTF/UnlitGraph                                         | Perfect roundtrip                      | UnityGLTF          |\n|                                        | ShaderGraphs/glTF-pbrMetallicRoughness                       |                                        | glTFast            |\n|                                        | ShaderGraphs/glTF-unlit                                      |                                        | glTFast            |\n| URP                                    | URP/Lit                                                      |                                        | Unity              |\n|                                        | URP/Unlit                                                    |                                        | Unity              |\n| Built-In                               | Standard                                                     |                                        | Unity              | \n|                                        | GLTF/PbrMetallicRoughness                                    |                                        | UnityGLTF (legacy) |\n|                                        | GLTF/Unlit                                                   |                                        | UnityGLTF (legacy) |\n|                                        | glTF/PbrMetallicRoughness                                    |                                        | glTFast (legacy)   |\n|                                        | glTF/Unlit                                                   |                                        | glTFast (legacy)   |\n| HDRP (limited support)                 | HDRP/Lit                                                     |                                        | Unity              |\n|                                        | HDRP/Unlit                                                   |                                        | Unity              |\n\n### Configure for Refractive Materials (Transmission and Volume)\n\nTransmission and Volume allow rendering materials like glass, that are fully transparent but still show reflections, as well as volume attenuation (e.g. colored jelly) and rough refraction (e.g. brushed glass).\nTo use these material features, you need to do some setup on the material and your render pipeline. \n\n#### Material Setup\n1. On a PBRGraph material, check \"Enable Transmission\" and optionally \"Enable Volume\"\n2. Change the Transmission,  Thickness, Index of Refraction and Attenuation values as desired.\n\n#### URP\nTo see transmissive and volume materials correctly in Unity,\n1. Select your URP Renderer Asset\n2. Under the \"Renderer Features\" section, add a \"Opaque Texture (Rough Refraction)\" feature\n\n#### Built-In\nTo see transmissive and volume materials correctly in Unity,\n1. Add the \"RoughRefraction\" component to your Main Camera.\n\n#### HDRP\nHDRP has its own rough refraction support. There's currently no automatic import / export support to convert to that. Use glTFast if you need this.\n\n\u003e **Note**: Fully metallic materials are never transparent.  See [the KHR_materials_transmission spec](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/README.md#transparent-metals) for more info.\n\n## Exporting glTF Files\n\nTo export an object from a scene or your project,\n1. Select the object\n2. Use the menu items under `Assets \u003e UnityGLTF \u003e Export selected as GLB` / `Export selected as glTF` to export\n\n\u003e **Tip:** You can set shortcuts for quick export in Unity's Shortcut Manager. For example,\n\u003ckbd\u003eCtrl + Space\u003c/kbd\u003e for GLB export and \u003ckbd\u003eCtrl + Shift + Space\u003c/kbd\u003e for glTF export allow for very fast iteration.\n\n### Testing, debugging, compatibility\n\nThe various glTF viewers in existence have varying feature sets. Only a select few have full coverage of the glTF spec, most only support a subset.   \nNotable features with limited support:\n\n- setting `textureCoord` per texture.\n- setting `textureRotation`. Many viewers simply ignore it.\n- sparse accessors. Some viewers support sparse accessors only for blend shapes, others don't support it at all.\n- vertex colors.\n\nTo view your glTF files, here's a number of tools you can use:\n\n| Name                                                                                 | Notes                                                                                                                            |\n|--------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|\n| [Khronos glTF Sample Viewer](https://github.khronos.org/glTF-Sample-Viewer-Release/) | Full support for ratified extensions                                                                                             |\n| [gltf.report](https://gltf.report)                           | Inspect file size, meshes, textures                                                                                              | \n| [model-viewer](https://modelviewer.dev/editor)               | Support for KHR_materials_variants with custom code                                                                              |\n| [Gestaltor](https://gestaltor.com/)                                                  | Full glTF Spec Compliance\u003cbr/\u003eSupport for KHR_animation_pointer\u003cbr/\u003eSupport for KHR_audio\u003cbr/\u003eSupport for KHR_materials_variants | \n| [Needle Viewer](https://viewer.needle.tools)                 | Support for KHR_animation_pointer\u003cbr/\u003eInspect hierarchy, textures, cameras, lights, warnings                                     |\n| [Babylon.js Sandbox](https://sandbox.babylonjs.com/)                                 | Support for KHR_animation_pointer                                                                                                |\n| UnityGLTF\u003cbr/\u003e(this project!)                                                        | Simply drop the exported glb file back into Unity.                                                                               |\n| [glTFast](https://github.com/Unity-Technologies/com.unity.cloud.gltfast)             | Add the glTFast package to your project.\u003cbr/\u003eYou can switch the used importer on glTF files between glTFast and UnityGLTF.       |\n\nTo further process files after exporting them with UnityGLTF, you can use:\n\n| Name                                                     | Notes                                                                                                                     | \n|----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|\n| [gltf-transform](https://gltf-transform.donmccurdy.com/) | Compress meshes with draco or meshopt\u003cbr/\u003eCompress textures to ktx2\u003cbr/\u003eOptimize Files\u003cbr/\u003eConvert between .gltf and .glb |\n| [Blender](https://www.blender.org/)                                             | Import/export glTF files with good feature coverage                                                                       |\n\n## Animation Export\n\nAnimations can be exported both in the Editor and at runtime. \nEditor export works with Animator (multiple clips), Animation (multiple clips), and Timeline (GLTFRecorderTrack).\n\n### Animator Controller\n\nYou can export entire Animators and their clips as glTF files with multiple animations.  \nAnimation clips will be named after each Motion State in the Animator Controller.  \nThe \"speed\" property of each Motion will be baked into the exported clip. Ensure the speed is 1 when you want to export unchanged.    \nAny number of Animators in a hierarchy is supported, as is any number of clips in those.\n\nBoth Humanoid and Generic animations will be exported. Humanoid animations are baked onto the target rig at export time.\n\n\u003e **Note**: Animator export only works in the Editor. For runtime export, use the GLTFRecorder capabilities or the Timeline Recorder.\n\n### GLTFRecorder API\n\nFor creating and/or recording animations at runtime, you can use the GLTFRecorder API. It allows to capture the state of entire hierarchies and complex animations and export them directly as glTF file, \noptionally with KHR_animation_pointer support for complex material and property animations.  \nSee `GLTFRecorderComponent` for an example implementation.  \n\n### Timeline Recorder\n\nTimelines or sections of them can be recorded with a `GltfRecorderTrack` and one or more `GltfRecorderClips`. \nTimeline recording uses the GLTFRecorder API under the hood. \n\n### Legacy Animation Component\n\n\u003e **Note**: Animation Component export only works in the Editor since Unity does not provide the required runtime access. For runtime export, use the `GLTFRecorder` capabilities.\n\nAnimation components and their legacy clips can also be exported.\n\n### KHR_animation_pointer support\n\nUnityGLTF supports importing and exporting animations with the KHR_animation_pointer extension. \nThe core glTF spec only allows animation node transforms and blend shape weights, while this extension allows animating arbitrary properties in the glTF file – \nincluding material and object properties, even in custom extensions and script components.\n\nExporting with KHR_animation_pointer can be turned on in `Project Settings \u003e UnityGLTF` by enabling the KHR_animation_pointer plugin.\n\n\u003e **Note:** The exported files can be viewed with Gestaltor, Babylon Sandbox, and Needle Engine, but currently not with three.js / model-viewer. See https://github.com/mrdoob/three.js/pull/24108.\n\n## Blend Shape Export\n\nMorph Targets / Blend Shapes / Shape Keys are supported, including animations.  \nTo create smaller files for complex blend shape animations (e.g. faces with dozens of shapes), export with the \"Sparse Accessors\" setting enabled.\n\n## Importing glTF files\n\n### Runtime Import\n\n#### Load via Gltf Component\n\nTo import `.gltf` or `.glb` files at runtime, you can use the `GLTFComponent` for loading.\n\n![image](https://github.com/user-attachments/assets/40f184ae-3135-4b60-a1bd-d6273105e507)\n\n#### Load via code example:\n\nFrom local file:\n```csharp\nstring dir = \"C:\\SamplePath\\\";\nstring filename = \"AntiqueCamera.glb\";\n\nvar importOpt = new ImportOptions();\nimportOpt.DataLoader = new UnityWebRequestLoader(dir);\nvar import = new GLTFSceneImporter(filename, importOpt);\nawait import.LoadSceneAsync();\n```\n\nFrom Web:\n```csharp\nstring uriDir = \"https://github.com/KhronosGroup/glTF-Sample-Models/raw/refs/heads/main/2.0/AntiqueCamera/glTF-Binary/\";\nstring filename = \"AntiqueCamera.glb\";\n\nvar importOpt = new ImportOptions();\nimportOpt.DataLoader = new UnityWebRequestLoader(uriDir);\nvar import = new GLTFSceneImporter(filename, importOpt);\nawait import.LoadSceneAsync();\n```\n\nAccessing the loaded gltf scene:\n```csharp\nimport.LastLoadedScene\n```\nOn the loaded gltf scene you will find the `InstantiatedGLTFObject` component. Use the method `Duplicate` from it, to create a copy of the loaded scene.\n\n### Ensure shaders are available in your build\nPlease make sure you have added the `UnityGLTFShaderVariantCollection` (or `UnityGLTFShaderVariantCollection-BiRP` for BuildIn render pipeline) in the `Project Settings \u003e Graphics \u003e Preloaded Shaders`.\nOtherwise, it's possible that shaders are missing in build. Please be aware, that on the first build the compile time can take some time.\n\nWhen you building for mobile platforms and you have the requirement for smaller shader sizes, and you know which shaders features you realy need, it might be better to create your own Shader Variant Collection. \n\nYou can also strip additional shader variants under `Project Settings \u003e UnityGtlf \u003e Build` to reduce shader compile time.  \n\n### Editor Import\n\nFor importing `.gltf` or `.glb` files in the editor, place them in your project as usual (Assets or Packages). \nMake sure to bring .bin/textures along for `.gltf` files with the correct relative paths;`.glb` is usually self-contained.\n\nWhen moving `.gltf` files inside Unity, make sure to move their .bin/texture files as well, to not break the path references between them.\n\n### Default Importer Selection\n\nUnityGLTF will register itself as the default importer for the `.gltf` and .`glb` extensions.  \nIf the [glTFast package](https://github.com/atteneder/glTFast) is also present in a project, **glTFast gets precedence** and UnityGLTF is available as Importer Override, which can be selected from a dropdown on each glTF asset.\n\nUnityGLTF uses Unity's `ScriptedImporter` system. For any given file format (file extension) there has to be one default importer and there can be additional, alternative importers.  \nYou can make UnityGLTF the default importer and de-prioritize glTFast by adding the following settings to your project's `Scripting Defines`:\n\n```\nGLTFAST_FORCE_DEFAULT_IMPORTER_OFF\nUNITYGLTF_FORCE_DEFAULT_IMPORTER_ON\n```\n\nCare has been taken to align glTFast's and UnityGLTF's importers, so that in most cases you can switch between them without breaking prefab references. That being said, switching between importers can change material references, mesh references etc., so some manual adjustments may be needed.\nYou may have to adjust the root stripping settings of each importer (glTFast and UnityGLTF do that slightly differently).\n\n## Animation Import\n\nAnimations can be imported both in the Editor and at runtime.  \nOn the importer, you can choose between \"Legacy\", \"Mecanim\" or \"Humanoid\" clips.\n\nAt runtime, if you're importing \"Mecanim\" clips, you need to make sure to add them to a playable graph via script (e.g. Animator Controller or Timeline) to play them back.\n\n## Extensibility\n\nUnityGLTF has import and export plugins. These have callbacks for modifying node structures, extension data, materials and more as part of the regular export and import process. They are used both in the Editor and at runtime.\nYou can make your own plugins and enable them in the `Project Settings \u003e UnityGLTF` menu.  \nPlugins are ScriptableObjects that can have settings; they're serialized as part of the GLTFSettings asset. \nPlugins create concrete instances of import/export handlers.  \n\nTo create a plugin, follow these steps:\n1. Make a class that inherits from `GLTFImportPlugin` or `GLTFExportPlugin`. This is the ScriptableObject that contains plugin settings.\n2. Also, make a class that inherits from `GLTFImportPluginContext` or `GLTFExportPluginContext`. This class has the actual callbacks.\n3. Implement `CreateInstance` in your plugin to return a new instance of your plugin context.\n4. Override the callbacks you want to use in your plugin context.\n\nIf your plugin reads/writes custom extension data, you need to also implement `GLTF.Schema.IExtension` for serialization and deserialization.\n\n\u003e [!WARNING] \n\u003e `ShouldNodeExport` callback: Using this callback requires understanding of how glTF works. For example, if you filter out some bones of a skeleton on export, the result might not be valid glTF or might not display what you expect. Use with caution\n\n### Example for custom export plugin\n```csharp\npublic class MyExportPlugin : GLTFExportPlugin\n{\n    public override string DisplayName { get =\u003e \"My Custom Plugin\"; }\n    public override bool EnabledByDefault =\u003e true;\n    public override bool AlwaysEnabled =\u003e false;\n    \n    public override GLTFExportPluginContext CreateInstance(ExportContext context)\n    {\n        return new MyExportPluginContext();\n    }\n}\n\npublic class MyExportPluginContext: GLTFExportPluginContext\n{\n    public override bool ShouldNodeExport(GLTFSceneExporter exporter, GLTFRoot gltfRoot, Transform transform)\n    {\n        return !transform.CompareTag(\"ignore\");\n    }\n}\n```\n\n### Example for custom import plugin\n```csharp\npublic class MyImportPlugin: GLTFImportPlugin\n{\n    public override string DisplayName =\u003e \"My Import Plugin\";\n    public override string Description =\u003e \"\";\n    \n    public override GLTFImportPluginContext CreateInstance(GLTFImportContext context)\n    {\n        return new MyImportPluginContext();\n    }\n}\n\npublic class MyImportPluginContext: GLTFImportPluginContext\n{\n    public override void OnAfterImportScene(GLTFScene scene, int sceneIndex, GameObject sceneObject)\n    {\n        // Set all to static\n        var objs = sceneObject.GetComponentsInChildren\u003cTransform\u003e();\n        foreach (var obj in objs)\n            obj.gameObject.isStatic = true;\n    }\n}\n```\n\n\u003e 🏗️ Under construction. You can take a look at `MaterialVariantsPlugin.cs` for an example.\n\n## Known Issues\n\n- Blend shape in-betweens will not be exported as glTF does not have that functionality. \n- Support for glTF files with multiple scenes is limited. \n\n## Contributing\n\nUnityGLTF is an open-source project. Well-tested PRs are welcome.  \n\nUnityGLTF is currently maintained by\n- [prefrontal cortex](https://prefrontalcortex.de), member of the Khronos Group and \n- [Needle](https://needle.tools), member of the Metaverse Standards Forum.\n\n\u003e **Note**: As of 20240129, the default branch of this repository has been renamed from `master` to `main`.\n\n\u003cdetails\u003e\n\u003csummary\u003eMore Details (legacy)\u003c/summary\u003e\n\n\u003e 🏗️ Under construction. Feel free to raise an issue if you have questions.\n\n### [Unity Package](https://github.com/KhronosGroup/UnityGLTF/tree/master/)\n\n- **Unity Version**\n  Be sure that the Unity release you have installed on your local machine is *at least* 2021.3.\n- **Project Components**\n  The Unity project offers two main functionalities: importing and exporting GLTF assets. These functionalities are primarily implemented in `GLTFSceneImporter` and `GLTFSceneExporter`.\n\n### [GLTFSerializer](https://github.com/KhronosGroup/UnityGLTF/tree/master/Runtime/Plugins/GLTFSerialization)\n\n- **Basic Rundown**: The GLTFSerializer facilitates serialization of the Unity asset model, and deserialization of GLTF assets.\n\n- **Structure**:\n  - Each GLTF schemas (Buffer, Accessor, Camera, Image...) extends the basic class: GLTFChildOfRootProperty. Through this object model, each schema can have its own defined serialization/deserialization functionalities, which imitate the JSON file structure as per the GLTF specification.\n  - Each schema can then be grouped under the GLTFRoot object, which represents the underlying GLTF Asset. Serializing the asset is then done by serializing the root object, which recursively serializes all individual schemas. Deserializing a GLTF asset is done similarly: instantiate a GLTFRoot, and parse the required schemas.\n\n### Tests\n\n\u003e 🏗️ Under construction. Tests are currently in a separate (private) repository due to test asset licensing reasons.\n\nTo run tests with UnityGLTF as package, you'll have to add UnityGLTF to the \"testables\" array in manifest.json:\n\n```\n\"testables\": [\n\t\"org.khronos.unitygltf\"\n]\n```\n\n\u003c/details\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Funitygltf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhronosgroup%2Funitygltf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Funitygltf/lists"}