Releases: atteneder/glTFast
Releases · atteneder/glTFast
Release list
glTFast 6.20.0
Added
- IInstantiator.AddMesh and IInstantiator.AddMeshInstanced, replacing the
Primitivenaming. LogCode.AnimationComponentFail- SaveToFileAndDispose and SaveToStreamAndDispose overloads with
forceSyncparameter to enforce synchronous I/O. Recommended when exporting from Editor scripts (menu items, inspectors, post-processors), where the main-threadSynchronizationContextis not pumped in Edit Mode and awaited I/O continuations may never resume. - IInstantiator.CreateNode overload that receives the node's name, so instantiators no longer need a separate naming call. It has a default implementation that routes to the previous
CreateNodeandSetNodeName, so existing implementations keep working unchanged. GameObjectInstantiator andEntityInstantiatorimplement it as a virtual method.
Changed
- (Performance) Internal mesh export, buffer view and image data methods return
ValueTaskinstead ofTask, which removes an allocation per vertex stream and per index buffer when exporting a readable mesh. - Moved documentation code examples from
DocExamplesintoRuntime/DocExamplesto comply with package assembly layout requirements. - Clarified IDeferAgent.ShouldDefer documentation to note that it must eventually return
false, otherwise imports may stall indefinitely without raising an error. - Removed legacy .NET Framework fallback code paths (
#if NET_STANDARD/#if NET_STANDARD_2_1). They were only needed for Unity versions prior to 2021.2, which are no longer supported (minimum is now Unity 6.0 LTS). - Bumped
com.unity.collectionsto 2.6.8 andcom.unity.burstto 1.8.30, the versions recommended for Unity 6000.0. - (Documentation) Improved installation instructions.
- (Test) Updated tests dependency Graphics Test Framework (com.unity.testframework.graphics) to 9.0.0-pre.25.
- (Test) Graphics tests generate their test cases via the Graphics Test Framework, so reference images are resolved by the framework (including per-platform overrides) and failures are inspectable in the Graphics Tests window. The per-view test methods collapsed into a single parameterized one.
- (Import) (Performance) The Editor's glTF importer reads glTF, buffer and image files straight into native memory via AsyncReadManager. It previously read each file into a managed
byte[]that stayed pinned for the duration of the import.
Fixed
- Corrected invalid
crefreferences in XML documentation comments (parameters, type parameters and a stale method reference) that produced warnings during documentation generation. - Fixed false positives in export to stream tests because it actually validated results from non-stream tests.
- Prevent exception when Animation component was not created successfully.
- Removed useless
SerializeFieldAttributefromMaterialsVariantsComponent.Controlto avoid compiler warning in Unity 6.6 and newer. - Removed usage of obsolete
FindObjectsByTypeoverloads. - (Test) Avoid
Animationcomponent conflict by accidentally loading glTF twice inDocExamplesTest. - IsTextureYFlipped returns correct value when multiple textures reference one image.
- (Export) Exceptions thrown during synchronous mesh export (
BakeMesh/BakeMeshDraco) are now surfaced instead of being silently swallowed by unobserved tasks. - (Documentation) Updated the features' animation section to reflect that Playables support was removed and to list animation import into custom animation systems via add-ons.
- (Performance) Removed unnecessary texture file read during Editor imports.
Deprecated
IInstantiator.CreateNodewithout anameparameter andIInstantiator.SetNodeName. Implement the CreateNode overload that receives the name instead. Both remain functional.IInstantiator.AddPrimitiveandIInstantiator.AddPrimitiveInstanced, including theirGameObjectInstantiator,GameObjectBoundsInstantiatorandEntityInstantiatorimplementations. Call IInstantiator.AddMesh and IInstantiator.AddMeshInstanced through anIInstantiatorreference instead.
glTFast 7.0.0-exp.1
Added
- IGltfBufferData, read access to a glTF asset's buffer view and accessor data, acquired via GltfImport.LeaseBufferData. It is also a lease: the import keeps its buffer memory alive until every lease is disposed, so data can be read past the end of loading. Results are reported as BufferAccessStatus rather than thrown or silently defaulted. Data is provided in glTF's own coordinate system and value range.
- IBufferDataConsumer, an import add-on hook that runs once every buffer is loaded and decoded. It receives an IGltfBufferData and can abort the import.
- ReadOnlyNativeStridedArray<T> is public (was internal). It is a read-only, Burst job compatible view into strided (interleaved) data and gained
Length,ByteStrideandIsCreated. - LogCode
BufferDataForceDisposed, reported when a GltfImport is disposed while buffer data leases are still open. - LogCode
BufferViewAccessFailed, reported when a buffer view's data cannot be provided during import, for example because the glTF's offsets or lengths place it outside its buffer. - Support for high precision node transforms.
EnumOrRawValue<TEnum>for serialization of JSON strings to enum values that can have values unknown at build time.- MeshoptFilter and MeshoptMode for custom JSON serialization of
Meshoptimizer.FilterandMeshoptimizer.Mode. UriValue, a wrapper for serialization of URIs.- LogCode
RequiredPropertyMissingandIndexOutOfRange, which distinguish an absent glTF property from an index that does not address an existing element. - Color and ColorAlpha structs for serialization of glTF color values.
- ImageMimeType for type-safe access to glTF image MIME types.
- Attributes: Additional vertex attribute accessor properties are (de-)serialized from/to JSON.
TEXCOORD_nforn ≥ 8COLOR_nforn ≥ 1JOINTS_n/WEIGHTS_nforn ≥ 1(required for multi-influence skinning)- Application-specific attribute semantics (starting with underscore
_)
- Root.Serialize(Stream) for JSON serialization via
System.Text.Jsonwithout requiring callers to reach forJsonSerializer/GltfJsonContextdirectly. - NullLogger, a no-op
ICodeLogger. - Shared
ConsoleLogger.InstanceandNullLogger.Instancesingletons. - (Export) MaterialExport.TryAddImageExport is public (was internal
MaterialExport.AddImageExport). - Typed access to additional JSON properties — properties present in the JSON that have no matching typed member (e.g. fields from a newer, unsupported glTF version).
- IReadOnlyPropertyContainer provides read-only access to additional properties on glTF extension or extras objects: lookup and enumeration (
Count,ContainsKey,Keys, indexer,foreach,TryGetValue). - IPropertyContainer extends it with write access:
Set(generic andstring/long/double/booloverloads),RemoveandClear. Values are serialized to JSON on assignment, so custom extras and extensions can be authored for export. - ReadOnlyProperties, an allocation-free
readonly ref structreturned byAdditionalProperties, provides a read-only view into additional properties. - AdditionalPropertyContainer, the read-write base class for extension and extras objects (e.g. MaterialExtensions), implements IPropertyContainer.
- glTF objects (e.g. Accessor, Material, Node) expose their additional properties read-only via an
AdditionalPropertiesproperty. - Untyped traversal of arbitrary JSON: Value (an allocation-free
readonly ref structview over a single JSON value), ValueKind and Property (a key/value pair).
- IReadOnlyPropertyContainer provides read-only access to additional properties on glTF extension or extras objects: lookup and enumeration (
- ExtrasContainer, the type of every glTF object's
Extrasproperty, derived from AdditionalPropertyContainer. The glTF specification allowsextrasto be any JSON value, not just an object. ItsKindreports the ValueKind the JSON carried andRawValueprovides that value as a Value when it is not an object.MeshExtrasderives from it. - Value.TryGetValue<T>(out T) is public, for de-serializing a whole JSON value (e.g. a non-object
extras) into a user type. - Every glTF object's
Extensionsproperty has a dedicated container type derived from AdditionalPropertyContainer (AccessorExtensions,AccessorSparseExtensions,AccessorSparseIndicesExtensions,AccessorSparseValuesExtensions,AnimationExtensions,AnimationChannelExtensions,AnimationChannelTargetExtensions,AnimationSamplerExtensions,AssetExtensions,BufferExtensions,CameraExtensions,CameraOrthographicExtensions,CameraPerspectiveExtensions,ImageExtensions,MeshExtensions,PbrMetallicRoughnessExtensions,SamplerExtensions,SceneExtensions,SkinExtensions), matching the existingMaterialExtensions,NodeExtensionsandRootExtensions. They are empty, so extension access is unchanged (TryGetValue/Set), but future support for a glTF extension on any object can add a typed property without changing the property's type. protected virtual void SetFallbackNodeName(uint, string)on GameObjectInstantiator and EntityInstantiator, the override point for naming a node the glTF left unnamed, alongsideprotected ApplyMeshNameFallback(uint, MeshResult)for an implementation that replaces the mesh-add methods. Replaces the removed overridableSetNodeName, and runs only withNameImportMethod.Original, sinceOriginalUniquealready supplies every node a name.
Changed
- Renamed all assemblies and the root namespace from
glTFast/GLTFast.*toUnity.Cloud.Gltfast/Unity.Cloud.Gltfast.*to follow the .NET Framework Design and Unity assembly naming guidelines. Most public types carry[MovedFrom]attributes, so the API Updater rewritesusingdirectives and type references in consuming C# automatically. Types that were renamed as well as moved (see the Upgrade Guide) carry none, so references to those need a manual rename. Assembly definition (.asmdef) references to the old assembly names must be updated manually too (see the Upgrade Guide). - Renamed the
Schemanamespace toObjects, soGLTFast.SchemabecameUnity.Cloud.Gltfast.Objects(notUnity.Cloud.Gltfast.Schema). These types are glTF objects, the glTF specification's own term for them, and not a JSON Schema, which glTFast does not use. Migration from 6.x is automatic, except for the types that were also renamed (see the Upgrade Guide). Unity.Cloud.Gltfast.Dotsis no longer auto-referenced. Assemblies using the DOTS import API have to reference it explicitly. Code in predefined assemblies (e.g.Assembly-CSharp) needs to be moved into an assembly definition that references it.- Asynchronous (
Task-returning) methods were renamed to end inAsync(see the upgrade guide). Calls to the renamed class methods are rewritten by the API Updater; interface members, and members you override or implement yourself, need a manual rename. IInstantiator.AddPrimitiveandAddPrimitiveInstancedwere renamed to AddMesh and AddMeshInstanced (see the upgrade guide). Calls typed to a concrete instantiator are rewritten by the API Updater; the interface members, and members you override or implement yourself, need a manual rename.- Public entry points accepting an ICodeLogger now default to Unity's Console when
nullis passed (was silent). - JSON serialization and de-serialization are performed by System.Text.Json (or
Unity.Cloud.Gltfast.Text.Json, a copy of it to avoid assembly conflicts).- (Export) Replaced the hand-written
JsonWriter/Root.GltfSerializewriters withJsonSerializer.Serializedriven by the source-generatedGltfJsonContext. Exported JSON is functionally equivalent but not byte-identical to previous releases. - Refacto...
- (Export) Replaced the hand-written
glTFast 6.19.0
Added
- (Add-Ons) Import glTF animations to custom animation systems.
- IAnimationProcessor — animation clips conversion
- IAnimationProcessorFactory — add-ons need to implement this
- (Add-Ons) Lifetime management of converted glTF data and application during scene instantiation. Is used for custom animation import only for now.
- IDataInstanceApplierFactory — owns converted data and forwards it to scene instantiation
- IDataCache
- IInstanceApplierFactory
- IInstanceApplier — applies data on scene instance
- IDataInstanceApplierFactory — owns converted data and forwards it to scene instantiation
- IGltfAccessors provides read-only access to typed glTF accessor data.
- INodeHierarchyInfo provides glTF node hierarchy information.
- (Test) Inspector materials variant selection for
OpenGltfDialog. - Instructions/guidelines for coding agents (
AGENTS.md/CLAUDE.md)
Changed
- Increased minimum required Unity version to 6.0 LTS.
- Bumped dependency versions
- com.unity.burst to 1.8.29
- com.unity.collections to 2.6.6
- com.unity.mathematics to 1.3.3
- GameObjectSceneInstance's AddCamera, AddLight and SetLegacyAnimation are now public, so custom IInstantiators can utilize it.
- Refactored ImportAddonInstanceCollection to derive directly from
List/QueryableList. - (Performance) Importing animation curves got much faster and requires less managed memory. Keyframes are prepared in native arrays and set en bloc via SetKeys(ReadOnlySpan<Keyframe>) instead of being slowly added individually (thanks jverral for initiating this via #44).
- (Performance) Reduced memory waste by using cached, static identifiers instead of inner-loop format strings for AnimationClip.SetCurve's
propertyNameparameter (thanks jverral for #44). - Enabled Render Graph in graphics settings by default on all projects (not using compatibility mode anymore).
- (Test) Compatibility mode is still enabled for Unity 6.0 tests.
Fixed
- Improved comma placement in export summary (thanks anonymous for #46).
- Materials variants' inspector shows correct variant when regaining focus (thanks anonymous2585 for #48).
- (Import) Fixed merging of mesh primitives with shared vertex buffer, but different indices type.
glTFast 6.18.0
Added
- (Add-Ons) IPostJsonDeserialization for intercepting the loading process right after glTF JSON deserialization.
- (Test) Model SubMeshIncompatible, which features animated morph targets and primitives of incompatible vertex buffer structures.
Fixed
- (Shader) Back-face normals are now correctly flipped in URP (fixes #38).
- (Import) Textures are named after the corresponding glTF image again to ensure consistency with previous imports (reverts a change introduced in 6.17.0).
- (Import) Log error instead of throwing exception when failing to download a texture with a relative URI when a base URI is not provided.
glTFast 6.17.0
Added
- Texture loading is fully customizable via Add-Ons.
- Inject support for glTF texture extensions (see ITextureImageLoader).
- Customize PNG and Jpeg loading (see IDefaultImageFormatLoader).
- See ImageAddonTest scene in the tests package which use the AddOnsImage samples from the
DocExamplesdirectory.
- Explicit error message when unsupported image format WebP is detected (LogCode.ImageFormatUnsupported).
- ImageResult which depicts an imported glTF image.
- (Test) TextureVariants test glTFs with WebP image format.
- Extension.TextureWebP (no general WebP support, just for handling WebP cases).
Changed
- (Add-Ons) GltfImport now accepts multiple import add-on instances of the same type.
- GetImportAddonInstance returns the first instance that matches the type.
- Ensured compatibility with Fast Enter Play Mode.
- Image type detection is based on content (instead of mime-type depicted in glTF JSON, data URI mediatype or file extension).
- Improved error message when image format is detected, but not supported (e.g. WebP).
Fixed
- (Import) AnisotropicFilterLevel setting is applied to KTX textures as well.
- (Import) Leak of textures in case of loading errors.
- (Export) Meshes with zero vertices or indices will now be skipped and an error will be logged instead of an exception being thrown (fixes #806).
glTFast 6.16.1
Added
- (Test) Empty Scene test asset.
- (Import) Support for 16-bit mesh indices reduces memory footprint for meshes with less than 65k vertices per sub-mesh.
- 16-bit indices are not converted to 32-bit anymore.
- 8-bit indices ar converted to 16-bit (instead of 32-bit).
Changed
- GltfImport.Load, GltfImport.InstantiateSceneAsync and their variants now throw an
OperationCanceledExceptionwhen cancelled before completion. - Replaced the generic StandardMaterialExport with specializations.
- LitMaterialExport for Universal Render Pipeline Lit shader material export.
- BuiltInStandardMaterialExport for Built-in Render Pipeline Standard shader material export.
- (Performance) Improved performance of mesh indices conversion for draw modes line loop, triangle strips and triangle fan.
Fixed
- GltfImport.InstantiateSceneAsync properly handles an invalid scene index parameter.
- GltfImport waits for downloads to complete before attempting disposal during cancellation.
- Projects depending on an outdated version of [meshoptimizer mesh compression for Unity] may suppress the corresponding compiler error by using the
GLTFAST_IGNORE_MESHOPT_OUTDATED_ERRORscripting define symbol. - (Shader) Incorrect alpha blending/clipping due to invalid color space conversion on the base color map alpha and vertex color alpha values (affected shader graphs only; fixes #800).
- (Shader) Built-in render pipeline shaders metallic-roughness and specular-glossiness now factor in vertex color alpha values.
- (Shader) All built-in render pipeline shaders apply vertex color alpha values linearly.
- (Shader) Shader graph glTF-pbrSpecularGlossiness does not disregard the Glossiness parameter anymore.
- (Import) Cases when specular-glossiness material setup would be incomplete at runtime.
- (Import) Removed remains of incorrectly signed integer indices.
- (Export) Smoothness value property is exported correctly across more combination of settings for Universal Render Pipeline Lit shader based materials (fixes #795 and 796).
- (Export) When a Lit/Standard material has a smoothness texture, their smoothness value is baked into the resulting roughness channel (of the ORM map). This preserves the visual appearance, but is a lossy operation if the smoothness value is not
1.0(fixes #795 and 796). - (Export)
MetaMaterialExportBuiltInis used for built-in material export (unlessGLTFAST_BUILTIN_SHADER_GRAPHis set). - (Import) Solved exception when scenes with no nodes are loaded.
- (Import) Triangle fan meshes with the center vertex not being the first vertex import correctly now.
- (Test) Graphics tests are more stable/consistent due to dedicated scene.
- (Shader) Incorrect normal unpacking when using default normal map on Android (fixes #791 and 802).
- (Export) Texture scaling not preserved on URP/Lit export (fixes #805).
Deprecated
- Generic built-in/Universal render pipeline StandardMaterialExport.
glTFast 6.16.0
Added
- GltfAsset property setters to allow change of behavior from script.
- PlayAutomatically.
- SceneId.
- HDRP material validation (fixes #561).
- Various overridable shader loading methods to MaterialGenerator-based classes so users can customize shader lookup. This is useful when working with Addressables (fixes #715).
- MaterialGenerator.FindShader for generic, runtime shader resolution.
- BuiltInMaterialGenerator.FindShaderMetallicRoughness.
- BuiltInMaterialGenerator.FindShaderSpecularGlossiness.
- BuiltInMaterialGenerator.FindShaderUnlit.
- ShaderGraphMaterialGenerator.LoadShaderByName.
Fixed
- Emission color (emissiveFactor) is now in correct color space for shader graphs and built-in shaders.
- Normal map scale on shader graphs.
- (Export) Avoid creating empty ORM textures if no smoothness texture is assigned (fixes #801).
Deprecated
- Access to glTF images via IGltfReadable.ImageCount and IGltfReadable.GetImage. This has not been used internally and was unreliable. Please access glTF textures instead (see TextureCount and GetTexture).
glTFast 6.15.1
Added
- Assigned glTF logo to GltfEntityAsset component.
- (Test) Test glTF asset CylinderWithMaterial that's procedurally generated at runtime.
- (Test) Tests for documentation examples.
- (Test)
OpenGltfSceneimprovements.- Refactored to use custom load method.
- Load method option to choose between loading from file or URI.
- Scene index option.
- Informative console logs with file path/URI and load time.
- Now works at runtime as well (without file dialog).
- Re-positions camera so that the loaded glTF scene is framed.
- Can load via EntityInstantiator.
Changed
- (Entities) Entities of a scene are grouped via
LinkedEntityGroup. - (Performance) Import mesh indices as unsigned integers and don't convert to signed integers anymore.
- (Performance) Limited copy buffer size, so that garbage allocations do not scale with glTF-Binary content size anymore (when loading from file or
Stream). - (Performance) Large glTF-Binary content is now loaded into memory in smaller chunks, which keeps the frame rate smooth (when loading from file or
Stream). - (Performance) Shift loading glTF-Binary from stream to memory to a background thread, if it won't likely fit within the current update loop.
- (Performance) glTF-Binary buffers are not initialized with zeros before population.
- [meshoptimizer mesh compression for Unity] minimum required version was raised to 0.2.0-exp.1.
- (Test) Updated tests dependency Graphics Test Framework (com.unity.testframework.graphics) to 8.13.1-exp.1.
Fixed
- Returning a proper error for glTF-Binary with a content length shorter than what's depicted in the header.
- NotSupportedException when loading a glTF-Binary file with excess length (fixes #786).
- (Documentation) Clarified how to add export shader variants.
- (Test) Fixed generated test glTFs by exporting them in synchronous mode (only available internally).
- (Importer) Synchronization Context is now properly reset after an exception (thanks @bruno1308 for #29).
- Removed compiler warning when
GLTFAST_SAFEscripting define is active. - (Test) Stabilize tests by executing
LogAssert.Expectbefore actual tests. - (Entities) Sub-meshes are rendered properly.
- (Test) Tests destroy the glTF entities before disposing meshes/materials to avoid batch rendering errors.
glTFast 6.15.0
Added
- Loading KTX textures from data URIs.
- (Test) OpenGltfScene: Shortcut Control+X clears the previously loaded glTF. Useful for testing resource deallocation.
- (Test) Assets variants of SubMesh and Rainbow Cuboid for testing import of compressed/uncompressed multi-primitive meshes.
- (Test) glTFs with different kinds of image formats and sources.
- (Test) No Normal test asset.
Changed
- glTFast will return a success value of
trueeven if an image fails to load (which has not been consistent across the API before). This makes it easier to display assets despite of non-critical loading errors. Users who need stricter behavior can resort to monitoring for error logs (see the runtime import manual about logging or theloggerparameter of GltfImport constructor). - Primitives of a Draco compressed mesh will be decoded into in a single Unity mesh with multiple sub-meshes instead of multiple Unity meshes (thanks Kibsgaard for initiating this in #33).
- Draco for Unity minimum required version was raised to 5.4.0.
- (Performance) Texture data is not copied into managed memory before loading via Texture2D.LoadImage (applies for Unity 6.0 or newer).
- (Performance) Avoid copy of entire data URI string by using
ReadOnlySpaninstead sub-stringing. - (Performance) Base64-encoded data URIs are now decoded into NativeArray<byte> instead of
byte[], reducing GC allocations. - KTX for Unity minimum required version was raised to 3.6.0.
- Up-to-date versions of soft-dependencies KTX for Unity or Draco for Unity are enforced by raising a compiler error if an outdated version of either of those is installed.
Fixed
- Corrected test cases for
GltfTestModelsimporter tests. - Properly dispose GPU instancing buffers after Editor imports.
- Multi-primitive, skinned meshes import properly to Unity meshes with multiple sub-meshes.
- For Draco compressed meshes, it's now ensured that morph targets are retrieved to completion and resources are disposed properly.
- Sampler settings conflicts result in a proper warning message if they cannot be resolved by instantiating the Texture2D (can occur on design-time imports).
- Implicitly add normals to the vertex attribute layout if tangents are required (fixes #41).
- Properly release native resources bound by morph targets jobs in context of decoding Draco compressed meshes.
- Avoid pointless copying of glb-embedded textures if ImageConversion module is disabled anyways.
- Avoid download of textures if ImageConversion module is disabled anyways.
- Gracefully fail when buffer data URI has incorrect media-type field or undersized content length.
- Just like PNG or Jpeg, KTX textures are now loaded readable as well if it's required by the import settings, the platform or for applying multiple sampler settings.
- Properly abort if loading of a data URI encoded image failed.
- Don't crash when a buffer failed to load when loading from
string,bytearrays orStream. - Return value of GltfImport loading methods (Load, LoadFile, LoadGltfBinary, LoadGltfBinary and LoadStream) has been made consistent.
- (Documentation) various broken links fixed.
glTFast 6.14.1
Changed
GLTFast.Schema.Attributes.TryGetAllUVAccessorsonly returns the first 8, actually supported UV sets (and not the ninth anymore).
Fixed
- Avoid crash when loading meshes with more than 8 texture coordinate sets by properly limiting them.