decentraland / unity-explorer

Apache License 2.0
9 stars 11 forks source link

Implement GTLF format #1019

Open m3taphysics opened 6 months ago

m3taphysics commented 6 months ago

Description

Unity has adopted glTFast (and hopefully) made some performance upgrades. https://docs.unity3d.com/Packages/com.unity.cloud.gltfast@5.2/manual/index.html

Solution

Originally it was discussed that we should only use gltFast in debug scenarios because of its background loading issues, but as stated in the documentation they do have some optimizations. This may be the same ones that already existed in the original fork. We must investigate the viability of implementing it and using it at runtime.

Unity glTFast uses [JsonUtility](https://docs.unity3d.com/ScriptReference/JsonUtility.html) for parsing, which has little overhead, is fast and memory-efficient (See https://docs.unity3d.com/Manual/JSONSerialization.html).

It also uses fast low-level memory copy methods, the [C# Job System](https://docs.unity3d.com/Manual/JobSystem.html), [Mathematics](https://docs.unity3d.com/Packages/com.unity.mathematics@1.0/manual/index.html), the [Burst compiler](https://docs.unity3d.com/Packages/com.unity.burst@1.6/manual/index.html) and the [Advanced Mesh API](https://docs.unity3d.com/ScriptReference/Mesh.html).
AlejandroAlvarezMelucciDCL commented 3 months ago

I completely forgot about this issue, sorry! An update: I researched the unity plugin, attender's and ours. Unity's is on par with attender's with no differences so far other than being on Unity's repository. Then I tried to use Unity's directly but we have several changes that doesn't make it straight forward to switch between plugins. I tried deleting everything in our repo and copying the latest from Unity cleanly and tried to re-apply our changes but it was a bit overwhelming, specially at the time when I just started learning about these systems. Then I tried to update our repository with the latest from Unity, but then again there were a lot of changes and I needed more time to properly change everything and make sure everything works as expected (AB Converter and Unity Explorer). Then I talked to Misha and suggested we keep using the plugin as we have so far, in order to prioritize the local development shape and maybe revisit this in another shape or hardening week where I can focus solely on this.

m3taphysics commented 2 months ago

This remains on the backlog for the possibility of using GLTF at runtime (no AB's)

AlejandroAlvarezMelucciDCL commented 2 months ago

@m3taphysics to put it properly , it's not "for the possibility of using GLTF at runtime (no AB's)" but rather "upgrade our gltfast plugin with latest from Unity/atteneder"