Skip to content

Commit

Permalink
Merge pull request #247 from atteneder/meshopt
Browse files Browse the repository at this point in the history
EXT_meshopt_compression support
  • Loading branch information
atteneder authored Oct 26, 2021
2 parents 986a9bd + b5f9af8 commit de7f452
Show file tree
Hide file tree
Showing 9 changed files with 316 additions and 103 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unrelease] -
### Added
- Experimental glTF Editor Export (under main menu `File > Export` and via API `GLTFast.Export.GameObjectExport`; #249)
- Support for meshopt compressed glTFs (EXT_meshopt_compression; #106)
- *Generate Lightmap UVs* option in the glTF import inspector lets you create a secondary texture coordinate set (similar to the Model Import Settings from other formats; #238)
- Generic `ICodeLogger` methods that don't require a `LogCode`
### Changed
Expand Down
10 changes: 6 additions & 4 deletions Documentation~/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ The glTF 2.0 specification is fully supported, with only a few minor remarks.
|glTF (.gltf) | ✅ | ✅
|glTF-Binary (.glb) | ✅ | ✅
| | |
| **Buffer type**
| **Buffer**
| External URIs | ✅ | ✅
| GLB main buffer | ✅ | ✅
| Embed buffers or textures (base-64 encoded within JSON) ||
| Embed buffers or textures (base-64 encoded within JSON) ||
| [meshoptimizer compression][MeshOpt] (via [package][MeshOptPkg])||
| | |
| **Basics**
| Scenes | ✅ | ✅
Expand Down Expand Up @@ -136,7 +137,7 @@ The glTF 2.0 specification is fully supported, with only a few minor remarks.
| | |
| **Vendor**
| <sup>1</sup>EXT_mesh_gpu_instancing ||
| EXT_meshopt_compression | [ℹ️][MeshOpt] |
| EXT_meshopt_compression | |
| EXT_lights_image_based | [ℹ️][IBL] |

<sup>1</sup>: Without support for custom vertex attributes (e.g. `_ID`)
Expand Down Expand Up @@ -262,7 +263,8 @@ Possibly incomplete list of things that are known to not work with Entities yet:
[HDRP]: https://unity.com/srp/High-Definition-Render-Pipeline
[IBL]: https://github.com/atteneder/glTFast/issues/108
[IOR]: https://github.com/atteneder/glTFast/issues/207
[MeshOpt]: https://github.com/atteneder/glTFast/issues/106
[MeshOpt]: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_meshopt_compression
[MeshOptPkg]: https://docs.unity3d.com/Packages/[email protected]/manual/index.html
[newIssue]: https://github.com/atteneder/glTFast/issues/new
[PointLights]: https://github.com/atteneder/glTFast/issues/17
[RuntimeExport]: https://github.com/atteneder/glTFast/issues/259
Expand Down
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ It runs a script that installs *glTFast* via a [scoped registry](https://docs.un

Afterwards *glTFast* and further, optional packages are listed in the *Package Manager* (under *My Registries*) and can be installed and updated from there.

### Optional dependencies
### Optional Packages

- [Draco 3D Data Compression Unity Package](https://github.com/atteneder/DracoUnity) (provides support for [KHR_draco_mesh_compression](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression))
- [KTX/Basis Texture Unity Package](https://github.com/atteneder/KtxUnity) (in Beta; provides support for [KHR_texture_basisu](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu))
There are some related package that improve *glTFast* by extending its feature set.

- [Draco 3D Data Compression Unity Package][DracoUnity] (provides support for [KHR_draco_mesh_compression][ExtDraco])
- [KTX/Basis Texture Unity Package][KtxUnity] (in Beta; provides support for [KHR_texture_basisu][ExtBasisU])
- [*meshoptimizer decompression for Unity*][Meshopt] (provides support for [EXT_meshopt_compression][ExtMeshopt])

<details><summary>Alternative: Install via GIT URL</summary>

Expand All @@ -63,9 +66,10 @@ Enter the following URL:

`https://github.com/atteneder/glTFast.git`

To add support for Draco mesh compression, repeat the last step and also add the DracoUnity packages using this URL:
To add more functionality, repeat the last step and also add related packages using these URLs:

`https://gitlab.com/atteneder/DracoUnity.git`
- `https://gitlab.com/atteneder/DracoUnity.git` for Draco mesh compression
- `https://github.com/atteneder/KtxUnity.git` for KTX texture compression

> Note: You have to have a GIT LFS client (large file support) installed on your system. Otherwise you will get an error that the native library file (dll on Windows) is corrupt!
Expand Down Expand Up @@ -149,13 +153,19 @@ limitations under the License.

*Khronos®* is a registered trademark and *glTF™* is a trademark of [The Khronos Group Inc][khronos].

[unity]: https://unity.com
[gltf]: https://www.khronos.org/gltf
[gltf-spec]: https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html
[gltfast-web-demo]: https://gltf.pixel.engineer
[khronos]: https://www.khronos.org
[embibe]: https://www.embibe.com
[DracoUnity]: https://github.com/atteneder/DracoUnity
[ExtBasisU]: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu
[ExtDraco]: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression
[ExtMeshopt]: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/EXT_meshopt_compression
[gltf-spec]: https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html
[gltf]: https://www.khronos.org/gltf
[gltfasset_component]: ./Documentation~/img/gltfasset_component.png "Inspector showing a GltfAsset component added to a GameObject"
[gltfast-web-demo]: https://gltf.pixel.engineer
[import-gif]: ./Documentation~/img/import.gif "Video showing glTF files being copied into the Assets folder and imported"
[khronos]: https://www.khronos.org
[KtxUnity]: https://github.com/atteneder/KtxUnity
[Meshopt]: https://docs.unity3d.com/Packages/[email protected]/manual/index.html
[unity]: https://unity.com
[upm_install]: ./Documentation~/img/upm_install.png "Unity Package Manager add menu"
[workflows]: ./Documentation~/glTFast.md#workflows
1 change: 1 addition & 0 deletions Runtime/Scripts/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static class Extensions {
public const string MaterialsTransmission = "KHR_materials_transmission";
public const string MaterialsUnlit = "KHR_materials_unlit";
public const string MeshGPUInstancing = "EXT_mesh_gpu_instancing";
public const string MeshoptCompression = "EXT_meshopt_compression";
public const string MeshQuantization = "KHR_mesh_quantization";
public const string TextureBasisUniversal = "KHR_texture_basisu";
public const string TextureTransform = "KHR_texture_transform";
Expand Down
Loading

0 comments on commit de7f452

Please sign in to comment.