├── .gitattributes ├── .github └── FUNDING.yml ├── .gitignore ├── CHANGELOG.md ├── CHANGELOG.md.meta ├── Documentation~ └── DracoUnity.md ├── Editor.meta ├── Editor ├── AsyncHelpers.cs ├── AsyncHelpers.cs.meta ├── DracoEditor.asmdef ├── DracoEditor.asmdef.meta ├── DracoEditorEncoder.cs ├── DracoEditorEncoder.cs.meta ├── DracoImporter.cs ├── DracoImporter.cs.meta ├── OnScriptsReloadHandler.cs └── OnScriptsReloadHandler.cs.meta ├── LICENSE.md ├── LICENSE.md.meta ├── README.md ├── README.md.meta ├── Runtime.meta ├── Runtime ├── Plugins.meta ├── Plugins │ ├── Android.meta │ ├── Android │ │ ├── libs.meta │ │ └── libs │ │ │ ├── arm64-v8a.meta │ │ │ ├── arm64-v8a │ │ │ ├── libdracodec_unity.so │ │ │ ├── libdracodec_unity.so.meta │ │ │ ├── libdracoenc_unity.so │ │ │ └── libdracoenc_unity.so.meta │ │ │ ├── armeabi-v7a.meta │ │ │ ├── armeabi-v7a │ │ │ ├── libdracodec_unity.so │ │ │ ├── libdracodec_unity.so.meta │ │ │ ├── libdracoenc_unity.so │ │ │ └── libdracoenc_unity.so.meta │ │ │ ├── x86.meta │ │ │ └── x86 │ │ │ ├── libdracodec_unity.so │ │ │ ├── libdracodec_unity.so.meta │ │ │ ├── libdracoenc_unity.so │ │ │ └── libdracoenc_unity.so.meta │ ├── WSA.meta │ ├── WSA │ │ ├── ARM.meta │ │ ├── ARM │ │ │ ├── dracodec_unity.dll │ │ │ ├── dracodec_unity.dll.meta │ │ │ ├── dracoenc_unity.dll │ │ │ └── dracoenc_unity.dll.meta │ │ ├── ARM64.meta │ │ ├── ARM64 │ │ │ ├── dracodec_unity.dll │ │ │ ├── dracodec_unity.dll.meta │ │ │ ├── dracoenc_unity.dll │ │ │ └── dracoenc_unity.dll.meta │ │ ├── x64.meta │ │ ├── x64 │ │ │ ├── dracodec_unity.dll │ │ │ ├── dracodec_unity.dll.meta │ │ │ ├── dracoenc_unity.dll │ │ │ └── dracoenc_unity.dll.meta │ │ ├── x86.meta │ │ └── x86 │ │ │ ├── dracodec_unity.dll │ │ │ ├── dracodec_unity.dll.meta │ │ │ ├── dracoenc_unity.dll │ │ │ └── dracoenc_unity.dll.meta │ ├── WebGL.meta │ ├── WebGL │ │ ├── libdracodec_unity.a │ │ ├── libdracodec_unity.a.meta │ │ ├── libdracoenc_unity.a │ │ └── libdracoenc_unity.a.meta │ ├── iOS.meta │ ├── iOS │ │ ├── libdracodec_unity.a │ │ ├── libdracodec_unity.a.meta │ │ ├── libdracoenc_unity.a │ │ └── libdracoenc_unity.a.meta │ ├── x86.meta │ ├── x86 │ │ ├── dracodec_unity.dll │ │ ├── dracodec_unity.dll.meta │ │ ├── dracoenc_unity.dll │ │ └── dracoenc_unity.dll.meta │ ├── x86_64.meta │ └── x86_64 │ │ ├── dracodec_unity.bundle.meta │ │ ├── dracodec_unity.bundle │ │ ├── Contents.meta │ │ └── Contents │ │ │ ├── Info.plist │ │ │ ├── Info.plist.meta │ │ │ ├── MacOS.meta │ │ │ └── MacOS │ │ │ ├── dracodec_unity │ │ │ └── dracodec_unity.meta │ │ ├── dracodec_unity.dll │ │ ├── dracodec_unity.dll.meta │ │ ├── dracoenc_unity.bundle.meta │ │ ├── dracoenc_unity.bundle │ │ ├── Contents.meta │ │ └── Contents │ │ │ ├── Info.plist │ │ │ ├── Info.plist.meta │ │ │ ├── MacOS.meta │ │ │ └── MacOS │ │ │ ├── dracoenc_unity │ │ │ └── dracoenc_unity.meta │ │ ├── dracoenc_unity.dll │ │ ├── dracoenc_unity.dll.meta │ │ ├── libdracodec_unity.so │ │ ├── libdracodec_unity.so.meta │ │ ├── libdracoenc_unity.so │ │ └── libdracoenc_unity.so.meta ├── Scripts.meta └── Scripts │ ├── Draco.asmdef │ ├── Draco.asmdef.meta │ ├── DracoDecodeInstance.cs │ ├── DracoDecodeInstance.cs.meta │ ├── DracoDecoder.cs │ ├── DracoDecoder.cs.meta │ ├── DracoMeshLoader.cs │ ├── DracoMeshLoader.cs.meta │ ├── DracoNative.cs │ ├── DracoNative.cs.meta │ ├── Encoder.meta │ └── Encoder │ ├── DracoEncoder.asmdef │ ├── DracoEncoder.asmdef.meta │ ├── DracoEncoder.cs │ └── DracoEncoder.cs.meta ├── THIRD PARTY NOTICES.md ├── THIRD PARTY NOTICES.md.meta ├── Tests.meta ├── Tests ├── Runtime.meta └── Runtime │ ├── DracoRuntimeTests.asmdef │ ├── DracoRuntimeTests.asmdef.meta │ ├── DracoRuntimeTests.cs │ ├── DracoRuntimeTests.cs.meta │ ├── UseDracoTestFileCaseAttribute.cs │ └── UseDracoTestFileCaseAttribute.cs.meta ├── package.json └── package.json.meta /.gitattributes: -------------------------------------------------------------------------------- 1 | # Denote all files that are truly binary and should not be modified. 2 | *.drc binary filter=lfs diff=lfs merge=lfs 3 | 4 | *.so binary filter=lfs diff=lfs merge=lfs 5 | *.a binary filter=lfs diff=lfs merge=lfs 6 | *.bundle binary filter=lfs diff=lfs merge=lfs 7 | dracodec_unity binary filter=lfs diff=lfs merge=lfs 8 | *.dll binary filter=lfs diff=lfs merge=lfs 9 | *.bc binary filter=lfs diff=lfs merge=lfs -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # [atteneder] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: tteneder 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | 4 | # Rider 5 | **/.idea 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [Unreleased] 8 | ### Added 9 | - Support for efficient self-managed encoding of multiple meshes. Users may use the advanced Mesh API to acquire readable mesh data for multiple meshes at once and pass the data on to new `DracoEncoder.EncodeMesh` overloads that accept said `MeshData`. 10 | - Vertex attributes information (draco identifier and dimensions) was added to `EncodeResult` 11 | ### Changed 12 | - Much faster encoding due to the use of the C# Job System (threads) 13 | - Faster encoding due to avoiding a full memory copy of the result 14 | - All encoding methods are async now 15 | - Updated Burst dependency to version 1.8.4 16 | - Readonly meshes now can be encoded in the Editor 17 | - Removed Editor-only `sync` parameter from `DracoMeshLoader.ConvertDracoMeshToUnity` to make API stable (regardless of environment/scripting defines) 18 | ### Fixed 19 | - Destroying temporary copy (instead of original) GameObject when encoding selected GameObject from the menu 20 | 21 | ## [4.1.0] - 2023-04-14 22 | ### Added 23 | - Support for encoding point clouds (thanks [@camnewnham][camnewnham] for #46) 24 | - Point cloud encoding unit test 25 | - Component pad byte support enables things like 3 byte RGB color vertex attributes (thanks [@camnewnham][camnewnham] for #47) 26 | - Encoding binaries for remaining platforms (Android, WSA, WebGL, iOS and Windows 32-bit) 27 | ### Changed 28 | - Updated Draco native library binaries to [1.1.0](https://github.com/atteneder/draco/releases/tag/unity1.1.0) 29 | ### Removed 30 | - 32-bit Linux binaries/support 31 | ### Fixed 32 | - Unit Tests download URLs updated 33 | - Editor imports now calculate the correct mesh bounds 34 | - macOS binaries are now loaded on Apple Silicon properly 35 | 36 | ## [4.0.2] - 2022-01-20 37 | ### Fixed 38 | - Theoretical crash on unsupported indices data type. Removes compiler warning about throwing exception in C# job. 39 | 40 | ## [4.0.1] - 2021-11-23 41 | ### Fixed 42 | - Apple Silicon Unity Editor decoding (#34) 43 | - Apple Silicon Runtime encoding 44 | 45 | ## [4.0.0] - 2021-10-27 46 | ### Changed 47 | - WebGL library is built with Emscripten 2.0.19 now 48 | - Minimum required version is Unity 2021.2 49 | 50 | ## [3.4.0] - 2023-04-14 51 | ### Added 52 | - Support for encoding point clouds (thanks [@camnewnham][camnewnham] for #46) 53 | - Point cloud encoding unit test 54 | - Component pad byte support enables things like 3 byte RGB color vertex attributes (thanks [@camnewnham][camnewnham] for #47) 55 | - Encoding binaries for remaining platforms (Android, WSA, WebGL, iOS and Windows 32-bit) 56 | ### Changed 57 | - Minimum required Unity version is 2020.3 LTS now 58 | - Updated Draco native library binaries to [1.1.0](https://github.com/atteneder/draco/releases/tag/unity1.1.0) 59 | ### Removed 60 | - 32-bit Linux binaries/support 61 | ### Fixed 62 | - Unit Tests download URLs updated 63 | - Editor imports now calculate the correct mesh bounds 64 | - macOS binaries are now loaded on Apple Silicon properly 65 | 66 | ## [3.3.2] - 2021-10-27 67 | ### Added 68 | - Error message when users try to run DracoUnity 3.x Unity >=2021.2 combination targeting WebGL 69 | 70 | ## [3.3.1] - 2021-09-14 71 | ### Changed 72 | - Data types SInt8, UInt8, SInt16 and UInt16 on normals, colors, texture coordinates and blend weights are treated as normalized values now 73 | ### Fixed 74 | - Correct vertex colors (#27) 75 | 76 | ## [3.3.0] - 2021-09-11 77 | ### Added 78 | - Point cloud support (thanks [@camnewnham][camnewnham] for #28) 79 | 80 | ## [3.2.0] - 2021-08-27 81 | ### Changed 82 | - Improved render performance by reducing vertex streams for small meshes (see related [issue](https://github.com/atteneder/glTFast/issues/197)) 83 | - Less memory usage and better performance by creating 16-bit unsigned integer indices for small meshes 84 | - Less memory usage by avoiding a temporary index buffer in native plug-in 85 | - Raised version of Burst dependency to 1.4.11 (current verified) 86 | 87 | ## [3.1.0] - 2020-07-12 88 | ### Added 89 | - `forceUnityLayout` parameter, to enforce a blend-shape and skinning compatible vertex buffer layout 90 | 91 | ## [3.0.3] - 2020-06-09 92 | ### Added 93 | - Support for Lumin / Magic Leap 94 | 95 | ## [3.0.2] - 2020-05-26 96 | ### Fixed 97 | - Resolved Burst compiler errors (unresolved symbols on macOS) by setting correct native library reference (fixes #18) 98 | 99 | ## [3.0.1] - 2021-05-21 100 | ### Fixed 101 | - AOT Burst compilation errors 102 | 103 | ## [3.0.0] - 2021-05-18 104 | ### Changed 105 | - `DracoMeshLoader`'s coordinate space conversion from right-hand (like in glTF) to left-hand (Unity) changed. Now this is performed by inverting the X-axis (before the Z-axis was inverted). Compared to the previous behaviour, meshes are rotated 180° along the up-axis (Y). This was done to better conform to the glTF specification. 106 | 107 | ## [2.0.1] - 2021-05-21 108 | ### Fixed 109 | - AOT Burst compilation errors 110 | 111 | ## [2.0.0] - 2021-05-17 112 | ### Added 113 | - Experimental encoding support (ability to convert Unity Meshes into compressed Draco) 114 | - Performance improvements 115 | - Two-step decoding allows to do more work of step two in threaded Jobs 116 | - Utilizes Advanced Mesh API 117 | - Uses `MeshDataArray` to shift more work to Jobs (Unity 2020.2 and newer) 118 | - Burst 119 | - Unit tests 120 | - Require Normals/Tangents parameter (necessity when using Advanced Mesh API). If true, even if the draco mesh does not have the required vertex attributes, buffers for them will get allocated and the values are calculated. 121 | - Parameter for coordinate space conversion (was on by default before) 122 | ### Changes 123 | - API is now async/await based 124 | - Updated native Draco libraries (based on version 1.4.1) 125 | 126 | ## [1.4.0] - 2021-01-31 127 | ### Added 128 | - Support for Apple Silicon on macOS 129 | - Support for Universal Windows Platform (x86,x64,ARM and ARM64) 130 | ### Changed 131 | - Re-built all libraries with updated environments (Xcode, Android NDK, Emscripten, etc.) 132 | - WebAssembly lib is now built by draco CI as well 133 | ### Fixed 134 | - macOS library is now excluded from other platform builds (thanks Cameron Newnham ) 135 | 136 | ## [1.3.0] - 2020-09-17 137 | ### Added 138 | - Support for bone weights and joints by providing attribute IDs. Needed for glTF skinning. 139 | 140 | ## [1.2.0] - 2020-02-24 141 | ### Changed 142 | - Performance improvement: CreateMesh does not calculate missing normals or tangents anymore. Instead it provides its caller with all info necessary to decide for itself, if calculations are needed. 143 | 144 | ## [1.1.3] - 2020-02-22 145 | ### Added 146 | - Support for Universal Windows Platform (not verified/tested myself) 147 | 148 | ## [1.1.2] - 2020-02-01 149 | ### Fixed 150 | - Removed in-Editor error by adding missing Profiler.EndSample call 151 | 152 | ## [1.1.1] - 2019-11-22 153 | ### Fixed 154 | - Calculate correct tangents if UVs are present (fixes normal mapping) 155 | 156 | ## [1.1.0] - 2019-11-21 157 | ### Changed 158 | - Assume Draco mesh to be right-handed Y-up coordinates and convert the to Unity's left-handed Y-up by flipping the Z-axis. 159 | - Unity 2018.2 backwards compatibility 160 | ### Fixed 161 | - Reference assembly definition by name instead of GUID to avoid package import errors 162 | 163 | ## [1.0.1] - 2019-09-15 164 | ### Changed 165 | - Updated Draco native library binaries 166 | - iOS library is now ~15 MB instead of over 130 MB 167 | 168 | ## [1.0.0] - 2019-07-28 169 | ### Changed 170 | - Recompiled dracodec_unity library with BUILD_FOR_GLTF flag set to true, which adds support for normal encoding and standard edge breaking. 171 | - Opened up interface a bit, which enables custom mesh loading by users. 172 | 173 | ## [0.9.0] - 2019-07-11 174 | - Initial release 175 | 176 | [camnewnham]: https://github.com/camnewnham 177 | -------------------------------------------------------------------------------- /CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2014518031d8460cae2c3bc47ecfbb8 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Documentation~/DracoUnity.md: -------------------------------------------------------------------------------- 1 | # Draco 3D Data Compression Unity Package 2 | 3 | Unity package that integrates the [Draco 3D data compression library](https://google.github.io/draco) within Unity. 4 | 5 | Following build targets are supported 6 | 7 | - WebGL 8 | - iOS (arm64 and armv7a) 9 | - Android (x86, arm64 and armv7a) 10 | - Windows (64 and 32 bit) 11 | - Universal Windows Platform (x64,x86,ARM,ARM64) 12 | - macOS (Apple Silicon an Intel) 13 | - Linux (64 bit) 14 | - Lumin / Magic Leap 15 | 16 | > Note: Burst support is broken on iOS builds at the moment. Please deactivate Burst AOT in the project settings until this is resolved. 17 | 18 | ## Using 19 | 20 | ### Mesh result 21 | 22 | Minimalistic way of loading a draco file ([source][DracoDemo]): 23 | 24 | ```csharp 25 | public class DracoDemo : MonoBehaviour { 26 | 27 | public string filePath; 28 | 29 | async void Start() { 30 | 31 | // Load file into memory 32 | var fullPath = Path.Combine(Application.streamingAssetsPath, filePath); 33 | var data = File.ReadAllBytes(fullPath); 34 | 35 | // Convert data to Unity mesh 36 | var draco = new DracoMeshLoader(); 37 | // Async decoding has to start on the main thread and spawns multiple C# jobs. 38 | var mesh = await draco.ConvertDracoMeshToUnity(data); 39 | 40 | if (mesh != null) { 41 | // Use the resulting mesh 42 | GetComponent().mesh= mesh; 43 | } 44 | } 45 | } 46 | ``` 47 | 48 | ### Using MeshDataArray 49 | 50 | Starting with Unity 2020.2 you can create Meshes efficiently via [`MeshDataArray`][MeshDataArray]. 51 | 52 | The important difference is that instead of returning a `Mesh` directly, it just configures the `MeshData` properly and fills its buffers. It's up to the user to: 53 | 54 | - Create the `Mesh` instance(s) 55 | - Apply the data via `Mesh.ApplyAndDisposeWritableMeshData` 56 | - In case the mesh had bone weight data, apply and dispose those as well (optional extra step) 57 | 58 | Here's an examply how to do this ([source][DracoDemoMeshData]): 59 | 60 | ```csharp 61 | public class DracoDemoMeshData : MonoBehaviour { 62 | 63 | public string filePath; 64 | 65 | public bool requireNormals; 66 | public bool requireTangents; 67 | 68 | async void Start() { 69 | 70 | // Load file into memory 71 | var fullPath = Path.Combine(Application.streamingAssetsPath, filePath); 72 | var data = File.ReadAllBytes(fullPath); 73 | 74 | // Convert data to Unity mesh 75 | var draco = new DracoMeshLoader(); 76 | 77 | // Allocate single mesh data (you can/should bulk allocate multiple at once, if you're loading multiple draco meshes) 78 | var meshDataArray = Mesh.AllocateWritableMeshData(1); 79 | 80 | // Async decoding has to start on the main thread and spawns multiple C# jobs. 81 | var result = await draco.ConvertDracoMeshToUnity( 82 | meshDataArray[0], 83 | data, 84 | requireNormals, // Set to true if you require normals. If Draco data does not contain them, they are allocated and we have to calculate them below 85 | requireTangents // Retrieve tangents is not supported, but this will ensure they are allocated and can be calculated later (see below) 86 | ); 87 | 88 | if (result.success) { 89 | 90 | // Apply onto new Mesh 91 | var mesh = new Mesh(); 92 | Mesh.ApplyAndDisposeWritableMeshData(meshDataArray,mesh); 93 | 94 | // If Draco mesh has bone weigths, apply them now. 95 | // To get these, you have to supply the correct attribute IDs 96 | // to `ConvertDracoMeshToUnity` above (optional paramters). 97 | if (result.boneWeightData != null) { 98 | result.boneWeightData.ApplyOnMesh(mesh); 99 | result.boneWeightData.Dispose(); 100 | } 101 | 102 | if (result.calculateNormals) { 103 | // If draco didn't contain normals, calculate them. 104 | mesh.RecalculateNormals(); 105 | } 106 | if (requireTangents) { 107 | // If required (e.g. for consistent specular shading), calculate tangents 108 | mesh.RecalculateTangents(); 109 | } 110 | 111 | // Use the resulting mesh 112 | GetComponent().mesh = mesh; 113 | } 114 | } 115 | } 116 | ``` 117 | 118 | ### Details and where to go next 119 | 120 | See the signatures of all [`DracoMeshLoader.ConvertDracoMeshToUnity`][DracoMeshLoader] variants to see all options available. 121 | 122 | The examples above and more can be found in the [DracoUnityDemo][DracoUnityDemo] project. 123 | 124 | ### Troubleshooting - Missing code signing 125 | 126 | The binary libraries used in this package are not code-signed. macOS in particular will not let you load the `ktx_unity.bundle` for that reason (see [issue](https://github.com/atteneder/DracoUnity/issues/4)). 127 | 128 | Here's the steps to make it work on macOS 129 | 130 | 1. When you first open a project with DracoUnity (or add the package), you get prompted to remove the "broken" ktx_unity.bundle. Don't do it and click "cancel" instead. 131 | 2. Open the macOS "System Preferencess" and go to "Security & Privacy". At the bottom of the "General" tab you should see a warning about ktx_unity.bundle. Click the "Allow anyways" button besides it. 132 | 3. Restart Unity 133 | 4. Now you get another, similar prompt (see step 1) with the third option "Open". Click it 134 | 5. Now it should work (at least for development on your machine) 135 | 136 | If you want to deploy your software using DracoUnity you either have to 137 | 138 | - Wait until there is proper code-sign setup (watch this project or subscribe to the [corresponding issue](https://github.com/atteneder/DracoUnity/issues/4)). 139 | - Build your own library from [the source draco repository](https://github.com/atteneder/draco) (note that it's not the original Google repository) and sign it with your own credentials/Apple profile. 140 | 141 | 142 | [DracoDemo]: https://github.com/atteneder/DracoUnityDemo/blob/main/Assets/Scripts/DracoDemo.cs 143 | [DracoDemoMeshData]: https://github.com/atteneder/DracoUnityDemo/blob/main/Assets/Scripts/DracoDemoMeshData.cs 144 | [DracoMeshLoader]: https://github.com/atteneder/DracoUnity/blob/main/Runtime/Scripts/DracoMeshLoader.cs 145 | [DracoUnityDemo]: https://github.com/atteneder/DracoUnityDemo 146 | 147 | [MeshDataArray]: https://docs.unity3d.com/2021.2/Documentation/ScriptReference/Mesh.MeshDataArray.html 148 | -------------------------------------------------------------------------------- /Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c7e3d517ca764f7d8b26fd8a601ac23 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/AsyncHelpers.cs: -------------------------------------------------------------------------------- 1 | // Source: https://social.msdn.microsoft.com/Forums/en-US/163ef755-ff7b-4ea5-b226-bbe8ef5f4796/is-there-a-pattern-for-calling-an-async-method-synchronously?forum=async 2 | 3 | using System; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using System.Collections.Generic; 7 | 8 | namespace Draco.Editor 9 | { 10 | 11 | static class AsyncHelpers 12 | { 13 | /// 14 | /// Executes an async Task<T> method which has a void return value synchronously 15 | /// 16 | /// Task<T> method to execute 17 | public static void RunSync(Func task) 18 | { 19 | var oldContext = SynchronizationContext.Current; 20 | var sync = new ExclusiveSynchronizationContext(); 21 | SynchronizationContext.SetSynchronizationContext(sync); 22 | // ReSharper disable once AsyncVoidLambda 23 | sync.Post(async _ => 24 | { 25 | try 26 | { 27 | await task(); 28 | } 29 | catch (Exception e) 30 | { 31 | sync.InnerException = e; 32 | throw; 33 | } 34 | finally 35 | { 36 | sync.EndMessageLoop(); 37 | } 38 | }, null); 39 | sync.BeginMessageLoop(); 40 | 41 | SynchronizationContext.SetSynchronizationContext(oldContext); 42 | } 43 | 44 | /// 45 | /// Executes an async Task<T> method which has a T return type synchronously 46 | /// 47 | /// Return Type 48 | /// Task<T> method to execute 49 | /// 50 | public static T RunSync(Func> task) 51 | { 52 | var oldContext = SynchronizationContext.Current; 53 | var sync = new ExclusiveSynchronizationContext(); 54 | SynchronizationContext.SetSynchronizationContext(sync); 55 | T ret = default(T); 56 | // ReSharper disable once AsyncVoidLambda 57 | sync.Post(async _ => 58 | { 59 | try 60 | { 61 | ret = await task(); 62 | } 63 | catch (Exception e) 64 | { 65 | sync.InnerException = e; 66 | throw; 67 | } 68 | finally 69 | { 70 | sync.EndMessageLoop(); 71 | } 72 | }, null); 73 | sync.BeginMessageLoop(); 74 | SynchronizationContext.SetSynchronizationContext(oldContext); 75 | return ret; 76 | } 77 | 78 | class ExclusiveSynchronizationContext : SynchronizationContext 79 | { 80 | bool m_Done; 81 | public Exception InnerException { get; set; } 82 | readonly AutoResetEvent m_WorkItemsWaiting = new AutoResetEvent(false); 83 | readonly Queue> m_Items = 84 | new Queue>(); 85 | 86 | public override void Send(SendOrPostCallback d, object state) 87 | { 88 | throw new NotSupportedException("We cannot send to our same thread"); 89 | } 90 | 91 | public override void Post(SendOrPostCallback d, object state) 92 | { 93 | lock (m_Items) 94 | { 95 | m_Items.Enqueue(Tuple.Create(d, state)); 96 | } 97 | m_WorkItemsWaiting.Set(); 98 | } 99 | 100 | public void EndMessageLoop() 101 | { 102 | Post(_ => m_Done = true, null); 103 | } 104 | 105 | public void BeginMessageLoop() 106 | { 107 | while (!m_Done) 108 | { 109 | Tuple task = null; 110 | lock (m_Items) 111 | { 112 | if (m_Items.Count > 0) 113 | { 114 | task = m_Items.Dequeue(); 115 | } 116 | } 117 | if (task != null) 118 | { 119 | task.Item1(task.Item2); 120 | if (InnerException != null) // the method threw an exception 121 | { 122 | throw new AggregateException("AsyncHelpers.Run method threw an exception.", InnerException); 123 | } 124 | } 125 | else 126 | { 127 | m_WorkItemsWaiting.WaitOne(); 128 | } 129 | } 130 | } 131 | 132 | public override SynchronizationContext CreateCopy() 133 | { 134 | return this; 135 | } 136 | } 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /Editor/AsyncHelpers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 561e62eca3e82415b89b229d2144f1a0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/DracoEditor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DracoEditor", 3 | "rootNamespace": "", 4 | "references": [ 5 | "Draco", 6 | "DracoEncoder" 7 | ], 8 | "includePlatforms": [ 9 | "Editor" 10 | ], 11 | "excludePlatforms": [], 12 | "allowUnsafeCode": false, 13 | "overrideReferences": false, 14 | "precompiledReferences": [], 15 | "autoReferenced": true, 16 | "defineConstraints": [], 17 | "versionDefines": [], 18 | "noEngineReferences": false 19 | } -------------------------------------------------------------------------------- /Editor/DracoEditor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7bd06454b4959483eb1ce4c29f2fcadf 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Editor/DracoEditorEncoder.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Draco Authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | using System.Collections.Generic; 17 | using System.IO; 18 | using System.Linq; 19 | using UnityEditor; 20 | using UnityEngine; 21 | using UnityEngine.SceneManagement; 22 | using Draco.Encoder; 23 | 24 | namespace Draco.Editor { 25 | 26 | static class DracoEditorEncoder 27 | { 28 | const string k_CompressedMeshesDirName = "CompressedMeshes"; 29 | 30 | struct DracoMesh { 31 | public MeshFilter target; 32 | public TextAsset[] dracoAssets; 33 | string[] m_SubmeshAssetPaths; 34 | 35 | public DracoMesh(MeshFilter target, string directory) { 36 | this.target = target; 37 | var mesh = target.sharedMesh; 38 | dracoAssets = new TextAsset[mesh.subMeshCount]; 39 | var submeshFilenames 40 | = new string[mesh.subMeshCount]; 41 | m_SubmeshAssetPaths = new string[mesh.subMeshCount]; 42 | 43 | var filename = string.IsNullOrEmpty(mesh.name) ? "Mesh-submesh-0.drc" : $"{mesh.name}-submesh-{{0}}.drc.bytes"; 44 | for (int submesh = 0; submesh < mesh.subMeshCount; submesh++) { 45 | submeshFilenames[submesh] = string.Format(filename, submesh); 46 | m_SubmeshAssetPaths[submesh] = Path.Combine(directory, submeshFilenames[submesh]); 47 | } 48 | } 49 | 50 | public int submeshCount => dracoAssets.Length; 51 | 52 | public bool TryLoadDracoAssets() { 53 | var mesh = target.sharedMesh; 54 | for (int submesh = 0; submesh < mesh.subMeshCount; submesh++) { 55 | if(dracoAssets[submesh]!=null) continue; 56 | dracoAssets[submesh] = AssetDatabase.LoadAssetAtPath(m_SubmeshAssetPaths[submesh]); 57 | if (dracoAssets[submesh] == null) { 58 | return false; 59 | } 60 | } 61 | return true; 62 | } 63 | 64 | public string GetSubmeshAssetPath(int submeshIndex) { 65 | var projectPath = Directory.GetParent(Application.dataPath); 66 | if (projectPath == null) 67 | return null; 68 | return Path.Combine(projectPath.FullName, m_SubmeshAssetPaths[submeshIndex]); 69 | } 70 | } 71 | 72 | [MenuItem("Tools/Draco/Encode Selected GameObject")] 73 | static void Compress() { 74 | 75 | var original = (GameObject)Selection.activeObject; 76 | if (original == null) { 77 | Debug.Log("No GameObject selected"); 78 | return; 79 | } 80 | 81 | var root = Object.Instantiate(original); 82 | var meshFilters = root.GetComponentsInChildren(); 83 | 84 | if (meshFilters.Length < 1) { 85 | Debug.Log("No GameObject with MeshFilter in selection"); 86 | Object.DestroyImmediate(root); 87 | return; 88 | } 89 | 90 | CompressMeshFilters(meshFilters); 91 | 92 | Object.DestroyImmediate(root); 93 | } 94 | 95 | [MenuItem("Tools/Draco/Encode Active Scene")] 96 | static void CompressSceneMenu() { 97 | CompressScene( SceneManager.GetActiveScene() ); 98 | } 99 | 100 | static void CompressScene( Scene scene ) { 101 | 102 | var scenePath = scene.path; 103 | var sceneDir = scenePath.Substring(0, scenePath.Length - 6); 104 | 105 | if (!Directory.Exists(sceneDir)) { 106 | Directory.CreateDirectory(sceneDir); 107 | } 108 | 109 | sceneDir = Path.Combine(sceneDir, k_CompressedMeshesDirName); 110 | if (!Directory.Exists(sceneDir)) { 111 | Directory.CreateDirectory(sceneDir); 112 | } 113 | 114 | var objects = scene.GetRootGameObjects(); 115 | 116 | var meshFilters = new List(); 117 | foreach (var gameObject in objects) { 118 | meshFilters.AddRange(gameObject.GetComponentsInChildren()); 119 | } 120 | CompressMeshFilters(meshFilters.ToArray(), sceneDir); 121 | } 122 | 123 | static void CompressMeshFilters(MeshFilter[] meshFilters, string directory = null) { 124 | 125 | var instances = new Dictionary(); 126 | 127 | var meshDecoder = Object.FindObjectOfType(); 128 | if (meshDecoder == null) { 129 | meshDecoder = new GameObject("MeshDecoder").AddComponent(); 130 | } 131 | 132 | directory = directory ?? $"Assets/{k_CompressedMeshesDirName}"; 133 | if (!Directory.Exists(directory)) { 134 | Directory.CreateDirectory(directory); 135 | } 136 | 137 | var dracoMeshes = new List(); 138 | var dracoFilesUpdated = false; 139 | 140 | foreach (var meshFilter in meshFilters) { 141 | var mesh = meshFilter.sharedMesh; 142 | if(mesh==null) continue; 143 | #if !UNITY_EDITOR 144 | if (!mesh.isReadable) { 145 | Debug.LogError("Mesh is not readable!"); 146 | return; 147 | } 148 | #endif 149 | var dracoMesh = new DracoMesh(meshFilter, directory); 150 | var dracoFilesMissing = !dracoMesh.TryLoadDracoAssets(); 151 | 152 | if (dracoFilesMissing) { 153 | var scale = meshFilter.transform.localToWorldMatrix.lossyScale; 154 | var dracoData = AsyncHelpers.RunSync(() => DracoEncoder.EncodeMesh(mesh,scale,.0001f)); 155 | if (dracoData!=null && dracoData.Length > 0) { 156 | for (var submesh = 0; submesh < dracoData.Length; submesh++) { 157 | if(submesh>0) Debug.LogWarning("more than one submesh. not supported yet."); 158 | File.WriteAllBytes(dracoMesh.GetSubmeshAssetPath(submesh),dracoData[submesh].data.ToArray()); 159 | dracoData[submesh].Dispose(); 160 | dracoFilesUpdated = true; 161 | AssetDatabase.SaveAssets(); 162 | AssetDatabase.Refresh(); 163 | } 164 | } else { 165 | Debug.LogError("Draco encoding failed"); 166 | return; 167 | } 168 | } 169 | 170 | dracoMeshes.Add(dracoMesh); 171 | } 172 | 173 | if (dracoFilesUpdated) { 174 | 175 | foreach (var dracoMesh in dracoMeshes) { 176 | if (!dracoMesh.TryLoadDracoAssets()) { 177 | Debug.LogError("Loading draco assets failed"); 178 | return; 179 | } 180 | } 181 | } 182 | 183 | foreach (var dracoMesh in dracoMeshes) { 184 | for (int submesh = 0; submesh < dracoMesh.submeshCount; submesh++) { 185 | // meshDecoder.AddTarget(dracoMesh.target,dracoMesh.dracoAssets[submesh]); 186 | var dracoAsset = dracoMesh.dracoAssets[submesh]; 187 | if (instances.TryGetValue(dracoAsset, out var instance)) { 188 | instance.AddTarget(dracoMesh.target); 189 | } 190 | else { 191 | var newInstance = ScriptableObject.CreateInstance(); 192 | var bounds = dracoMesh.target.sharedMesh.bounds; 193 | newInstance.SetAsset(dracoAsset,bounds); 194 | newInstance.AddTarget(dracoMesh.target); 195 | instances[dracoAsset] = newInstance; 196 | } 197 | } 198 | dracoMesh.target.mesh = null; 199 | } 200 | 201 | meshDecoder.instances = instances.Values.ToArray(); 202 | } 203 | 204 | [MenuItem("Tools/Draco/Encode Selected Mesh")] 205 | static void EncodeSelectedMeshes() { 206 | var meshes = Selection.GetFiltered(SelectionMode.Deep); 207 | if (meshes == null || meshes.Length <= 0) { 208 | Debug.Log("No mesh selected"); 209 | return; 210 | } 211 | 212 | var directory = EditorUtility.OpenFolderPanel("Save Draco files to folder", "", ""); 213 | if (string.IsNullOrEmpty(directory)) return; 214 | 215 | foreach (var mesh in meshes) { 216 | EncodeMesh(mesh, directory); 217 | } 218 | AssetDatabase.SaveAssets(); 219 | AssetDatabase.Refresh(); 220 | } 221 | 222 | static void EncodeMesh(Mesh mesh, string directory) { 223 | Debug.Log($"Encode mesh {mesh.name} to {directory}"); 224 | #if !UNITY_EDITOR 225 | if (!mesh.isReadable) { 226 | Debug.LogError($"Mesh {mesh.name} is not readable!"); 227 | return; 228 | } 229 | #endif 230 | var dracoData = AsyncHelpers.RunSync(() => DracoEncoder.EncodeMesh(mesh)); 231 | if (dracoData.Length > 1) { 232 | var filename = string.IsNullOrEmpty(mesh.name) ? "Mesh-submesh-{0}.drc.bytes" : $"{mesh.name}-submesh-{{0}}.drc.bytes"; 233 | for (var submesh = 0; submesh < dracoData.Length; submesh++) { 234 | File.WriteAllBytes(Path.Combine(directory,string.Format(filename,submesh)),dracoData[submesh].data.ToArray()); 235 | dracoData[submesh].Dispose(); 236 | } 237 | } 238 | else { 239 | var filename = string.IsNullOrEmpty(mesh.name) ? "Mesh.drc.bytes" : $"{mesh.name}.drc.bytes"; 240 | File.WriteAllBytes(Path.Combine(directory, filename), dracoData[0].data.ToArray()); 241 | dracoData[0].Dispose(); 242 | } 243 | } 244 | } 245 | } -------------------------------------------------------------------------------- /Editor/DracoEditorEncoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b25cdd72a1ce046f38a4fc454f08b8fd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/DracoImporter.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Draco Authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | using System.IO; 17 | using UnityEngine; 18 | #if UNITY_2020_2_OR_NEWER 19 | using UnityEditor.AssetImporters; 20 | #else 21 | using UnityEditor.Experimental.AssetImporters; 22 | #endif 23 | 24 | namespace Draco.Editor { 25 | 26 | [ScriptedImporter(1, "drc")] 27 | class DracoImporter : ScriptedImporter { 28 | 29 | public override async void OnImportAsset(AssetImportContext ctx) { 30 | #if NET_UNITY_4_8 // Unity 2021 or newer 31 | var dracoData = await File.ReadAllBytesAsync(ctx.assetPath); 32 | #else 33 | var dracoData = File.ReadAllBytes(ctx.assetPath); 34 | #endif 35 | var draco = new DracoMeshLoader(); 36 | var mesh = await draco.ConvertDracoMeshToUnitySync(dracoData); 37 | if (mesh == null) { 38 | Debug.LogError("Import draco file failed"); 39 | return; 40 | } 41 | mesh.RecalculateBounds(); 42 | ctx.AddObjectToAsset("mesh", mesh); 43 | ctx.SetMainObject(mesh); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Editor/DracoImporter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb5808861e2a6445d9190c98e89202c8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/OnScriptsReloadHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021 Andreas Atteneder 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | using UnityEngine; 17 | 18 | namespace Draco.Editor { 19 | 20 | static class OnScriptsReloadHandler { 21 | 22 | [UnityEditor.Callbacks.DidReloadScripts] 23 | static void OnScriptsReloaded() { 24 | #if UNITY_WEBGL && !UNITY_2021_2_OR_NEWER 25 | Debug.LogError("Downgrade DracoUnity to version 3.x!\nWebGL builds will not succeed with DracoUnity 4.0.0 or newer and Unity versions older than 2021.2."); 26 | #endif 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Editor/OnScriptsReloadHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f627cb536fa1d4d1aa99892182b0c18d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2019-2020 Andreas Atteneder 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2972a3c6b67b14e88a3d77bc8beab0cf 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Draco 3D Data Compression Unity Package 2 | 3 | [![openupm](https://img.shields.io/npm/v/com.atteneder.draco?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.atteneder.draco/) 4 | [![GitHub issues](https://img.shields.io/github/issues/atteneder/DracoUnity)](https://github.com/atteneder/DracoUnity/issues) 5 | [![GitHub license](https://img.shields.io/github/license/atteneder/DracoUnity)](https://github.com/atteneder/DracoUnity/blob/main/LICENSE.md) 6 | 7 | Unity package that integrates the [Draco 3D data compression library](https://google.github.io/draco) within Unity. 8 | 9 | ![Screenshot of loaded bunny meshes](https://github.com/atteneder/DracoUnityDemo/raw/main/Images/bunnies.png "Lots of Stanford bunny meshes loaded via Draco 3D Data Compression Unity Package") 10 | 11 | Following build targets are supported 12 | 13 | - WebGL 14 | - iOS (arm64 and armv7a) 15 | - Android (x86, arm64 and armv7a) 16 | - Windows (64 and 32 bit) 17 | - Universal Windows Platform (x64,x86,ARM,ARM64) 18 | - macOS (Apple Silicon an Intel) 19 | - Linux (64 bit) 20 | - Lumin / Magic Leap 21 | 22 | > Note: Burst support is broken on iOS builds at the moment. Please deactivate Burst AOT in the project settings until this is resolved. 23 | 24 | ## Installing 25 | 26 | The easiest way to install is to download and open the [Installer Package](https://package-installer.glitch.me/v1/installer/OpenUPM/com.atteneder.draco?registry=https%3A%2F%2Fpackage.openupm.com&scope=com.atteneder) 27 | 28 | It runs a script that installs the Draco 3D Data Compression Unity Package via a [scoped registry](https://docs.unity3d.com/Manual/upm-scoped.html). After that it is listed in the *Package Manager* and can be updated from there. 29 | 30 |
Alternative: Install via GIT URL 31 | 32 | You have to manually add the package's URL into your [project manifest](https://docs.unity3d.com/Manual/upm-manifestPrj.html) 33 | 34 | Inside your Unity project there's the folder `Packages` containing a file called `manifest.json`. You have to open it and add the following line inside the `dependencies` category: 35 | 36 | ```json 37 | "com.atteneder.draco": "https://github.com/atteneder/DracoUnity.git", 38 | ``` 39 | 40 | It should look something like this: 41 | 42 | ```json 43 | { 44 | "dependencies": { 45 | "com.atteneder.draco": "https://github.com/atteneder/DracoUnity.git", 46 | "com.unity.package-manager-ui": "2.1.2", 47 | "com.unity.modules.unitywebrequest": "1.0.0" 48 | ... 49 | } 50 | } 51 | ``` 52 | 53 | Next time you open your project in Unity, it will download the package automatically. 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. There's more detail about how to add packages via GIT URLs in the [Unity documentation](https://docs.unity3d.com/Manual/upm-git.html). 54 | 55 |
56 | 57 | ## Using 58 | 59 | ### Mesh result 60 | 61 | Minimalistic way of loading a draco file ([source][DracoDemo]): 62 | 63 | ```csharp 64 | public class DracoDemo : MonoBehaviour { 65 | 66 | public string filePath; 67 | 68 | async void Start() { 69 | 70 | // Load file into memory 71 | var fullPath = Path.Combine(Application.streamingAssetsPath, filePath); 72 | var data = File.ReadAllBytes(fullPath); 73 | 74 | // Convert data to Unity mesh 75 | var draco = new DracoMeshLoader(); 76 | // Async decoding has to start on the main thread and spawns multiple C# jobs. 77 | var mesh = await draco.ConvertDracoMeshToUnity(data); 78 | 79 | if (mesh != null) { 80 | // Use the resulting mesh 81 | GetComponent().mesh= mesh; 82 | } 83 | } 84 | } 85 | ``` 86 | 87 | ### Using MeshDataArray 88 | 89 | Starting with Unity 2020.2 you can create Meshes efficiently via [`MeshDataArray`][MeshDataArray]. 90 | 91 | The important difference is that instead of returning a `Mesh` directly, it just configures the `MeshData` properly and fills its buffers. It's up to the user to: 92 | 93 | - Create the `Mesh` instance(s) 94 | - Apply the data via `Mesh.ApplyAndDisposeWritableMeshData` 95 | - In case the mesh had bone weight data, apply and dispose those as well (optional extra step) 96 | 97 | Here's an examply how to do this ([source][DracoDemoMeshData]): 98 | 99 | ```csharp 100 | public class DracoDemoMeshData : MonoBehaviour { 101 | 102 | public string filePath; 103 | 104 | public bool requireNormals; 105 | public bool requireTangents; 106 | 107 | async void Start() { 108 | 109 | // Load file into memory 110 | var fullPath = Path.Combine(Application.streamingAssetsPath, filePath); 111 | var data = File.ReadAllBytes(fullPath); 112 | 113 | // Convert data to Unity mesh 114 | var draco = new DracoMeshLoader(); 115 | 116 | // Allocate single mesh data (you can/should bulk allocate multiple at once, if you're loading multiple draco meshes) 117 | var meshDataArray = Mesh.AllocateWritableMeshData(1); 118 | 119 | // Async decoding has to start on the main thread and spawns multiple C# jobs. 120 | var result = await draco.ConvertDracoMeshToUnity( 121 | meshDataArray[0], 122 | data, 123 | requireNormals, // Set to true if you require normals. If Draco data does not contain them, they are allocated and we have to calculate them below 124 | requireTangents // Retrieve tangents is not supported, but this will ensure they are allocated and can be calculated later (see below) 125 | ); 126 | 127 | if (result.success) { 128 | 129 | // Apply onto new Mesh 130 | var mesh = new Mesh(); 131 | Mesh.ApplyAndDisposeWritableMeshData(meshDataArray,mesh); 132 | 133 | // If Draco mesh has bone weigths, apply them now. 134 | // To get these, you have to supply the correct attribute IDs 135 | // to `ConvertDracoMeshToUnity` above (optional paramters). 136 | if (result.boneWeightData != null) { 137 | result.boneWeightData.ApplyOnMesh(mesh); 138 | result.boneWeightData.Dispose(); 139 | } 140 | 141 | if (result.calculateNormals) { 142 | // If draco didn't contain normals, calculate them. 143 | mesh.RecalculateNormals(); 144 | } 145 | if (requireTangents) { 146 | // If required (e.g. for consistent specular shading), calculate tangents 147 | mesh.RecalculateTangents(); 148 | } 149 | 150 | // Use the resulting mesh 151 | GetComponent().mesh = mesh; 152 | } 153 | } 154 | } 155 | ``` 156 | 157 | ### Details and where to go next 158 | 159 | See the signatures of all [`DracoMeshLoader.ConvertDracoMeshToUnity`][DracoMeshLoader] variants to see all options available. 160 | 161 | The examples above and more can be found in the [DracoUnityDemo][DracoUnityDemo] project. 162 | 163 | ### Troubleshooting - Missing code signing 164 | 165 | The binary libraries used in this package are not code-signed. macOS in particular will not let you load the `ktx_unity.bundle` for that reason (see [issue](https://github.com/atteneder/DracoUnity/issues/4)). 166 | 167 | Here's the steps to make it work on macOS 168 | 169 | 1. When you first open a project with DracoUnity (or add the package), you get prompted to remove the "broken" ktx_unity.bundle. Don't do it and click "cancel" instead. 170 | 2. Open the macOS "System Preferencess" and go to "Security & Privacy". At the bottom of the "General" tab you should see a warning about ktx_unity.bundle. Click the "Allow anyways" button besides it. 171 | 3. Restart Unity 172 | 4. Now you get another, similar prompt (see step 1) with the third option "Open". Click it 173 | 5. Now it should work (at least for development on your machine) 174 | 175 | If you want to deploy your software using DracoUnity you either have to 176 | 177 | - Wait until there is proper code-sign setup (watch this project or subscribe to the [corresponding issue](https://github.com/atteneder/DracoUnity/issues/4)). 178 | - Build your own library from [the source draco repository](https://github.com/atteneder/draco) (note that it's not the original Google repository) and sign it with your own credentials/Apple profile. 179 | 180 | ## Origin 181 | 182 | This project is a fork of the [existing Unity integration](https://github.com/google/draco/tree/master/unity) 183 | 184 | ### Differences 185 | 186 | - Encoding support 187 | - Can be integrated into Projects easily via Package Manager 188 | - Is magnitudes faster due to 189 | - Bulk memory copies instead of per vertex/index data copy 190 | - Multi-threaded via C# Job system 191 | - Burst compiler 192 | - Using Unity's Advanced Mesh API 193 | - Supports coordinate space conversion (from right-handed Y-up to Unity's left-handed Y-up by flipping the Z-axis; optional; required in glTF context) 194 | - Supports single meshes with more than 65536 vertices (old split algorithm was broken) 195 | - Supports loading joint index and joint weights for skinning 196 | - Corrects tangents by re-calculating them if necessary 197 | - Point cloud support 198 | - Additional native libs and support for platforms 199 | - WebGL 200 | - iOS armv7(s) and arm64 201 | - Windows 32-bit 202 | - Linux 64-bit 203 | - Android x86 204 | - Universal Windows Platform (x64,x86,ARM,ARM64) 205 | - macOS Apple Silicon 206 | 207 | ## Support 208 | 209 | Like this demo? You can show your appreciation and ... 210 | 211 | [![Buy me a coffee](https://az743702.vo.msecnd.net/cdn/kofi1.png?v=0)](https://ko-fi.com/C0C3BW7G) 212 | 213 | ## Develop 214 | 215 | To develop this package, check out the repository and add it as local repository in the Unity Package Manager. 216 | 217 | ### Build Draco library 218 | 219 | The native libraries are built via CI in this [GitHub action](https://github.com/atteneder/draco/actions?query=workflow%3A%22Draco+Decoder+Unity+library+CI%22) 220 | 221 | Look into the YAML file to see how the project is built with CMake. 222 | 223 | ## License 224 | 225 | Copyright (c) 2019 Andreas Atteneder, All Rights Reserved. 226 | Licensed under the Apache License, Version 2.0 (the "License"); 227 | you may not use files in this repository except in compliance with the License. 228 | You may obtain a copy of the License at 229 | 230 | 231 | 232 | Unless required by applicable law or agreed to in writing, software 233 | distributed under the License is distributed on an "AS IS" BASIS, 234 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 235 | See the License for the specific language governing permissions and 236 | limitations under the License. 237 | 238 | ## Third party notice 239 | 240 | Builds upon and includes builds of [Google](https://about.google)'s [Draco 3D data compression library](https://google.github.io/draco) (released under the terms of Apache License 2.0). 241 | 242 | [DracoDemo]: https://github.com/atteneder/DracoUnityDemo/blob/main/Assets/Scripts/DracoDemo.cs 243 | [DracoDemoMeshData]: https://github.com/atteneder/DracoUnityDemo/blob/main/Assets/Scripts/DracoDemoMeshData.cs 244 | [DracoMeshLoader]: https://github.com/atteneder/DracoUnity/blob/main/Runtime/Scripts/DracoMeshLoader.cs 245 | [DracoUnityDemo]: https://github.com/atteneder/DracoUnityDemo 246 | 247 | [MeshDataArray]: https://docs.unity3d.com/2021.2/Documentation/ScriptReference/Mesh.MeshDataArray.html 248 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e22f3a225cc1a40a0a4c4d97160b03b6 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1937890f41444455aa18b1f91a294af 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 315b0c33fa9ea48f4bf45d3f6a2646c0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9482ecd3558f543db87380b530529cd5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb9d8d080d9bf45cc8f0c828a6b784f3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/arm64-v8a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6772cef8c04714245b974643fe71b53a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/arm64-v8a/libdracodec_unity.so: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a9b2fcf5a33c9768b6ae348fb219cd9a788acd1f39451ef8f2ad05aecb983e58 3 | size 13422976 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/arm64-v8a/libdracodec_unity.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e534f7b734aeb43e6b909d3be16dcaf9 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux: 1 22 | Exclude Linux64: 1 23 | Exclude LinuxUniversal: 1 24 | Exclude Lumin: 0 25 | Exclude OSXUniversal: 1 26 | Exclude WebGL: 1 27 | Exclude Win: 1 28 | Exclude Win64: 1 29 | Exclude iOS: 1 30 | - first: 31 | Android: Android 32 | second: 33 | enabled: 1 34 | settings: 35 | CPU: ARM64 36 | - first: 37 | Any: 38 | second: 39 | enabled: 0 40 | settings: {} 41 | - first: 42 | Editor: Editor 43 | second: 44 | enabled: 0 45 | settings: 46 | CPU: AnyCPU 47 | DefaultValueInitialized: true 48 | OS: AnyOS 49 | - first: 50 | Facebook: Win 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: AnyCPU 55 | - first: 56 | Facebook: Win64 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: AnyCPU 61 | - first: 62 | Lumin: Lumin 63 | second: 64 | enabled: 1 65 | settings: {} 66 | - first: 67 | Standalone: Linux 68 | second: 69 | enabled: 0 70 | settings: 71 | CPU: x86 72 | - first: 73 | Standalone: Linux64 74 | second: 75 | enabled: 0 76 | settings: 77 | CPU: AnyCPU 78 | - first: 79 | Standalone: LinuxUniversal 80 | second: 81 | enabled: 0 82 | settings: 83 | CPU: None 84 | - first: 85 | Standalone: OSXUniversal 86 | second: 87 | enabled: 0 88 | settings: 89 | CPU: AnyCPU 90 | - first: 91 | Standalone: Win 92 | second: 93 | enabled: 0 94 | settings: 95 | CPU: AnyCPU 96 | - first: 97 | Standalone: Win64 98 | second: 99 | enabled: 0 100 | settings: 101 | CPU: AnyCPU 102 | - first: 103 | iPhone: iOS 104 | second: 105 | enabled: 0 106 | settings: 107 | AddToEmbeddedBinaries: false 108 | CPU: AnyCPU 109 | CompileFlags: 110 | FrameworkDependencies: 111 | userData: 112 | assetBundleName: 113 | assetBundleVariant: 114 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/arm64-v8a/libdracoenc_unity.so: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:97f40a46d41a6b9243d44689fb4fb7f8a9317d7f540326ce460552ec050a8754 3 | size 15673552 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/arm64-v8a/libdracoenc_unity.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 471fa07ef12874a00960c4bb63520c1a 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | userData: 26 | assetBundleName: 27 | assetBundleVariant: 28 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/armeabi-v7a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93fdaf9f78ec04a7ca72ea9d30b9976a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/armeabi-v7a/libdracodec_unity.so: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:472a7fcb59c1ed92c8fd674131ea7079e21f0fb2dc6dd701aaef281ea42f31a6 3 | size 12003432 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/armeabi-v7a/libdracodec_unity.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a4dd6638fa7544e8ab78e07c0ea9768 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux: 1 22 | Exclude Linux64: 1 23 | Exclude LinuxUniversal: 1 24 | Exclude OSXUniversal: 1 25 | Exclude WebGL: 1 26 | Exclude Win: 1 27 | Exclude Win64: 1 28 | Exclude iOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 1 33 | settings: 34 | CPU: ARMv7 35 | - first: 36 | Any: 37 | second: 38 | enabled: 0 39 | settings: {} 40 | - first: 41 | Editor: Editor 42 | second: 43 | enabled: 0 44 | settings: 45 | CPU: AnyCPU 46 | DefaultValueInitialized: true 47 | OS: AnyOS 48 | - first: 49 | Facebook: Win 50 | second: 51 | enabled: 0 52 | settings: 53 | CPU: AnyCPU 54 | - first: 55 | Facebook: Win64 56 | second: 57 | enabled: 0 58 | settings: 59 | CPU: AnyCPU 60 | - first: 61 | Standalone: Linux 62 | second: 63 | enabled: 0 64 | settings: 65 | CPU: x86 66 | - first: 67 | Standalone: Linux64 68 | second: 69 | enabled: 0 70 | settings: 71 | CPU: AnyCPU 72 | - first: 73 | Standalone: LinuxUniversal 74 | second: 75 | enabled: 0 76 | settings: 77 | CPU: None 78 | - first: 79 | Standalone: OSXUniversal 80 | second: 81 | enabled: 0 82 | settings: 83 | CPU: AnyCPU 84 | - first: 85 | Standalone: Win 86 | second: 87 | enabled: 0 88 | settings: 89 | CPU: AnyCPU 90 | - first: 91 | Standalone: Win64 92 | second: 93 | enabled: 0 94 | settings: 95 | CPU: AnyCPU 96 | - first: 97 | iPhone: iOS 98 | second: 99 | enabled: 0 100 | settings: 101 | AddToEmbeddedBinaries: false 102 | CPU: AnyCPU 103 | CompileFlags: 104 | FrameworkDependencies: 105 | userData: 106 | assetBundleName: 107 | assetBundleVariant: 108 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/armeabi-v7a/libdracoenc_unity.so: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cad856d0cd5d690bd8a779c6618db4e19435185a3bb6c9972f21d6d0885a492e 3 | size 14186652 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/armeabi-v7a/libdracoenc_unity.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52824ba6c334148e6af6b79e0588f565 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 1 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 0 74 | settings: 75 | AddToEmbeddedBinaries: false 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbfb63b8c63264f0eb804ebff538d703 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/x86/libdracodec_unity.so: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fd49170a7ddb7fce9aad919e5d9748404f7a73853ecad49d71a405ae05a320ab 3 | size 13213984 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/x86/libdracodec_unity.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4dbcf225a12fe4435a096b861fbd9ca3 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 1 31 | settings: 32 | CPU: x86 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Facebook: Win 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: AnyCPU 52 | - first: 53 | Facebook: Win64 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: AnyCPU 58 | - first: 59 | Standalone: Linux64 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: AnyCPU 64 | - first: 65 | Standalone: OSXUniversal 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: AnyCPU 70 | - first: 71 | Standalone: Win 72 | second: 73 | enabled: 0 74 | settings: 75 | CPU: AnyCPU 76 | - first: 77 | Standalone: Win64 78 | second: 79 | enabled: 0 80 | settings: 81 | CPU: AnyCPU 82 | - first: 83 | iPhone: iOS 84 | second: 85 | enabled: 0 86 | settings: 87 | AddToEmbeddedBinaries: false 88 | CPU: AnyCPU 89 | CompileFlags: 90 | FrameworkDependencies: 91 | userData: 92 | assetBundleName: 93 | assetBundleVariant: 94 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/x86/libdracoenc_unity.so: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:afcd91003da2d8869973fbb64fea728d282283b0f624ce135d98424a9eb6e04b 3 | size 15473444 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/Android/libs/x86/libdracoenc_unity.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 136e48adffd2a4f19ad518fbcf6aae5d 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 1 31 | settings: 32 | CPU: X86 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 0 74 | settings: 75 | AddToEmbeddedBinaries: false 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a779211837dd134ea6aeaaad0ab3fc3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/ARM.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 247f211ed244a5246bd95eb03ef807bd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/ARM/dracodec_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a7b4814eee893c8b56555673ab68570ac18845d376e3b0757b19a3b22d50c65e 3 | size 185856 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/ARM/dracodec_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25cda0e4b8c73b248a6cc47d8d9a5340 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude WindowsStoreApps: 0 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | Windows Store Apps: WindowsStoreApps 72 | second: 73 | enabled: 1 74 | settings: 75 | CPU: ARM 76 | DontProcess: false 77 | PlaceholderPath: 78 | SDK: UWP 79 | ScriptingBackend: AnyScriptingBackend 80 | userData: 81 | assetBundleName: 82 | assetBundleVariant: 83 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/ARM/dracoenc_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:38ab5dd5493827596bf0c73051ac86934a43d08ecc9f0e37b832bf5dadecbff5 3 | size 212480 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/ARM/dracoenc_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43011c1e24186473d89d73ee088dcd08 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude WindowsStoreApps: 0 27 | Exclude iOS: 1 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 0 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 0 43 | settings: 44 | CPU: AnyCPU 45 | DefaultValueInitialized: true 46 | OS: AnyOS 47 | - first: 48 | Standalone: Linux64 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: None 53 | - first: 54 | Standalone: OSXUniversal 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: None 59 | - first: 60 | Standalone: Win 61 | second: 62 | enabled: 0 63 | settings: 64 | CPU: None 65 | - first: 66 | Standalone: Win64 67 | second: 68 | enabled: 0 69 | settings: 70 | CPU: None 71 | - first: 72 | Windows Store Apps: WindowsStoreApps 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: ARM 77 | DontProcess: false 78 | PlaceholderPath: 79 | SDK: UWP 80 | ScriptingBackend: AnyScriptingBackend 81 | - first: 82 | iPhone: iOS 83 | second: 84 | enabled: 0 85 | settings: 86 | AddToEmbeddedBinaries: false 87 | CPU: AnyCPU 88 | CompileFlags: 89 | FrameworkDependencies: 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/ARM64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fd9b1242506f2242b7f0aea747d003a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/ARM64/dracodec_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:57368b03d77e34318ffa717772538404fcc0f780ba790322ab7f512685007980 3 | size 230912 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/ARM64/dracodec_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da68c67391c543b46a4f57aa2829f479 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude WindowsStoreApps: 0 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | Windows Store Apps: WindowsStoreApps 72 | second: 73 | enabled: 1 74 | settings: 75 | CPU: ARM64 76 | DontProcess: false 77 | PlaceholderPath: 78 | SDK: UWP 79 | ScriptingBackend: AnyScriptingBackend 80 | userData: 81 | assetBundleName: 82 | assetBundleVariant: 83 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/ARM64/dracoenc_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b712b10da4967c8c0e0149d7048af1b915708f92946edc4326ed81fa21bd9367 3 | size 263168 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/ARM64/dracoenc_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1911c0e373cd45e6b47f048eba5078c 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude WindowsStoreApps: 0 27 | Exclude iOS: 1 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 0 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 0 43 | settings: 44 | CPU: AnyCPU 45 | DefaultValueInitialized: true 46 | OS: AnyOS 47 | - first: 48 | Standalone: Linux64 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: None 53 | - first: 54 | Standalone: OSXUniversal 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: None 59 | - first: 60 | Standalone: Win 61 | second: 62 | enabled: 0 63 | settings: 64 | CPU: None 65 | - first: 66 | Standalone: Win64 67 | second: 68 | enabled: 0 69 | settings: 70 | CPU: None 71 | - first: 72 | Windows Store Apps: WindowsStoreApps 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: ARM64 77 | DontProcess: false 78 | PlaceholderPath: 79 | SDK: UWP 80 | ScriptingBackend: AnyScriptingBackend 81 | - first: 82 | iPhone: iOS 83 | second: 84 | enabled: 0 85 | settings: 86 | AddToEmbeddedBinaries: false 87 | CPU: AnyCPU 88 | CompileFlags: 89 | FrameworkDependencies: 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/x64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: adb1df6c7d8b745eeb059f01399eaec2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/x64/dracodec_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e0dfae6d7756439dd76b1eecfa8c656b2b75e8add397dbd00074b18ea6661300 3 | size 224256 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/x64/dracodec_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa9edc03c58e1498f9df11817c09261d 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude WindowsStoreApps: 0 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | Windows Store Apps: WindowsStoreApps 72 | second: 73 | enabled: 1 74 | settings: 75 | CPU: X64 76 | DontProcess: false 77 | PlaceholderPath: 78 | SDK: UWP 79 | ScriptingBackend: AnyScriptingBackend 80 | userData: 81 | assetBundleName: 82 | assetBundleVariant: 83 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/x64/dracoenc_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4f966d0d6272accd8c506492791b92753cc9836c89a35da1c7c6e2683fb6aacf 3 | size 255488 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/x64/dracoenc_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d001ae4b853845f496673eee08e8016 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude WindowsStoreApps: 0 27 | Exclude iOS: 1 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 0 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 0 43 | settings: 44 | CPU: AnyCPU 45 | DefaultValueInitialized: true 46 | OS: AnyOS 47 | - first: 48 | Standalone: Linux64 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: None 53 | - first: 54 | Standalone: OSXUniversal 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: None 59 | - first: 60 | Standalone: Win 61 | second: 62 | enabled: 0 63 | settings: 64 | CPU: None 65 | - first: 66 | Standalone: Win64 67 | second: 68 | enabled: 0 69 | settings: 70 | CPU: None 71 | - first: 72 | Windows Store Apps: WindowsStoreApps 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: X64 77 | DontProcess: false 78 | PlaceholderPath: 79 | SDK: UWP 80 | ScriptingBackend: AnyScriptingBackend 81 | - first: 82 | iPhone: iOS 83 | second: 84 | enabled: 0 85 | settings: 86 | AddToEmbeddedBinaries: false 87 | CPU: AnyCPU 88 | CompileFlags: 89 | FrameworkDependencies: 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55a5c1975a4d44616a048ba97f60ea08 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/x86/dracodec_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:66fe8ee44415dc31cacd1b622e9790702297e126eaeaa4e7305808812d5660e0 3 | size 165888 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/x86/dracodec_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22e980b26ccee44528d4c7fe7c6d781c 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude WindowsStoreApps: 0 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | Windows Store Apps: WindowsStoreApps 72 | second: 73 | enabled: 1 74 | settings: 75 | CPU: X86 76 | DontProcess: false 77 | PlaceholderPath: 78 | SDK: UWP 79 | ScriptingBackend: AnyScriptingBackend 80 | userData: 81 | assetBundleName: 82 | assetBundleVariant: 83 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/x86/dracoenc_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:11df1832442f21bf619600aed23838f4c18f0a8ae617107ce09961a0fbf00232 3 | size 183296 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/WSA/x86/dracoenc_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eab5340cdd1384f159621254c17109a3 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude WindowsStoreApps: 0 27 | Exclude iOS: 1 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 0 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 0 43 | settings: 44 | CPU: AnyCPU 45 | DefaultValueInitialized: true 46 | OS: AnyOS 47 | - first: 48 | Standalone: Linux64 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: None 53 | - first: 54 | Standalone: OSXUniversal 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: None 59 | - first: 60 | Standalone: Win 61 | second: 62 | enabled: 0 63 | settings: 64 | CPU: None 65 | - first: 66 | Standalone: Win64 67 | second: 68 | enabled: 0 69 | settings: 70 | CPU: None 71 | - first: 72 | Windows Store Apps: WindowsStoreApps 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: X86 77 | DontProcess: false 78 | PlaceholderPath: 79 | SDK: UWP 80 | ScriptingBackend: AnyScriptingBackend 81 | - first: 82 | iPhone: iOS 83 | second: 84 | enabled: 0 85 | settings: 86 | AddToEmbeddedBinaries: false 87 | CPU: AnyCPU 88 | CompileFlags: 89 | FrameworkDependencies: 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Runtime/Plugins/WebGL.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fc5981250f844ef7bbceb17434e0fe9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/WebGL/libdracodec_unity.a: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:537d0487accd3fcea5928e2e9353926279ada92e0852ff186aa158f574b9cff8 3 | size 6991548 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/WebGL/libdracodec_unity.a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea50adeb57746488cba50995cd1d57a9 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux: 1 22 | Exclude Linux64: 1 23 | Exclude LinuxUniversal: 1 24 | Exclude OSXUniversal: 1 25 | Exclude WebGL: 0 26 | Exclude Win: 1 27 | Exclude Win64: 1 28 | Exclude iOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 0 33 | settings: 34 | CPU: ARMv7 35 | - first: 36 | Any: 37 | second: 38 | enabled: 0 39 | settings: {} 40 | - first: 41 | Editor: Editor 42 | second: 43 | enabled: 0 44 | settings: 45 | CPU: AnyCPU 46 | DefaultValueInitialized: true 47 | OS: AnyOS 48 | - first: 49 | Facebook: WebGL 50 | second: 51 | enabled: 1 52 | settings: {} 53 | - first: 54 | Facebook: Win 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: AnyCPU 59 | - first: 60 | Facebook: Win64 61 | second: 62 | enabled: 0 63 | settings: 64 | CPU: AnyCPU 65 | - first: 66 | Standalone: Linux 67 | second: 68 | enabled: 0 69 | settings: 70 | CPU: x86 71 | - first: 72 | Standalone: Linux64 73 | second: 74 | enabled: 0 75 | settings: 76 | CPU: AnyCPU 77 | - first: 78 | Standalone: OSXUniversal 79 | second: 80 | enabled: 0 81 | settings: 82 | CPU: AnyCPU 83 | - first: 84 | Standalone: Win 85 | second: 86 | enabled: 0 87 | settings: 88 | CPU: AnyCPU 89 | - first: 90 | Standalone: Win64 91 | second: 92 | enabled: 0 93 | settings: 94 | CPU: AnyCPU 95 | - first: 96 | WebGL: WebGL 97 | second: 98 | enabled: 1 99 | settings: {} 100 | - first: 101 | iPhone: iOS 102 | second: 103 | enabled: 0 104 | settings: 105 | AddToEmbeddedBinaries: false 106 | CompileFlags: 107 | FrameworkDependencies: 108 | userData: 109 | assetBundleName: 110 | assetBundleVariant: 111 | -------------------------------------------------------------------------------- /Runtime/Plugins/WebGL/libdracoenc_unity.a: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:22c43318a7046b0f6b725e5d9ba231d282c3872cd3579e1f2ca6fe9b65e5bb7d 3 | size 127368 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/WebGL/libdracoenc_unity.a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da5bfbe6df76849f49c95d6e6d42c330 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 0 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | WebGL: WebGL 72 | second: 73 | enabled: 1 74 | settings: {} 75 | - first: 76 | iPhone: iOS 77 | second: 78 | enabled: 0 79 | settings: 80 | AddToEmbeddedBinaries: false 81 | CPU: AnyCPU 82 | CompileFlags: 83 | FrameworkDependencies: 84 | userData: 85 | assetBundleName: 86 | assetBundleVariant: 87 | -------------------------------------------------------------------------------- /Runtime/Plugins/iOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b74bb2469c77483cbba290e57c97596 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/iOS/libdracodec_unity.a: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:84509787cf8736657863efb7b8f86f90b5e36d5604777ccb6180b0fbdd8fb326 3 | size 10980240 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/iOS/libdracodec_unity.a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52fff6e01c18645b4a6b799d77362f0e 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux: 1 22 | Exclude Linux64: 1 23 | Exclude LinuxUniversal: 1 24 | Exclude OSXUniversal: 1 25 | Exclude WebGL: 1 26 | Exclude Win: 1 27 | Exclude Win64: 1 28 | Exclude iOS: 0 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 0 33 | settings: 34 | CPU: ARMv7 35 | - first: 36 | Any: 37 | second: 38 | enabled: 0 39 | settings: {} 40 | - first: 41 | Editor: Editor 42 | second: 43 | enabled: 0 44 | settings: 45 | CPU: AnyCPU 46 | DefaultValueInitialized: true 47 | OS: AnyOS 48 | - first: 49 | Facebook: Win 50 | second: 51 | enabled: 0 52 | settings: 53 | CPU: AnyCPU 54 | - first: 55 | Facebook: Win64 56 | second: 57 | enabled: 0 58 | settings: 59 | CPU: AnyCPU 60 | - first: 61 | Standalone: Linux 62 | second: 63 | enabled: 0 64 | settings: 65 | CPU: x86 66 | - first: 67 | Standalone: Linux64 68 | second: 69 | enabled: 0 70 | settings: 71 | CPU: AnyCPU 72 | - first: 73 | Standalone: LinuxUniversal 74 | second: 75 | enabled: 0 76 | settings: 77 | CPU: None 78 | - first: 79 | Standalone: OSXUniversal 80 | second: 81 | enabled: 0 82 | settings: 83 | CPU: AnyCPU 84 | - first: 85 | Standalone: Win 86 | second: 87 | enabled: 0 88 | settings: 89 | CPU: AnyCPU 90 | - first: 91 | Standalone: Win64 92 | second: 93 | enabled: 0 94 | settings: 95 | CPU: AnyCPU 96 | - first: 97 | iPhone: iOS 98 | second: 99 | enabled: 1 100 | settings: 101 | AddToEmbeddedBinaries: false 102 | CompileFlags: 103 | FrameworkDependencies: 104 | userData: 105 | assetBundleName: 106 | assetBundleVariant: 107 | -------------------------------------------------------------------------------- /Runtime/Plugins/iOS/libdracoenc_unity.a: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1fa4df1df68dc3c071b7d9b992373b9e60b92de8c9c183d6c60f2b18d287edd7 3 | size 209672 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/iOS/libdracoenc_unity.a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e0a9ea1c7461478b8178fb35416c6ff 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 1 20 | Exclude Linux64: 1 21 | Exclude OSXUniversal: 1 22 | Exclude WebGL: 1 23 | Exclude Win: 1 24 | Exclude Win64: 1 25 | - first: 26 | Any: 27 | second: 28 | enabled: 0 29 | settings: {} 30 | - first: 31 | Editor: Editor 32 | second: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | DefaultValueInitialized: true 37 | OS: AnyOS 38 | - first: 39 | Standalone: Linux64 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: None 44 | - first: 45 | Standalone: OSXUniversal 46 | second: 47 | enabled: 0 48 | settings: 49 | CPU: None 50 | - first: 51 | Standalone: Win 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: None 56 | - first: 57 | Standalone: Win64 58 | second: 59 | enabled: 0 60 | settings: 61 | CPU: None 62 | userData: 63 | assetBundleName: 64 | assetBundleVariant: 65 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b407d44f6ed049e086b5910c6868b8c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86/dracodec_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:994d6b0e884c060251fbacfc12a9261090de08beb41d82270ebb0d23e7a09f7d 3 | size 162304 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86/dracodec_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e77e60c27765c413ebdda4ed0c10d6aa 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 0 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 0 25 | Exclude WebGL: 1 26 | Exclude Win: 0 27 | Exclude Win64: 0 28 | Exclude WindowsStoreApps: 1 29 | Exclude iOS: 1 30 | - first: 31 | Android: Android 32 | second: 33 | enabled: 0 34 | settings: 35 | CPU: ARMv7 36 | - first: 37 | Any: 38 | second: 39 | enabled: 0 40 | settings: {} 41 | - first: 42 | Editor: Editor 43 | second: 44 | enabled: 1 45 | settings: 46 | CPU: x86 47 | DefaultValueInitialized: true 48 | OS: Windows 49 | - first: 50 | Facebook: Win 51 | second: 52 | enabled: 1 53 | settings: 54 | CPU: AnyCPU 55 | - first: 56 | Facebook: Win64 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: None 61 | - first: 62 | Standalone: Linux 63 | second: 64 | enabled: 1 65 | settings: 66 | CPU: x86 67 | - first: 68 | Standalone: Linux64 69 | second: 70 | enabled: 1 71 | settings: 72 | CPU: None 73 | - first: 74 | Standalone: LinuxUniversal 75 | second: 76 | enabled: 1 77 | settings: 78 | CPU: x86 79 | - first: 80 | Standalone: OSXUniversal 81 | second: 82 | enabled: 1 83 | settings: 84 | CPU: x86 85 | - first: 86 | Standalone: Win 87 | second: 88 | enabled: 1 89 | settings: 90 | CPU: AnyCPU 91 | - first: 92 | Standalone: Win64 93 | second: 94 | enabled: 1 95 | settings: 96 | CPU: None 97 | - first: 98 | Windows Store Apps: WindowsStoreApps 99 | second: 100 | enabled: 0 101 | settings: 102 | CPU: X86 103 | DontProcess: false 104 | PlaceholderPath: 105 | SDK: AnySDK 106 | ScriptingBackend: AnyScriptingBackend 107 | - first: 108 | iPhone: iOS 109 | second: 110 | enabled: 0 111 | settings: 112 | AddToEmbeddedBinaries: false 113 | CompileFlags: 114 | FrameworkDependencies: 115 | userData: 116 | assetBundleName: 117 | assetBundleVariant: 118 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86/dracoenc_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:63708daf58dc3e7bbc025bc4eef0054d1b02ef1b13584c00ff385e1785d3891b 3 | size 180736 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86/dracoenc_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7df58bdcd6de34419a4cfe3a6677f751 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 0 20 | Exclude Linux64: 0 21 | Exclude OSXUniversal: 0 22 | Exclude WebGL: 1 23 | Exclude Win: 0 24 | Exclude Win64: 0 25 | - first: 26 | Any: 27 | second: 28 | enabled: 0 29 | settings: {} 30 | - first: 31 | Editor: Editor 32 | second: 33 | enabled: 1 34 | settings: 35 | CPU: x86 36 | DefaultValueInitialized: true 37 | OS: Windows 38 | - first: 39 | Standalone: Linux64 40 | second: 41 | enabled: 1 42 | settings: 43 | CPU: None 44 | - first: 45 | Standalone: OSXUniversal 46 | second: 47 | enabled: 1 48 | settings: 49 | CPU: x86 50 | - first: 51 | Standalone: Win 52 | second: 53 | enabled: 1 54 | settings: 55 | CPU: AnyCPU 56 | - first: 57 | Standalone: Win64 58 | second: 59 | enabled: 1 60 | settings: 61 | CPU: None 62 | - first: 63 | WebGL: WebGL 64 | second: 65 | enabled: 0 66 | settings: {} 67 | userData: 68 | assetBundleName: 69 | assetBundleVariant: 70 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6e4b6a9348154257ab3e5da29277683 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracodec_unity.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 677e568d5bab943969f53a60026a4a16 3 | folderAsset: yes 4 | PluginImporter: 5 | externalObjects: {} 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | defineConstraints: [] 10 | isPreloaded: 1 11 | isOverridable: 1 12 | isExplicitlyReferenced: 0 13 | validateReferences: 1 14 | platformData: 15 | - first: 16 | : Any 17 | second: 18 | enabled: 0 19 | settings: 20 | Exclude Editor: 0 21 | Exclude Linux64: 0 22 | Exclude OSXUniversal: 0 23 | Exclude WebGL: 1 24 | Exclude Win: 0 25 | Exclude Win64: 0 26 | Exclude WindowsStoreApps: 1 27 | - first: 28 | : OSXIntel 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: None 33 | - first: 34 | : OSXIntel64 35 | second: 36 | enabled: 1 37 | settings: 38 | CPU: AnyCPU 39 | - first: 40 | Any: 41 | second: 42 | enabled: 0 43 | settings: {} 44 | - first: 45 | Editor: Editor 46 | second: 47 | enabled: 1 48 | settings: 49 | CPU: AnyCPU 50 | DefaultValueInitialized: true 51 | OS: OSX 52 | - first: 53 | Facebook: Win 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Facebook: Win64 60 | second: 61 | enabled: 1 62 | settings: 63 | CPU: AnyCPU 64 | - first: 65 | Standalone: Linux 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | Standalone: Linux64 72 | second: 73 | enabled: 1 74 | settings: 75 | CPU: AnyCPU 76 | - first: 77 | Standalone: LinuxUniversal 78 | second: 79 | enabled: 1 80 | settings: 81 | CPU: x86_64 82 | - first: 83 | Standalone: OSXUniversal 84 | second: 85 | enabled: 1 86 | settings: 87 | CPU: AnyCPU 88 | - first: 89 | Standalone: Win 90 | second: 91 | enabled: 1 92 | settings: 93 | CPU: None 94 | - first: 95 | Standalone: Win64 96 | second: 97 | enabled: 1 98 | settings: 99 | CPU: AnyCPU 100 | - first: 101 | Windows Store Apps: WindowsStoreApps 102 | second: 103 | enabled: 0 104 | settings: 105 | CPU: X86 106 | DontProcess: false 107 | PlaceholderPath: 108 | SDK: AnySDK 109 | ScriptingBackend: AnyScriptingBackend 110 | userData: 111 | assetBundleName: 112 | assetBundleVariant: 113 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracodec_unity.bundle/Contents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2606582ae40a48fcbf8a08b75e63fe0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracodec_unity.bundle/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | dracodec_unity 9 | CFBundleGetInfoString 10 | 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | 19 | CFBundleName 20 | 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 29 | CSResourcesFileMapped 30 | 31 | NSHumanReadableCopyright 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracodec_unity.bundle/Contents/Info.plist.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f394c5c56c1b346afb3de5fb9378628d 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracodec_unity.bundle/Contents/MacOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8537156b9f0e34aa4a4eeea0d371f261 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracodec_unity.bundle/Contents/MacOS/dracodec_unity: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bf40f0f6d67b0743178e1b9a36320ff7b926e84637e7e5186b41a56dabb2d01e 3 | size 975784 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracodec_unity.bundle/Contents/MacOS/dracodec_unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac1a9a448e5114accb679c482eab1816 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracodec_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3715a5401f7f13da9fd99070e63788a9d4d07b8572062a92927f1cf5a85909d1 3 | size 230912 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracodec_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8dedd6b165b1144698e14b20ab339bcd 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 0 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 0 25 | Exclude WebGL: 1 26 | Exclude Win: 0 27 | Exclude Win64: 0 28 | Exclude WindowsStoreApps: 1 29 | Exclude iOS: 1 30 | - first: 31 | Android: Android 32 | second: 33 | enabled: 0 34 | settings: 35 | CPU: ARMv7 36 | - first: 37 | Any: 38 | second: 39 | enabled: 0 40 | settings: {} 41 | - first: 42 | Editor: Editor 43 | second: 44 | enabled: 1 45 | settings: 46 | CPU: x86_64 47 | DefaultValueInitialized: true 48 | OS: Windows 49 | - first: 50 | Facebook: Win 51 | second: 52 | enabled: 0 53 | settings: 54 | CPU: None 55 | - first: 56 | Facebook: Win64 57 | second: 58 | enabled: 1 59 | settings: 60 | CPU: AnyCPU 61 | - first: 62 | Standalone: Linux 63 | second: 64 | enabled: 1 65 | settings: 66 | CPU: None 67 | - first: 68 | Standalone: Linux64 69 | second: 70 | enabled: 1 71 | settings: 72 | CPU: AnyCPU 73 | - first: 74 | Standalone: LinuxUniversal 75 | second: 76 | enabled: 1 77 | settings: 78 | CPU: x86_64 79 | - first: 80 | Standalone: OSXUniversal 81 | second: 82 | enabled: 1 83 | settings: 84 | CPU: x86_64 85 | - first: 86 | Standalone: Win 87 | second: 88 | enabled: 1 89 | settings: 90 | CPU: None 91 | - first: 92 | Standalone: Win64 93 | second: 94 | enabled: 1 95 | settings: 96 | CPU: AnyCPU 97 | - first: 98 | Windows Store Apps: WindowsStoreApps 99 | second: 100 | enabled: 0 101 | settings: 102 | CPU: X64 103 | DontProcess: false 104 | PlaceholderPath: 105 | SDK: AnySDK 106 | ScriptingBackend: AnyScriptingBackend 107 | - first: 108 | iPhone: iOS 109 | second: 110 | enabled: 0 111 | settings: 112 | AddToEmbeddedBinaries: false 113 | CompileFlags: 114 | FrameworkDependencies: 115 | userData: 116 | assetBundleName: 117 | assetBundleVariant: 118 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracoenc_unity.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7b018b0b3f254742b429cd9e53a5c01 3 | folderAsset: yes 4 | PluginImporter: 5 | externalObjects: {} 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | defineConstraints: [] 10 | isPreloaded: 1 11 | isOverridable: 1 12 | isExplicitlyReferenced: 0 13 | validateReferences: 1 14 | platformData: 15 | - first: 16 | : Any 17 | second: 18 | enabled: 0 19 | settings: 20 | Exclude Editor: 0 21 | Exclude Linux64: 0 22 | Exclude OSXUniversal: 0 23 | Exclude WebGL: 1 24 | Exclude Win: 0 25 | Exclude Win64: 0 26 | - first: 27 | Any: 28 | second: 29 | enabled: 0 30 | settings: {} 31 | - first: 32 | Editor: Editor 33 | second: 34 | enabled: 1 35 | settings: 36 | CPU: AnyCPU 37 | DefaultValueInitialized: true 38 | OS: OSX 39 | - first: 40 | Standalone: Linux64 41 | second: 42 | enabled: 1 43 | settings: 44 | CPU: AnyCPU 45 | - first: 46 | Standalone: OSXUniversal 47 | second: 48 | enabled: 1 49 | settings: 50 | CPU: AnyCPU 51 | - first: 52 | Standalone: Win 53 | second: 54 | enabled: 1 55 | settings: 56 | CPU: None 57 | - first: 58 | Standalone: Win64 59 | second: 60 | enabled: 1 61 | settings: 62 | CPU: AnyCPU 63 | userData: 64 | assetBundleName: 65 | assetBundleVariant: 66 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracoenc_unity.bundle/Contents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c364a46ec41846cd9e34323745d10fa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracoenc_unity.bundle/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | dracoenc_unity 9 | CFBundleGetInfoString 10 | 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | 19 | CFBundleName 20 | 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 29 | CSResourcesFileMapped 30 | 31 | NSHumanReadableCopyright 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracoenc_unity.bundle/Contents/Info.plist.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a14e78e139614b02b1f6a2fe6c49768 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracoenc_unity.bundle/Contents/MacOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40619de70b6f54a66936adcd527ed960 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracoenc_unity.bundle/Contents/MacOS/dracoenc_unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atteneder/DracoUnity/2fb796c3cbd1d85fc76957422259b9af624d3741/Runtime/Plugins/x86_64/dracoenc_unity.bundle/Contents/MacOS/dracoenc_unity -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracoenc_unity.bundle/Contents/MacOS/dracoenc_unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10f0b1b20e77947cf9486881cb13300f 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracoenc_unity.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:382283594ddc37e18c9ca224b912396722fdff1d2274ee979109626a633649e8 3 | size 259584 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/dracoenc_unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f9d7725d84314adeb6e6435e71c3ac2 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 0 20 | Exclude Linux64: 0 21 | Exclude OSXUniversal: 0 22 | Exclude WebGL: 1 23 | Exclude Win: 0 24 | Exclude Win64: 0 25 | - first: 26 | Any: 27 | second: 28 | enabled: 0 29 | settings: {} 30 | - first: 31 | Editor: Editor 32 | second: 33 | enabled: 1 34 | settings: 35 | CPU: x86_64 36 | DefaultValueInitialized: true 37 | OS: Windows 38 | - first: 39 | Standalone: Linux64 40 | second: 41 | enabled: 1 42 | settings: 43 | CPU: AnyCPU 44 | - first: 45 | Standalone: OSXUniversal 46 | second: 47 | enabled: 1 48 | settings: 49 | CPU: x86_64 50 | - first: 51 | Standalone: Win 52 | second: 53 | enabled: 1 54 | settings: 55 | CPU: None 56 | - first: 57 | Standalone: Win64 58 | second: 59 | enabled: 1 60 | settings: 61 | CPU: AnyCPU 62 | userData: 63 | assetBundleName: 64 | assetBundleVariant: 65 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/libdracodec_unity.so: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e2268a02ee1acddf0c1cb7760f4fc212a3698d2127c7887cad88e8ba3f38f1a7 3 | size 671888 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/libdracodec_unity.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93990b90c29d44e94806909f11cc4ffe 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 0 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 1 25 | Exclude WebGL: 1 26 | Exclude Win: 0 27 | Exclude Win64: 0 28 | Exclude iOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 0 33 | settings: 34 | CPU: ARMv7 35 | - first: 36 | Any: 37 | second: 38 | enabled: 0 39 | settings: {} 40 | - first: 41 | Editor: Editor 42 | second: 43 | enabled: 1 44 | settings: 45 | CPU: x86_64 46 | DefaultValueInitialized: true 47 | OS: Linux 48 | - first: 49 | Facebook: Win 50 | second: 51 | enabled: 0 52 | settings: 53 | CPU: None 54 | - first: 55 | Facebook: Win64 56 | second: 57 | enabled: 1 58 | settings: 59 | CPU: AnyCPU 60 | - first: 61 | Standalone: Linux 62 | second: 63 | enabled: 1 64 | settings: 65 | CPU: None 66 | - first: 67 | Standalone: Linux64 68 | second: 69 | enabled: 1 70 | settings: 71 | CPU: AnyCPU 72 | - first: 73 | Standalone: LinuxUniversal 74 | second: 75 | enabled: 1 76 | settings: 77 | CPU: x86_64 78 | - first: 79 | Standalone: OSXUniversal 80 | second: 81 | enabled: 0 82 | settings: 83 | CPU: None 84 | - first: 85 | Standalone: Win 86 | second: 87 | enabled: 1 88 | settings: 89 | CPU: None 90 | - first: 91 | Standalone: Win64 92 | second: 93 | enabled: 1 94 | settings: 95 | CPU: AnyCPU 96 | - first: 97 | iPhone: iOS 98 | second: 99 | enabled: 0 100 | settings: 101 | AddToEmbeddedBinaries: false 102 | CPU: AnyCPU 103 | CompileFlags: 104 | FrameworkDependencies: 105 | userData: 106 | assetBundleName: 107 | assetBundleVariant: 108 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/libdracoenc_unity.so: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:839cbe1be86f442e4d134ccb3b7a8a54c68bb1664bc77bdb9ce173b7b54702dd 3 | size 961176 4 | -------------------------------------------------------------------------------- /Runtime/Plugins/x86_64/libdracoenc_unity.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8fe4bad9d84548ca84a55dfcc7cbf8b 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 1 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 0 20 | Exclude Linux64: 0 21 | Exclude OSXUniversal: 1 22 | Exclude WebGL: 1 23 | Exclude Win: 0 24 | Exclude Win64: 0 25 | - first: 26 | Any: 27 | second: 28 | enabled: 0 29 | settings: {} 30 | - first: 31 | Editor: Editor 32 | second: 33 | enabled: 1 34 | settings: 35 | CPU: x86_64 36 | DefaultValueInitialized: true 37 | OS: Linux 38 | - first: 39 | Standalone: Linux64 40 | second: 41 | enabled: 1 42 | settings: 43 | CPU: AnyCPU 44 | - first: 45 | Standalone: OSXUniversal 46 | second: 47 | enabled: 0 48 | settings: 49 | CPU: None 50 | - first: 51 | Standalone: Win 52 | second: 53 | enabled: 1 54 | settings: 55 | CPU: None 56 | - first: 57 | Standalone: Win64 58 | second: 59 | enabled: 1 60 | settings: 61 | CPU: AnyCPU 62 | userData: 63 | assetBundleName: 64 | assetBundleVariant: 65 | -------------------------------------------------------------------------------- /Runtime/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70b90cd107c7e4d6aadd3afe252967cc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Scripts/Draco.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Draco", 3 | "rootNamespace": "", 4 | "references": [ 5 | "Unity.Burst" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": true, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /Runtime/Scripts/Draco.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f1db07d22489445ab0fc8ed6ef2ed4f 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Scripts/DracoDecodeInstance.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Draco Authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | using System.Collections.Generic; 17 | using System.Threading.Tasks; 18 | using UnityEngine; 19 | 20 | namespace Draco { 21 | 22 | /// 23 | /// Lets you assigns Draco data (in form of a ) to one or more 24 | /// targets and decode them at runtime. 25 | /// 26 | /// 27 | public class DracoDecodeInstance : ScriptableObject { 28 | 29 | [SerializeField] 30 | TextAsset dracoAsset; 31 | 32 | [SerializeField] 33 | Bounds bounds; 34 | 35 | [SerializeField] 36 | List targets; 37 | 38 | /// 39 | /// Decodes the Draco data and assigns it to all targets. 40 | /// 41 | /// A 42 | public async Task Decode() { 43 | var draco = new DracoMeshLoader(false); 44 | var mesh = await draco.ConvertDracoMeshToUnity(dracoAsset.bytes); 45 | mesh.bounds = bounds; 46 | #if DEBUG 47 | mesh.name = dracoAsset.name; 48 | #endif 49 | foreach (var meshFilter in targets) { 50 | meshFilter.mesh = mesh; 51 | } 52 | } 53 | 54 | /// 55 | /// Sets the Draco data asset and its bounds. 56 | /// 57 | /// Draco data. 58 | /// Bounds of the decoded Draco mesh. 59 | public void SetAsset(TextAsset newDracoAsset, Bounds newBounds) { 60 | dracoAsset = newDracoAsset; 61 | bounds = newBounds; 62 | } 63 | 64 | /// 65 | /// Adds a target that the Draco mesh will be assigned to when is 66 | /// invoked. 67 | /// 68 | /// New target to be added 69 | public void AddTarget(MeshFilter meshFilter) { 70 | if (targets == null) targets = new List(); 71 | targets.Add(meshFilter); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Runtime/Scripts/DracoDecodeInstance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e57bbaf0c3e504f9ba4cbef3a0bd406b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Scripts/DracoDecoder.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Draco Authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | using System; 17 | using System.Threading.Tasks; 18 | using UnityEngine; 19 | 20 | namespace Draco { 21 | 22 | /// 23 | /// Decodes multiple Draco data and assigns it to targets. 24 | /// 25 | public class DracoDecoder : MonoBehaviour { 26 | 27 | /// 28 | /// Decode instances (one per Draco mesh) 29 | /// 30 | public DracoDecodeInstance[] instances; 31 | 32 | async void Start() { 33 | var startTime = Time.realtimeSinceStartup; 34 | var tasks = new Task[instances.Length]; 35 | for (var i = 0; i < instances.Length; i++) { 36 | var instance = instances[i]; 37 | tasks[i] = instance.Decode(); 38 | } 39 | await Task.WhenAll(tasks); 40 | var time = Time.realtimeSinceStartup - startTime; 41 | Debug.Log($"Decoded {instances.Length} meshes in {time:0.000} seconds"); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Runtime/Scripts/DracoDecoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d681a6b59f604e8fa961474f291408d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Scripts/DracoMeshLoader.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Draco Authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | using System; 17 | using System.Runtime.CompilerServices; 18 | using System.Threading.Tasks; 19 | using Unity.Collections; 20 | using Unity.Collections.LowLevel.Unsafe; 21 | using Unity.Jobs; 22 | using UnityEngine; 23 | using UnityEngine.Rendering; 24 | 25 | [assembly: InternalsVisibleTo("DracoEditor")] 26 | 27 | namespace Draco { 28 | 29 | /// 30 | /// Provides Draco mesh decoding. 31 | /// 32 | public class DracoMeshLoader { 33 | 34 | /// 35 | /// If true, coordinate space is converted from right-hand (like in glTF) to left-hand (Unity). 36 | /// 37 | bool m_ConvertSpace; 38 | 39 | /// 40 | /// Create a DracoMeshLoader instance which let's you decode Draco data. 41 | /// 42 | /// If true, coordinate space is converted from right-hand (like in glTF) to left-hand (Unity). 43 | public DracoMeshLoader(bool convertSpace = true) { 44 | m_ConvertSpace = convertSpace; 45 | } 46 | 47 | /// 48 | /// Holds the result of the Draco decoding process. 49 | /// 50 | public struct DecodeResult { 51 | /// 52 | /// True if the decoding was successful 53 | /// 54 | public bool success; 55 | 56 | /// 57 | /// True, if the normals were marked required, but not present in Draco mesh. 58 | /// They have to get calculated. 59 | /// 60 | public bool calculateNormals; 61 | 62 | /// 63 | /// If the Draco file contained bone indices and bone weights, 64 | /// this property is used to carry them over (since MeshData currently 65 | /// provides no way to apply those values) 66 | /// 67 | public BoneWeightData boneWeightData; 68 | } 69 | 70 | /// 71 | /// Draco encoded meshes might contain bone weights and indices that cannot be applied to the resulting Unity 72 | /// mesh right away. This class provides them and offers methods to apply them to Unity meshes. 73 | /// This 74 | /// 75 | public class BoneWeightData : IDisposable { 76 | NativeArray m_BonesPerVertex; 77 | NativeArray m_BoneWeights; 78 | 79 | /// 80 | /// Constructs an object with parameters identical to . 81 | /// 82 | /// Bones per vertex 83 | /// Bone weights 84 | /// 85 | public BoneWeightData(NativeArray bonesPerVertex, NativeArray boneWeights) { 86 | m_BonesPerVertex = bonesPerVertex; 87 | m_BoneWeights = boneWeights; 88 | } 89 | 90 | /// 91 | /// Applies the bone weights and indices on a Unity mesh. 92 | /// 93 | /// The mesh to apply the data onto. 94 | public void ApplyOnMesh(Mesh mesh) { 95 | mesh.SetBoneWeights(m_BonesPerVertex,m_BoneWeights); 96 | } 97 | 98 | /// 99 | /// Releases allocated resources. 100 | /// 101 | public void Dispose() { 102 | m_BonesPerVertex.Dispose(); 103 | m_BoneWeights.Dispose(); 104 | } 105 | } 106 | 107 | /// 108 | /// that are used when decoding meshes from Draco data. 109 | /// 110 | public const MeshUpdateFlags defaultMeshUpdateFlags = MeshUpdateFlags.DontRecalculateBounds | MeshUpdateFlags.DontValidateIndices | MeshUpdateFlags.DontNotifyMeshUsers | MeshUpdateFlags.DontResetBoneBounds; 111 | 112 | /// 113 | /// Decodes a Draco mesh 114 | /// 115 | /// Compressed Draco data 116 | /// /// If draco does not contain normals and this is set to true, normals are calculated. 117 | /// If draco does not contain tangents and this is set to true, tangents and normals are calculated. 118 | /// Draco attribute ID that contains bone weights (for skinning) 119 | /// Draco attribute ID that contains bone joint indices (for skinning) 120 | /// Enforces vertex buffer layout with highest compatibility. Enable this if you want to use blend shapes on the resulting mesh 121 | /// Unity Mesh or null in case of errors 122 | public async Task ConvertDracoMeshToUnity( 123 | NativeSlice encodedData, 124 | bool requireNormals = false, 125 | bool requireTangents = false, 126 | int weightsAttributeId = -1, 127 | int jointsAttributeId = -1, 128 | bool forceUnityLayout = false 129 | ) 130 | { 131 | var encodedDataPtr = GetUnsafeReadOnlyIntPtr(encodedData); 132 | var meshDataArray = Mesh.AllocateWritableMeshData(1); 133 | var mesh = meshDataArray[0]; 134 | var result = await ConvertDracoMeshToUnity( 135 | mesh, 136 | encodedDataPtr, 137 | encodedData.Length, 138 | requireNormals, 139 | requireTangents, 140 | weightsAttributeId, 141 | jointsAttributeId, 142 | forceUnityLayout 143 | ); 144 | if (!result.success) { 145 | meshDataArray.Dispose(); 146 | return null; 147 | } 148 | var unityMesh = new Mesh(); 149 | Mesh.ApplyAndDisposeWritableMeshData(meshDataArray,unityMesh,defaultMeshUpdateFlags); 150 | if (result.boneWeightData != null) { 151 | result.boneWeightData.ApplyOnMesh(unityMesh); 152 | result.boneWeightData.Dispose(); 153 | } 154 | 155 | if (unityMesh.GetTopology(0) == MeshTopology.Triangles) 156 | { 157 | if (result.calculateNormals) 158 | { 159 | unityMesh.RecalculateNormals(); 160 | } 161 | if (requireTangents) 162 | { 163 | unityMesh.RecalculateTangents(); 164 | } 165 | } 166 | return unityMesh; 167 | } 168 | 169 | /// 170 | /// Decodes a Draco mesh 171 | /// 172 | /// Compressed Draco data 173 | /// If draco does not contain normals and this is set to true, normals are calculated. 174 | /// If draco does not contain tangents and this is set to true, tangents and normals are calculated. 175 | /// Draco attribute ID that contains bone weights (for skinning) 176 | /// Draco attribute ID that contains bone joint indices (for skinning) 177 | /// Enforces vertex buffer layout with highest compatibility. Enable this if you want to use blend shapes on the resulting mesh 178 | /// Unity Mesh or null in case of errors 179 | public async Task ConvertDracoMeshToUnity( 180 | byte[] encodedData, 181 | bool requireNormals = false, 182 | bool requireTangents = false, 183 | int weightsAttributeId = -1, 184 | int jointsAttributeId = -1, 185 | bool forceUnityLayout = false 186 | ) 187 | { 188 | return await ConvertByteArray( 189 | encodedData, 190 | requireNormals, 191 | requireTangents, 192 | weightsAttributeId, 193 | jointsAttributeId, 194 | forceUnityLayout 195 | ); 196 | } 197 | 198 | /// 199 | /// Decodes a Draco mesh 200 | /// 201 | /// MeshData used to create the mesh 202 | /// Compressed Draco data 203 | /// If draco does not contain normals and this is set to true, normals are calculated. 204 | /// If draco does not contain tangents and this is set to true, tangents and normals are calculated. 205 | /// Draco attribute ID that contains bone weights (for skinning) 206 | /// Draco attribute ID that contains bone joint indices (for skinning) 207 | /// Enforces vertex buffer layout with highest compatibility. Enable this if you want to use blend shapes on the resulting mesh 208 | /// A DecodeResult 209 | public async Task ConvertDracoMeshToUnity( 210 | Mesh.MeshData mesh, 211 | byte[] encodedData, 212 | bool requireNormals = false, 213 | bool requireTangents = false, 214 | int weightsAttributeId = -1, 215 | int jointsAttributeId = -1, 216 | bool forceUnityLayout = false 217 | ) 218 | { 219 | var encodedDataPtr = PinGCArrayAndGetDataAddress(encodedData, out var gcHandle); 220 | var result = await ConvertDracoMeshToUnity( 221 | mesh, 222 | encodedDataPtr, 223 | encodedData.Length, 224 | requireNormals, 225 | requireTangents, 226 | weightsAttributeId, 227 | jointsAttributeId, 228 | forceUnityLayout 229 | ); 230 | UnsafeUtility.ReleaseGCObject(gcHandle); 231 | return result; 232 | } 233 | 234 | /// 235 | /// Decodes a Draco mesh 236 | /// 237 | /// MeshData used to create the mesh 238 | /// Compressed Draco data 239 | /// If draco does not contain normals and this is set to true, normals are calculated. 240 | /// If draco does not contain tangents and this is set to true, tangents and normals are calculated. 241 | /// Draco attribute ID that contains bone weights (for skinning) 242 | /// Draco attribute ID that contains bone joint indices (for skinning) 243 | /// Enforces vertex buffer layout with highest compatibility. Enable this if you want to use blend shapes on the resulting mesh 244 | /// A DecodeResult 245 | public async Task ConvertDracoMeshToUnity( 246 | Mesh.MeshData mesh, 247 | NativeArray encodedData, 248 | bool requireNormals = false, 249 | bool requireTangents = false, 250 | int weightsAttributeId = -1, 251 | int jointsAttributeId = -1, 252 | bool forceUnityLayout = false 253 | ) 254 | { 255 | var encodedDataPtr = GetUnsafeReadOnlyIntPtr(encodedData); 256 | return await ConvertDracoMeshToUnity( 257 | mesh, 258 | encodedDataPtr, 259 | encodedData.Length, 260 | requireNormals, 261 | requireTangents, 262 | weightsAttributeId, 263 | jointsAttributeId, 264 | forceUnityLayout 265 | ); 266 | } 267 | 268 | #if UNITY_EDITOR 269 | internal async Task ConvertDracoMeshToUnitySync( 270 | Mesh.MeshData mesh, 271 | NativeArray encodedData, 272 | bool requireNormals = false, 273 | bool requireTangents = false, 274 | int weightsAttributeId = -1, 275 | int jointsAttributeId = -1, 276 | bool forceUnityLayout = false 277 | ) 278 | { 279 | var encodedDataPtr = GetUnsafeReadOnlyIntPtr(encodedData); 280 | return await ConvertDracoMeshToUnity( 281 | mesh, 282 | encodedDataPtr, 283 | encodedData.Length, 284 | requireNormals, 285 | requireTangents, 286 | weightsAttributeId, 287 | jointsAttributeId, 288 | forceUnityLayout, 289 | true 290 | ); 291 | } 292 | 293 | internal async Task ConvertDracoMeshToUnitySync( 294 | byte[] encodedData, 295 | bool requireNormals = false, 296 | bool requireTangents = false, 297 | int weightsAttributeId = -1, 298 | int jointsAttributeId = -1, 299 | bool forceUnityLayout = false 300 | ) 301 | { 302 | return await ConvertByteArray( 303 | encodedData, 304 | requireNormals, 305 | requireTangents, 306 | weightsAttributeId, 307 | jointsAttributeId, 308 | forceUnityLayout, 309 | true 310 | ); 311 | } 312 | #endif 313 | 314 | async Task ConvertByteArray( 315 | byte[] encodedData, 316 | bool requireNormals = false, 317 | bool requireTangents = false, 318 | int weightsAttributeId = -1, 319 | int jointsAttributeId = -1, 320 | bool forceUnityLayout = false 321 | #if UNITY_EDITOR 322 | ,bool sync = false 323 | #endif 324 | ) 325 | { 326 | var encodedDataPtr = PinGCArrayAndGetDataAddress(encodedData, out var gcHandle); 327 | var meshDataArray = Mesh.AllocateWritableMeshData(1); 328 | var mesh = meshDataArray[0]; 329 | var result = await ConvertDracoMeshToUnity( 330 | mesh, 331 | encodedDataPtr, 332 | encodedData.Length, 333 | requireNormals, 334 | requireTangents, 335 | weightsAttributeId, 336 | jointsAttributeId, 337 | forceUnityLayout 338 | #if UNITY_EDITOR 339 | ,sync 340 | #endif 341 | ); 342 | UnsafeUtility.ReleaseGCObject(gcHandle); 343 | if (!result.success) { 344 | meshDataArray.Dispose(); 345 | return null; 346 | } 347 | var unityMesh = new Mesh(); 348 | Mesh.ApplyAndDisposeWritableMeshData(meshDataArray,unityMesh,defaultMeshUpdateFlags); 349 | if (result.calculateNormals) { 350 | unityMesh.RecalculateNormals(); 351 | } 352 | if (requireTangents) { 353 | unityMesh.RecalculateTangents(); 354 | } 355 | return unityMesh; 356 | } 357 | 358 | 359 | async Task ConvertDracoMeshToUnity( 360 | Mesh.MeshData mesh, 361 | IntPtr encodedData, 362 | int size, 363 | bool requireNormals, 364 | bool requireTangents, 365 | int weightsAttributeId = -1, 366 | int jointsAttributeId = -1, 367 | bool forceUnityLayout = false 368 | #if UNITY_EDITOR 369 | ,bool sync = false 370 | #endif 371 | ) 372 | { 373 | var dracoNative = new DracoNative(mesh,m_ConvertSpace); 374 | var result = new DecodeResult(); 375 | 376 | #if UNITY_EDITOR 377 | if (sync) { 378 | dracoNative.InitSync(encodedData, size); 379 | } 380 | else 381 | #endif 382 | { 383 | await WaitForJobHandle(dracoNative.Init(encodedData, size)); 384 | } 385 | if (dracoNative.ErrorOccured()) { 386 | return result; 387 | } 388 | if (!requireNormals && requireTangents) { 389 | // Sanity check: We need normals to calculate tangents 390 | requireNormals = true; 391 | } 392 | dracoNative.CreateMesh( 393 | out result.calculateNormals, 394 | requireNormals, 395 | requireTangents, 396 | weightsAttributeId, 397 | jointsAttributeId, 398 | forceUnityLayout 399 | ); 400 | #if UNITY_EDITOR 401 | if (sync) { 402 | dracoNative.DecodeVertexDataSync(); 403 | } 404 | else 405 | #endif 406 | { 407 | await WaitForJobHandle(dracoNative.DecodeVertexData()); 408 | } 409 | var error = dracoNative.ErrorOccured(); 410 | dracoNative.DisposeDracoMesh(); 411 | if (error) { 412 | return result; 413 | } 414 | 415 | result.success = dracoNative.PopulateMeshData(); 416 | if (result.success && dracoNative.hasBoneWeightData) { 417 | result.boneWeightData = new BoneWeightData(dracoNative.bonesPerVertex, dracoNative.boneWeights); 418 | dracoNative.DisposeBoneWeightData(); 419 | } 420 | return result; 421 | } 422 | 423 | static async Task WaitForJobHandle(JobHandle jobHandle) { 424 | while (!jobHandle.IsCompleted) { 425 | await Task.Yield(); 426 | } 427 | jobHandle.Complete(); 428 | } 429 | 430 | static unsafe IntPtr GetUnsafeReadOnlyIntPtr(NativeSlice encodedData) { 431 | return (IntPtr) encodedData.GetUnsafeReadOnlyPtr(); 432 | } 433 | 434 | static unsafe IntPtr PinGCArrayAndGetDataAddress(byte[] encodedData, out ulong gcHandle) { 435 | return (IntPtr) UnsafeUtility.PinGCArrayAndGetDataAddress(encodedData, out gcHandle); 436 | } 437 | } 438 | } 439 | -------------------------------------------------------------------------------- /Runtime/Scripts/DracoMeshLoader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b88403ff20a84cb5bda72a273230702 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Scripts/DracoNative.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa0fc47072814e41b6da6e43ea74335e 3 | timeCreated: 1612822183 -------------------------------------------------------------------------------- /Runtime/Scripts/Encoder.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d497c94a689943eebc1e76a4190808d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Scripts/Encoder/DracoEncoder.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DracoEncoder", 3 | "references": [ 4 | "GUID:1f1db07d22489445ab0fc8ed6ef2ed4f", 5 | "GUID:d8b63aba1907145bea998dd612889d6b" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": true, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": false, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /Runtime/Scripts/Encoder/DracoEncoder.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 411961ebab96043d8a061c656d3a461c 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Scripts/Encoder/DracoEncoder.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Draco Authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | using System.Runtime.InteropServices; 19 | using System.Threading.Tasks; 20 | using Unity.Collections; 21 | using Unity.Collections.LowLevel.Unsafe; 22 | using Unity.Jobs; 23 | using Unity.Mathematics; 24 | using UnityEngine; 25 | using UnityEngine.Profiling; 26 | using UnityEngine.Rendering; 27 | 28 | namespace Draco.Encoder { 29 | 30 | /// 31 | /// Contains encoded data and additional meta information. 32 | /// The responsibility to dispose this struct and the native resources behind it (via ) 33 | /// is handed over to the receiver. 34 | /// 35 | public unsafe struct EncodeResult : IDisposable { 36 | 37 | /// Number of triangle indices 38 | public uint indexCount; 39 | /// Number vertices 40 | public uint vertexCount; 41 | /// Encoded data 42 | public NativeArray data; 43 | /// Vertex attribute to Draco property ID mapping 44 | public Dictionary vertexAttributes; 45 | 46 | IntPtr m_DracoEncoder; 47 | 48 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 49 | AtomicSafetyHandle m_SafetyHandle; 50 | #endif 51 | 52 | /// 53 | /// Constructs an EncodeResult. 54 | /// 55 | /// Native Draco encoder instance. 56 | /// Number of indices. 57 | /// Number of vertices. 58 | /// For each vertex attribute type there's a tuple containing 59 | /// the draco identifier and the attribute dimensions (e.g. 3 for 3D positions). 60 | public EncodeResult( 61 | IntPtr dracoEncoder, 62 | uint indexCount, 63 | uint vertexCount, 64 | Dictionary vertexAttributes 65 | ) 66 | { 67 | m_DracoEncoder = dracoEncoder; 68 | this.indexCount = indexCount; 69 | this.vertexCount = vertexCount; 70 | DracoEncoder.dracoEncoderGetEncodeBuffer(m_DracoEncoder, out var dracoData, out var size); 71 | data = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray(dracoData, (int)size, Allocator.None); 72 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 73 | m_SafetyHandle = AtomicSafetyHandle.Create(); 74 | NativeArrayUnsafeUtility.SetAtomicSafetyHandle(array: ref data, m_SafetyHandle); 75 | #endif 76 | this.vertexAttributes = vertexAttributes; 77 | } 78 | 79 | /// 80 | /// Releases allocated resources. 81 | /// 82 | public void Dispose() 83 | { 84 | vertexAttributes = null; 85 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 86 | AtomicSafetyHandle.Release(m_SafetyHandle); 87 | #endif 88 | if(m_DracoEncoder!=IntPtr.Zero) 89 | DracoEncoder.dracoEncoderRelease(m_DracoEncoder); 90 | m_DracoEncoder = IntPtr.Zero; 91 | } 92 | } 93 | 94 | /// 95 | /// Provides Draco encoding capabilities. 96 | /// 97 | public static class DracoEncoder { 98 | 99 | #if UNITY_EDITOR_OSX || UNITY_WEBGL || UNITY_IOS 100 | const string k_DracoEncUnityLib = "__Internal"; 101 | #elif UNITY_ANDROID || UNITY_STANDALONE || UNITY_WSA || UNITY_EDITOR || PLATFORM_LUMIN 102 | const string k_DracoEncUnityLib = "dracoenc_unity"; 103 | #endif 104 | 105 | struct AttributeData { 106 | public int stream; 107 | public int offset; 108 | } 109 | 110 | /// 111 | /// Calculates the ideal quantization value based on the largest dimension and desired precision 112 | /// 113 | /// Length of the largest dimension (width/depth/height) 114 | /// Desired minimum precision in world units 115 | /// Ideal quantization in bits 116 | static int GetIdealQuantization(float largestDimension, float precision) { 117 | var value = Mathf.RoundToInt(largestDimension / precision); 118 | var mostSignificantBit = -1; 119 | while (value > 0) { 120 | mostSignificantBit++; 121 | value >>= 1; 122 | } 123 | return Mathf.Clamp(mostSignificantBit,4,24); 124 | } 125 | 126 | /// 127 | /// Calculates the ideal position quantization value based on an object's world scale, bounds and the desired 128 | /// precision in world unit. 129 | /// 130 | /// World scale of the object 131 | /// Desired minimum precision in world units 132 | /// 133 | /// Ideal quantization in bits 134 | static int GetIdealQuantization(Vector3 worldScale, float precision, Bounds bounds) { 135 | var scale = new Vector3(Mathf.Abs(worldScale.x), Mathf.Abs(worldScale.y), Mathf.Abs(worldScale.z)); 136 | var maxSize = Mathf.Max( 137 | bounds.extents.x * scale.x, 138 | bounds.extents.y * scale.y, 139 | bounds.extents.z * scale.z 140 | ) * 2; 141 | var positionQuantization = GetIdealQuantization(maxSize, precision); 142 | return positionQuantization; 143 | } 144 | 145 | /// 146 | /// Applies Draco compression to a given mesh and returns the encoded result (one per submesh) 147 | /// The quality and quantization parameters are calculated from the mesh's bounds, its worldScale and desired precision. 148 | /// The quantization parameters help to find a balance between compressed size and quality / precision. 149 | /// 150 | /// Input mesh 151 | /// Local-to-world scale this mesh is present in the scene 152 | /// Desired minimum precision in world units 153 | /// Encoding speed level. 0 means slow and small. 10 is fastest. 154 | /// Decoding speed level. 0 means slow and small. 10 is fastest. 155 | /// Normal quantization 156 | /// Texture coordinate quantization 157 | /// Color quantization 158 | /// Generic quantization (e.g. blend weights and indices). unused at the moment 159 | /// Encoded data (one per submesh) 160 | public static async Task EncodeMesh( 161 | Mesh unityMesh, 162 | Vector3 worldScale, 163 | float precision = .001f, 164 | int encodingSpeed = 0, 165 | int decodingSpeed = 4, 166 | int normalQuantization = 10, 167 | int texCoordQuantization = 12, 168 | int colorQuantization = 8, 169 | int genericQuantization = 12 170 | ) 171 | { 172 | #if !UNITY_EDITOR 173 | if (!unityMesh.isReadable) { 174 | Debug.LogError("Mesh is not readable"); 175 | return null; 176 | } 177 | #endif 178 | var positionQuantization = GetIdealQuantization(worldScale, precision, unityMesh.bounds); 179 | 180 | return await EncodeMesh( 181 | unityMesh, 182 | encodingSpeed, 183 | decodingSpeed, 184 | positionQuantization, 185 | normalQuantization, 186 | texCoordQuantization, 187 | colorQuantization, 188 | genericQuantization 189 | ); 190 | } 191 | 192 | /// 193 | /// Applies Draco compression to a given mesh/meshData and returns the encoded result (one per submesh) 194 | /// The user is responsible for 195 | /// acquiring the readable MeshData 196 | /// and disposing it. 197 | /// The quality and quantization parameters are calculated from the mesh's bounds, its worldScale and desired precision. 198 | /// The quantization parameters help to find a balance between compressed size and quality / precision. 199 | /// 200 | /// Input mesh 201 | /// Previously acquired readable mesh data 202 | /// Local-to-world scale this mesh is present in the scene 203 | /// Desired minimum precision in world units 204 | /// Encoding speed level. 0 means slow and small. 10 is fastest. 205 | /// Decoding speed level. 0 means slow and small. 10 is fastest. 206 | /// Normal quantization 207 | /// Texture coordinate quantization 208 | /// Color quantization 209 | /// Generic quantization (e.g. blend weights and indices). unused at the moment 210 | /// Encoded data (one per submesh) 211 | public static async Task EncodeMesh( 212 | Mesh mesh, 213 | Mesh.MeshData meshData, 214 | Vector3 worldScale, 215 | float precision = .001f, 216 | int encodingSpeed = 0, 217 | int decodingSpeed = 4, 218 | int normalQuantization = 10, 219 | int texCoordQuantization = 12, 220 | int colorQuantization = 8, 221 | int genericQuantization = 12 222 | ) 223 | { 224 | return await EncodeMesh( 225 | mesh, 226 | meshData, 227 | encodingSpeed, 228 | decodingSpeed, 229 | GetIdealQuantization(worldScale, precision, mesh.bounds), 230 | normalQuantization, 231 | texCoordQuantization, 232 | colorQuantization, 233 | genericQuantization 234 | ); 235 | } 236 | 237 | /// 238 | /// Applies Draco compression to a given mesh and returns the encoded result (one per submesh) 239 | /// The quantization parameters help to find a balance between encoded size and quality / precision. 240 | /// 241 | /// Input mesh 242 | /// Encoding speed level. 0 means slow and small. 10 is fastest. 243 | /// Decoding speed level. 0 means slow and small. 10 is fastest. 244 | /// Vertex position quantization 245 | /// Normal quantization 246 | /// Texture coordinate quantization 247 | /// Color quantization 248 | /// Generic quantization (e.g. blend weights and indices). unused at the moment 249 | /// Encoded data (one per submesh) 250 | public static async Task EncodeMesh( 251 | Mesh unityMesh, 252 | int encodingSpeed = 0, 253 | int decodingSpeed = 4, 254 | int positionQuantization = 14, 255 | int normalQuantization = 10, 256 | int texCoordQuantization = 12, 257 | int colorQuantization = 8, 258 | int genericQuantization = 12 259 | ) { 260 | var dataArray = Mesh.AcquireReadOnlyMeshData(unityMesh); 261 | var data = dataArray[0]; 262 | 263 | var result = await EncodeMesh( 264 | unityMesh, 265 | data, 266 | encodingSpeed, 267 | decodingSpeed, 268 | positionQuantization, 269 | normalQuantization, 270 | texCoordQuantization, 271 | colorQuantization, 272 | genericQuantization 273 | ); 274 | 275 | dataArray.Dispose(); 276 | return result; 277 | } 278 | 279 | /// 280 | /// Applies Draco compression to a given mesh/meshData and returns the encoded result (one per submesh) 281 | /// The user is responsible for 282 | /// acquiring the readable MeshData 283 | /// and disposing it. 284 | /// The quantization parameters help to find a balance between encoded size and quality / precision. 285 | /// 286 | /// Input mesh 287 | /// Previously acquired readable mesh data 288 | /// Encoding speed level. 0 means slow and small. 10 is fastest. 289 | /// Decoding speed level. 0 means slow and small. 10 is fastest. 290 | /// Vertex position quantization 291 | /// Normal quantization 292 | /// Texture coordinate quantization 293 | /// Color quantization 294 | /// Generic quantization (e.g. blend weights and indices). unused at the moment 295 | /// Encoded data (one per submesh) 296 | // ReSharper disable once MemberCanBePrivate.Global 297 | public static async Task EncodeMesh( 298 | Mesh mesh, 299 | Mesh.MeshData meshData, 300 | int encodingSpeed = 0, 301 | int decodingSpeed = 4, 302 | int positionQuantization = 14, 303 | int normalQuantization = 10, 304 | int texCoordQuantization = 12, 305 | int colorQuantization = 8, 306 | int genericQuantization = 12 307 | ) 308 | { 309 | #if UNITY_2020_1_OR_NEWER 310 | #if !UNITY_EDITOR 311 | if (!mesh.isReadable) { 312 | Debug.LogError("Mesh is not readable"); 313 | return null; 314 | } 315 | #endif 316 | Profiler.BeginSample("EncodeMesh.Prepare"); 317 | 318 | var result = new EncodeResult[meshData.subMeshCount]; 319 | var vertexAttributes = mesh.GetVertexAttributes(); 320 | 321 | var strides = new int[DracoNative.maxStreamCount]; 322 | var attributeDataDict = new Dictionary(); 323 | 324 | foreach (var attribute in vertexAttributes) { 325 | var attributeData = new AttributeData { offset = strides[attribute.stream], stream = attribute.stream }; 326 | var size = attribute.dimension * GetAttributeSize(attribute.format); 327 | strides[attribute.stream] += size; 328 | attributeDataDict[attribute.attribute] = attributeData; 329 | } 330 | 331 | var streamCount = 1; 332 | for (var stream = 0; stream < strides.Length; stream++) { 333 | var stride = strides[stream]; 334 | if(stride<=0) continue; 335 | streamCount = stream + 1; 336 | } 337 | 338 | var vData = new NativeArray[streamCount]; 339 | for (var stream = 0; stream < streamCount; stream++) { 340 | vData[stream] = meshData.GetVertexData(stream); 341 | } 342 | 343 | var vDataPtr = GetReadOnlyPointers(streamCount, vData); 344 | Profiler.EndSample(); // EncodeMesh.Prepare 345 | 346 | for (var submeshIndex = 0; submeshIndex < mesh.subMeshCount; submeshIndex++) { 347 | 348 | Profiler.BeginSample("EncodeMesh.Submesh.Prepare"); 349 | var submesh = mesh.GetSubMesh(submeshIndex); 350 | 351 | if (submesh.topology != MeshTopology.Triangles && submesh.topology != MeshTopology.Points) { 352 | Debug.LogError($"Mesh topology {submesh.topology} is not supported"); 353 | return null; 354 | } 355 | 356 | var dracoEncoder = submesh.topology == MeshTopology.Triangles 357 | ? dracoEncoderCreate(mesh.vertexCount) 358 | : dracoEncoderCreatePointCloud(mesh.vertexCount); 359 | 360 | var attributeIds = new Dictionary(); 361 | 362 | foreach (var attributeTuple in attributeDataDict) 363 | { 364 | var attribute = attributeTuple.Key; 365 | var attrData = attributeTuple.Value; 366 | var format = mesh.GetVertexAttributeFormat(attribute); 367 | var dimension = mesh.GetVertexAttributeDimension(attribute); 368 | var stride = strides[attrData.stream]; 369 | var baseAddr = vDataPtr[attrData.stream] + attrData.offset; 370 | var id = dracoEncoderSetAttribute( 371 | dracoEncoder, 372 | (int) GetAttributeType(attribute), 373 | GetDataType(format), 374 | dimension, 375 | stride, 376 | DracoNative.ConvertSpace(attribute), 377 | baseAddr 378 | ); 379 | attributeIds[attribute] = (id, dimension); 380 | } 381 | 382 | if (submesh.topology == MeshTopology.Triangles) 383 | { 384 | var indices = mesh.GetIndices(submeshIndex); 385 | var indicesData = PinArray(indices, out var gcHandle); 386 | dracoEncoderSetIndices( 387 | dracoEncoder, 388 | DataType.UInt32, 389 | (uint)indices.Length, 390 | true, 391 | indicesData 392 | ); 393 | UnsafeUtility.ReleaseGCObject(gcHandle); 394 | } 395 | 396 | // For both encoding and decoding (0 = slow and best compression; 10 = fast) 397 | dracoEncoderSetCompressionSpeed(dracoEncoder, Mathf.Clamp(encodingSpeed,0,10), Mathf.Clamp(decodingSpeed,0,10)); 398 | dracoEncoderSetQuantizationBits( 399 | dracoEncoder, 400 | Mathf.Clamp(positionQuantization,4,24), 401 | Mathf.Clamp(normalQuantization,4,24), 402 | Mathf.Clamp(texCoordQuantization,4,24), 403 | Mathf.Clamp(colorQuantization,4,24), 404 | Mathf.Clamp(genericQuantization,4,24) 405 | ); 406 | 407 | var encodeJob = new EncodeJob 408 | { 409 | dracoEncoder = dracoEncoder 410 | }; 411 | 412 | Profiler.EndSample(); //EncodeMesh.Submesh.Prepare 413 | 414 | var jobHandle = encodeJob.Schedule(); 415 | while (!jobHandle.IsCompleted) 416 | { 417 | await Task.Yield(); 418 | } 419 | jobHandle.Complete(); 420 | 421 | Profiler.BeginSample("EncodeMesh.Submesh.Aftermath"); 422 | 423 | result[submeshIndex] = new EncodeResult ( 424 | dracoEncoder, 425 | dracoEncoderGetEncodedIndexCount(dracoEncoder), 426 | dracoEncoderGetEncodedVertexCount(dracoEncoder), 427 | attributeIds 428 | ); 429 | 430 | Profiler.EndSample(); // EncodeMesh.Submesh.Aftermath 431 | } 432 | 433 | Profiler.BeginSample("EncodeMesh.Aftermath"); 434 | for (var stream = 0; stream < streamCount; stream++) { 435 | vData[stream].Dispose(); 436 | } 437 | 438 | Profiler.EndSample(); 439 | return result; 440 | #else 441 | Debug.LogError("Draco Encoding only works on Unity 2020.1 or newer"); 442 | return null; 443 | #endif 444 | } 445 | 446 | static unsafe IntPtr PinArray(int[] indices, out ulong gcHandle) 447 | { 448 | return (IntPtr)UnsafeUtility.PinGCArrayAndGetDataAddress(indices, out gcHandle); 449 | } 450 | 451 | static unsafe IntPtr[] GetReadOnlyPointers(int count, NativeArray[] vData) 452 | { 453 | var result = new IntPtr[count]; 454 | for (var stream = 0; stream < count; stream++) { 455 | result[stream] = (IntPtr) vData[stream].GetUnsafeReadOnlyPtr(); 456 | } 457 | 458 | return result; 459 | } 460 | 461 | static DataType GetDataType(VertexAttributeFormat format) { 462 | switch (format) { 463 | case VertexAttributeFormat.Float32: 464 | case VertexAttributeFormat.Float16: 465 | return DataType.Float32; 466 | case VertexAttributeFormat.UNorm8: 467 | case VertexAttributeFormat.UInt8: 468 | return DataType.UInt8; 469 | case VertexAttributeFormat.SNorm8: 470 | case VertexAttributeFormat.SInt8: 471 | return DataType.Int8; 472 | case VertexAttributeFormat.UInt16: 473 | case VertexAttributeFormat.UNorm16: 474 | return DataType.UInt16; 475 | case VertexAttributeFormat.SInt16: 476 | case VertexAttributeFormat.SNorm16: 477 | return DataType.Int16; 478 | case VertexAttributeFormat.UInt32: 479 | case VertexAttributeFormat.SInt32: 480 | return DataType.Int32; 481 | default: 482 | throw new ArgumentOutOfRangeException(nameof(format), format, null); 483 | } 484 | } 485 | 486 | static AttributeType GetAttributeType(VertexAttribute attribute) { 487 | switch (attribute) { 488 | case VertexAttribute.Position: 489 | return AttributeType.Position; 490 | case VertexAttribute.Normal: 491 | return AttributeType.Normal; 492 | case VertexAttribute.Color: 493 | return AttributeType.Color; 494 | case VertexAttribute.TexCoord0: 495 | case VertexAttribute.TexCoord1: 496 | case VertexAttribute.TexCoord2: 497 | case VertexAttribute.TexCoord3: 498 | case VertexAttribute.TexCoord4: 499 | case VertexAttribute.TexCoord5: 500 | case VertexAttribute.TexCoord6: 501 | case VertexAttribute.TexCoord7: 502 | return AttributeType.TextureCoordinate; 503 | case VertexAttribute.Tangent: 504 | case VertexAttribute.BlendWeight: 505 | case VertexAttribute.BlendIndices: 506 | return AttributeType.Generic; 507 | default: 508 | throw new ArgumentOutOfRangeException(nameof(attribute), attribute, null); 509 | } 510 | } 511 | 512 | static unsafe int GetAttributeSize(VertexAttributeFormat format) { 513 | switch (format) { 514 | case VertexAttributeFormat.Float32: 515 | return sizeof(float); 516 | case VertexAttributeFormat.Float16: 517 | return sizeof(half); 518 | case VertexAttributeFormat.UNorm8: 519 | return sizeof(byte); 520 | case VertexAttributeFormat.SNorm8: 521 | return sizeof(sbyte); 522 | case VertexAttributeFormat.UNorm16: 523 | return sizeof(ushort); 524 | case VertexAttributeFormat.SNorm16: 525 | return sizeof(short); 526 | case VertexAttributeFormat.UInt8: 527 | return sizeof(byte); 528 | case VertexAttributeFormat.SInt8: 529 | return sizeof(sbyte); 530 | case VertexAttributeFormat.UInt16: 531 | return sizeof(ushort); 532 | case VertexAttributeFormat.SInt16: 533 | return sizeof(short); 534 | case VertexAttributeFormat.UInt32: 535 | return sizeof(uint); 536 | case VertexAttributeFormat.SInt32: 537 | return sizeof(int); 538 | default: 539 | throw new ArgumentOutOfRangeException(nameof(format), format, null); 540 | } 541 | } 542 | 543 | [DllImport (k_DracoEncUnityLib)] 544 | static extern IntPtr dracoEncoderCreate(int vertexCount); 545 | 546 | [DllImport(k_DracoEncUnityLib)] 547 | static extern IntPtr dracoEncoderCreatePointCloud(int vertexCount); 548 | 549 | [DllImport (k_DracoEncUnityLib)] 550 | internal static extern void dracoEncoderRelease(IntPtr encoder); 551 | 552 | [DllImport (k_DracoEncUnityLib)] 553 | static extern void dracoEncoderSetCompressionSpeed(IntPtr encoder, int encodingSpeed, int decodingSpeed); 554 | 555 | [DllImport (k_DracoEncUnityLib)] 556 | static extern void dracoEncoderSetQuantizationBits(IntPtr encoder, int position, int normal, int uv, int color, int generic); 557 | 558 | [DllImport (k_DracoEncUnityLib)] 559 | internal static extern bool dracoEncoderEncode(IntPtr encoder, bool preserveTriangleOrder); 560 | 561 | [DllImport (k_DracoEncUnityLib)] 562 | static extern uint dracoEncoderGetEncodedVertexCount(IntPtr encoder); 563 | 564 | [DllImport (k_DracoEncUnityLib)] 565 | static extern uint dracoEncoderGetEncodedIndexCount(IntPtr encoder); 566 | 567 | [DllImport (k_DracoEncUnityLib)] 568 | internal static extern unsafe void dracoEncoderGetEncodeBuffer(IntPtr encoder, out void *data, out ulong size); 569 | 570 | 571 | [DllImport (k_DracoEncUnityLib)] 572 | static extern bool dracoEncoderSetIndices( 573 | IntPtr encoder, 574 | DataType indexComponentType, 575 | uint indexCount, 576 | bool flip, 577 | IntPtr indices 578 | ); 579 | 580 | [DllImport (k_DracoEncUnityLib)] 581 | static extern uint dracoEncoderSetAttribute( 582 | IntPtr encoder, 583 | int attributeType, 584 | DataType dracoDataType, 585 | int componentCount, 586 | int stride, 587 | bool flip, 588 | IntPtr data); 589 | } 590 | 591 | struct EncodeJob : IJob 592 | { 593 | [NativeDisableUnsafePtrRestriction] 594 | public IntPtr dracoEncoder; 595 | 596 | public void Execute() 597 | { 598 | DracoEncoder.dracoEncoderEncode(dracoEncoder, false); 599 | } 600 | } 601 | } 602 | -------------------------------------------------------------------------------- /Runtime/Scripts/Encoder/DracoEncoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 557ce9dadd2a4412c9eae209960c5dda 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /THIRD PARTY NOTICES.md: -------------------------------------------------------------------------------- 1 | This package contains third-party software components governed by the license(s) indicated below: 2 | 3 | Component Name: Draco 3D data compression library 4 | License Type: "Apache License 2.0" 5 | [Draco 3D data compression library License](https://github.com/google/draco/blob/master/LICENSE) 6 | -------------------------------------------------------------------------------- /THIRD PARTY NOTICES.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4404ae86107754a6d91304666c70c927 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 66b3006ee05184de1b75fefa849da75f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tests/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c8e4ae3ab20a477f964f183912c9bd4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tests/Runtime/DracoRuntimeTests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DracoRuntimeTests", 3 | "rootNamespace": "", 4 | "references": [ 5 | "UnityEngine.TestRunner", 6 | "UnityEditor.TestRunner", 7 | "Draco", 8 | "DracoEncoder" 9 | ], 10 | "includePlatforms": [], 11 | "excludePlatforms": [], 12 | "allowUnsafeCode": false, 13 | "overrideReferences": true, 14 | "precompiledReferences": [ 15 | "nunit.framework.dll" 16 | ], 17 | "autoReferenced": false, 18 | "defineConstraints": [ 19 | "UNITY_INCLUDE_TESTS" 20 | ], 21 | "versionDefines": [], 22 | "noEngineReferences": false 23 | } -------------------------------------------------------------------------------- /Tests/Runtime/DracoRuntimeTests.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2fa47753bda84e26a55a9406b15f303 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Tests/Runtime/DracoRuntimeTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Draco Authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | using System.Collections; 17 | using System.Collections.Generic; 18 | using System.Threading.Tasks; 19 | using NUnit.Framework; 20 | using Unity.Collections; 21 | using UnityEngine; 22 | using UnityEngine.Networking; 23 | using UnityEngine.Rendering; 24 | using UnityEngine.TestTools; 25 | 26 | namespace Draco.Tests 27 | { 28 | 29 | public class DracoRuntimeTests { 30 | 31 | const string k_URLPrefix = "https://raw.githubusercontent.com/google/draco/master/testdata/"; 32 | 33 | [UnityTest] 34 | [UseDracoTestFileCase(new[] { 35 | "bunny_gltf.drc", 36 | "car.drc", 37 | "cube_att.obj.edgebreaker.cl10.2.2.drc", 38 | "cube_att.obj.edgebreaker.cl4.2.2.drc", 39 | "cube_att.obj.sequential.cl3.2.2.drc", 40 | "cube_att_sub_o_2.drc", 41 | "cube_att_sub_o_no_metadata.drc", 42 | "octagon_preserved.drc", 43 | "pc_kd_color.drc", 44 | "point_cloud_no_qp.drc", 45 | "test_nm.obj.edgebreaker.cl10.2.2.drc", 46 | "test_nm.obj.edgebreaker.cl4.2.2.drc", 47 | "test_nm.obj.sequential.cl3.2.2.drc", 48 | 49 | // // Legacy versions not supported 50 | // "cube_pc.drc", 51 | // "pc_color.drc", 52 | // "test_nm.obj.edgebreaker.0.10.0.drc", 53 | // "test_nm.obj.edgebreaker.0.9.1.drc", 54 | // "test_nm.obj.edgebreaker.1.0.0.drc", 55 | // "test_nm.obj.edgebreaker.1.1.0.drc", 56 | // "test_nm.obj.sequential.0.10.0.drc", 57 | // "test_nm.obj.sequential.0.9.1.drc", 58 | // "test_nm.obj.sequential.1.0.0.drc", 59 | // "test_nm.obj.sequential.1.1.0.drc", 60 | // "test_nm_quant.0.9.0.drc", 61 | 62 | // // Unknown why it does not work 63 | // "cube_att.drc", 64 | })] 65 | public IEnumerator LoadDracoOfficialTestData(string url) { 66 | yield return RunTest(k_URLPrefix+url); 67 | } 68 | 69 | [UnityTest] 70 | [UseDracoTestFileCase(new[] { 71 | "bunny_gltf.drc", 72 | "car.drc", 73 | "cube_att.obj.edgebreaker.cl10.2.2.drc", 74 | "cube_att.obj.edgebreaker.cl4.2.2.drc", 75 | "cube_att.obj.sequential.cl3.2.2.drc", 76 | "cube_att_sub_o_2.drc", 77 | "cube_att_sub_o_no_metadata.drc", 78 | "octagon_preserved.drc", 79 | "test_nm.obj.edgebreaker.cl10.2.2.drc", 80 | "test_nm.obj.edgebreaker.cl4.2.2.drc", 81 | "test_nm.obj.sequential.cl3.2.2.drc", 82 | })] 83 | public IEnumerator LoadDracoOfficialTestDataNormals(string url) { 84 | yield return RunTest(k_URLPrefix+url,true); 85 | } 86 | 87 | [UnityTest] 88 | [UseDracoTestFileCase(new[] { 89 | "bunny_gltf.drc", 90 | "car.drc", 91 | "cube_att.obj.edgebreaker.cl10.2.2.drc", 92 | "cube_att.obj.edgebreaker.cl4.2.2.drc", 93 | "cube_att.obj.sequential.cl3.2.2.drc", 94 | "cube_att_sub_o_2.drc", 95 | "cube_att_sub_o_no_metadata.drc", 96 | "octagon_preserved.drc", 97 | "test_nm.obj.edgebreaker.cl10.2.2.drc", 98 | "test_nm.obj.edgebreaker.cl4.2.2.drc", 99 | "test_nm.obj.sequential.cl3.2.2.drc", 100 | })] 101 | public IEnumerator LoadDracoOfficialTestDataNormalsTangents(string url) { 102 | yield return RunTest(k_URLPrefix+url,true, true); 103 | } 104 | 105 | IEnumerator RunTest(string url, bool requireNormals = false, bool requireTangents = false) { 106 | var webRequest = UnityWebRequest.Get(url); 107 | yield return webRequest.SendWebRequest(); 108 | if(!string.IsNullOrEmpty(webRequest.error)) { 109 | Debug.LogErrorFormat("Error loading {0}: {1}",url,webRequest.error); 110 | yield break; 111 | } 112 | 113 | var data = new NativeArray(webRequest.downloadHandler.data,Allocator.Persistent); 114 | 115 | var task = LoadBatch(1, data, requireNormals, requireTangents); 116 | while (!task.IsCompleted) { 117 | yield return null; 118 | } 119 | Assert.IsNull(task.Exception); 120 | data.Dispose(); 121 | } 122 | 123 | async Task LoadBatch(int quantity, NativeArray data, bool requireNormals = false, bool requireTangents = false) { 124 | 125 | var tasks = new List>(quantity); 126 | 127 | for (var i = 0; i < quantity; i++) 128 | { 129 | DracoMeshLoader dracoLoader = new DracoMeshLoader(); 130 | var task = dracoLoader.ConvertDracoMeshToUnity(data,requireNormals,requireTangents); 131 | tasks.Add(task); 132 | } 133 | 134 | while (tasks.Count > 0) { 135 | var task = await Task.WhenAny(tasks); 136 | tasks.Remove(task); 137 | var mesh = await task; 138 | if (mesh == null) { 139 | Debug.LogError("Loading mesh failed"); 140 | } 141 | else { 142 | if (requireNormals) { 143 | var normals = mesh.normals; 144 | Assert.Greater(normals.Length,0); 145 | } 146 | if (requireTangents) { 147 | var tangents = mesh.tangents; 148 | Assert.Greater(tangents.Length,0); 149 | } 150 | } 151 | } 152 | await Task.Yield(); 153 | } 154 | 155 | [UnityTest] 156 | public IEnumerator EncodePointCloud() { 157 | 158 | var sphereGo = GameObject.CreatePrimitive(PrimitiveType.Capsule); 159 | var sphere = sphereGo.GetComponent().sharedMesh; 160 | var vertices = sphere.vertices; 161 | 162 | var mesh = new Mesh { 163 | subMeshCount = 1 164 | }; 165 | mesh.SetSubMesh(0,new SubMeshDescriptor(0,0,MeshTopology.Points)); 166 | mesh.vertices = vertices; 167 | 168 | var task = Encoder.DracoEncoder.EncodeMesh(mesh); 169 | while (!task.IsCompleted) 170 | { 171 | yield return null; 172 | } 173 | 174 | var result = task.Result; 175 | Assert.NotNull(result); 176 | Assert.AreEqual(1, result.Length); 177 | Assert.AreEqual(2325, result[0].data.Length); 178 | 179 | result[0].Dispose(); 180 | } 181 | } 182 | } 183 | -------------------------------------------------------------------------------- /Tests/Runtime/DracoRuntimeTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77943783454d648fc96923ef87b68186 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tests/Runtime/UseDracoTestFileCaseAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2021 Andreas Atteneder 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | using System.IO; 19 | using NUnit.Framework; 20 | using NUnit.Framework.Interfaces; 21 | using NUnit.Framework.Internal; 22 | using NUnit.Framework.Internal.Builders; 23 | using UnityEngine; 24 | 25 | namespace Draco.Tests { 26 | 27 | public class UseDracoTestFileCaseAttribute : UnityEngine.TestTools.UnityTestAttribute, ITestBuilder { 28 | 29 | string[] m_sampleSet = null; 30 | 31 | NUnitTestCaseBuilder _builder = new NUnitTestCaseBuilder(); 32 | 33 | public UseDracoTestFileCaseAttribute(string[] sampleSetPath) { 34 | m_sampleSet = sampleSetPath; 35 | } 36 | 37 | IEnumerable ITestBuilder.BuildFrom(IMethodInfo method, Test suite) { 38 | List results = new List(); 39 | var nameCounts = new Dictionary(); 40 | 41 | if (m_sampleSet == null) { 42 | throw new Exception("SampleSet not set"); 43 | } 44 | 45 | try { 46 | foreach (var testCase in m_sampleSet) { 47 | var data = new TestCaseData(new object[] { testCase }); 48 | 49 | var uri = new Uri(testCase, UriKind.RelativeOrAbsolute); 50 | 51 | var origName = Path.GetFileName(testCase); 52 | string name; 53 | if (nameCounts.TryGetValue(origName, out int count)) { 54 | name = string.Format("{0}-{1}", origName, count); 55 | nameCounts[origName] = count + 1; 56 | } 57 | else { 58 | name = origName; 59 | nameCounts[origName] = 1; 60 | } 61 | 62 | data.SetName(name); 63 | data.ExpectedResult = new UnityEngine.Object(); 64 | data.HasExpectedResult = true; 65 | 66 | var test = this._builder.BuildTestMethod(method, suite, data); 67 | if (test.parms != null) 68 | test.parms.HasExpectedResult = false; 69 | 70 | test.Name = name; 71 | 72 | results.Add(test); 73 | } 74 | } 75 | catch (Exception ex) { 76 | Console.WriteLine("Failed to generate glTF testcases!"); 77 | Debug.LogException(ex); 78 | throw; 79 | } 80 | 81 | Console.WriteLine("Generated {0} glTF test cases.", results.Count); 82 | return results; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Tests/Runtime/UseDracoTestFileCaseAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03e43f82806a647b08ae440566db4f61 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.atteneder.draco", 3 | "version": "5.0.0-pre.1", 4 | "displayName": "Draco 3D Data Compression", 5 | "description": "Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics. This package allows you to apply Draco compression to meshes, import Draco files and load them at runtime.", 6 | "unity": "2021.2", 7 | "dependencies": { 8 | "com.unity.burst": "1.8.4" 9 | }, 10 | "keywords": [ 11 | "mesh", 12 | "transcode", 13 | "compress", 14 | "decompress", 15 | "encode", 16 | "decode", 17 | "google", 18 | "draco" 19 | ], 20 | "author": { 21 | "name": "Andreas Atteneder", 22 | "email": "andreas.atteneder@gmail.com", 23 | "url": "http://pixel.engineer" 24 | }, 25 | "type": "library" 26 | } 27 | -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24146ffe4d624425b9c084cf943965b9 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------