Search Unity

Beware of GLTF

Discussion in 'Asset Importing & Exporting' started by duleslash, Dec 3, 2019.

  1. duleslash

    duleslash

    Joined:
    Nov 15, 2013
    Posts:
    4
    Hi guys,
    I am Dusan Senior Unity Developer from Serbia with a decade of experience.
    I would like to share my frustration with you.

    My company decided to use GLTF since it is presented as a new standard for 3d model format.
    However, I believe that that's a lie.
    You will find the information that large companies like Ikea are using that format exclusively but its hardly true.

    You might try it your self and you can check official importer for Unity.
    First, you will find strange that someone implemented 2 projects in one, and you need to rebuild their libraries in other to make it work. That's, not the big deal, but it makes everything a bit harder.
    After that, you will realize that the plugin is made to work only with the models on the web, and if you try to load a local file model you will have to search the issues and find the hack you have to do yourself since you have to change plugin code to make it work with local files. But after that web solution is not working anymore.
    After that, you will realize that you still don't have the same look as on the web.
    Never the less, you will find issues with memory leak and other unsolvable problems.
    You will find other unofficial solutions that are easier to implement and they work a bit better but you will not make it work.
    Is that normal for the "new standard 3d model format"?

    After all of the tests have failed, I tried to find WHO is using GLTF and I haven't find any application that is not the web application that exclusively using GLTF.
    There are some apps that are able to open all model format including GLTF, but no application that is forced to work with the only GLTF like in my company.
    I hope that this will help someone who is thinking about it.


    I tried to find if Ikea Place is really a user of GLTF, but the model file is encrypted so I can't be sure.
    I contacted developers, but I am not sure that I will get their reply.
    I wanted to contact Khronos, maker of GLTF, however, I can't even find their email anywhere.

    I think it's safe to say that you should avoid GLTF format at least until it becomes stable (and I am not sure it will).
     
    Last edited: Dec 6, 2019
    ilmario likes this.
  2. duleslash

    duleslash

    Joined:
    Nov 15, 2013
    Posts:
    4
    I made a mistake.
    I didnt had enough knowlage to use it.
    I was working late and I was very angry at my teamates and my self.
     
    nyscersul, cbboyer, tkslan and 6 others like this.
  3. jipsen

    jipsen

    Joined:
    May 22, 2018
    Posts:
    37
    How did you solve your issue? I would like to work with glb/gltf files, but they make my app super huge. Way more than would have been expected. I had to revert to fbx for now, but it seems silly when glb/gltf are much smaller files than fbx.
     
  4. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    255
    I have been working on a GLTF importer for a while now. Just like you, I got frustrated with the "official" Khronos importer. So I took matters into my own hands and now I have a pretty solid importer. All you need to do is copy the files into your project and bam, gltf/glb files import the same way as FBX does.

    https://github.com/Siccity/GLTFUtility
     
  5. jipsen

    jipsen

    Joined:
    May 22, 2018
    Posts:
    37
    Thanks! I have used that too but whenever I build my project for android, my apk becomes super huge. Have you run into these issues?
     
    digitalmkt likes this.
  6. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    255
    No I have not. Try using the editor log to see what takes space.
    The GLTF file itself shouldn't take any space as it is converted to Unity's internal format, but GLTFUtility might import some items in a suboptimal way
     
  7. duleslash

    duleslash

    Joined:
    Nov 15, 2013
    Posts:
    4
    To be honest, I never managed to make it work.
    It was working fine in the example, but I had some problems with combination with arcore.
     
    jipsen likes this.
  8. sersol

    sersol

    Joined:
    Apr 7, 2020
    Posts:
    6
    Is there any update on this complaint? I have also been keeping an eye on GLTF. I tried all unofficial plugins to import GLTF to Unity but haven't had any fully successful attempt. I had important some assets partially losing several datasets along the process. Therefore at least to make it sure, I'll keep using fbx and alternatively dae for a while.
     
    phobos2077 likes this.
  9. jipsen

    jipsen

    Joined:
    May 22, 2018
    Posts:
    37
    Actually, a few weeks ago my company had an online meeting with some people from Unity and I complained about this. Those on the call didn't really know much about it and made it a point to pass it along to the development team. Not only GLTF but Alembic as well.
     
  10. duleslash

    duleslash

    Joined:
    Nov 15, 2013
    Posts:
    4
    To be honest, I wrote down the material exporter for Unity, so I can use all of the materials with the power of all shaders I want with any model format.
     
  11. sersol

    sersol

    Joined:
    Apr 7, 2020
    Posts:
    6
  12. Neogene

    Neogene

    Joined:
    Dec 29, 2010
    Posts:
    95
    I work with both unity and unreal; with unreal enabling the internal plugin works flawlessly (clicking on alembic icon button places assets in the level which is not supported simply importing a glb file fyi).

    We create assets in blender, then I export to glb and import into unreal and it keeps all the materials (hours of work save! thanks).

    Still waiting for official support from unity.
     
  13. john_goren

    john_goren

    Joined:
    Mar 19, 2021
    Posts:
    15
    This GLTF cry from the heart resonates with me, as I've been trying with no luck to import .glt files into my Unity project all weekend.

    The biggest issue for me is reuniting the textures with the object, which is naked like a soap carving. If I convert from Blender to .OBJ, does anyone know the best way to make sure the .mlt file points to my .PNG textures? I'm confused by the kd_map and ka_map options -- so many choices.
     
  14. mrSaig

    mrSaig

    Joined:
    Jan 14, 2010
    Posts:
    68
    Yes the state of GLTF with Unity is frustrating! since i see very good potential with the format it self like @Neogene described!

    Currently i had the best results with @Siccity s plugin ! Great work!! Really appreciate it!
    Still have some problems with it ... but importing a gtfl simultaniously with its textures gives me currenlty great results and i think i can make at least an MVP with this and then look further
     
  15. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
    Hi mrSaig! I'm using Siccity's GLTF plugin to load gitf file from web, it works well in Unity Editor, but when I build an iOS app on my phone, I can not load gilt models anymore. No errors displayed.
    And I already add plugin's shaders to Unity Graphic Settings(someone on the internet mention this will cause not-loaded situation).
    So, mrSaig, Could you please help me with following questions:
    How do you use it to load models from net(is there a sample code or some instruction)?
    Do you use Json.net and GLTF Utility to get them work?
     
  16. mrSaig

    mrSaig

    Joined:
    Jan 14, 2010
    Posts:
    68
    I Currently use it on a windows application not on mobile sry .. but with Siccity's GLTF plugin i had no isues with Newtonsofts Json
     
  17. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
    thank you still. And I already figure it out, the error is about shaders. I need to use custom Shader Variant Collections.
     
  18. jipsen

    jipsen

    Joined:
    May 22, 2018
    Posts:
    37
    I just wanted to update everyone on progress I have made. I highly recommend using Trilib.
     
    wmadwand likes this.
  19. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,269
    Unity really should support gltf2 as the benefits seem clearly pointed out in this article for the Godot engine:
    https://godotengine.org/article/we-should-all-use-gltf-20-export-3d-assets-game-engines

    Preferably both in-editor and at runtime.
    (the Trilib asset can import at runtime)

    Not used addressables, but asset bundles were a pain for cross-platform (1 for each) and an ever-evolving format. Using a common file format seems preferable, if a little slower.
     
    Siccity likes this.
  20. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    I've tried out Siccity's glTFUtility, and it was working great for me until I needed to get glTFs with separate bin and texture files loaded in WebGL. I just couldn't get it to work without having to dig in and fix a few things (One thing to note, if running the editor, you can't refer to files in the StreamingAssets folder, for a number of reasons, but I needed to work around that). I've run across Unity users integrating glTFast, so I decided to give that a try. After a few misunderstandings, I got it working great. Again, I'm using 2020 LTS, glTF with separate bin/textures, in WebGL, because all of those targets may matter for what you're doing.

    I will say that I prefer the glTFUtility API more than the glTFast API, but I can't complain if glTFast *just works*. Support and maintenence is up-to-date. @atteneder just helped me yesterday with an installation issue, and while Siccity's support was great, I believe he's moved on to other projects, and it's been over a year since the last update.

    I've read somewhere that glTFast official Unity integration is looming, but I don't know if this was just speculation.

    @jipsen I've noticed when switching from glTFUtility to glTFast, that my build size and build times got significantly larger as well. I haven't investigated what caused this, but I would believe this is related to the shader variant compilation. Eventually, I'd like to simplify my shaders to make my project lightweight, but until then, I'm sticking with whatever was default. I know it's not your issue per se, but it's something to look out for.
     
  21. gregoire_unity128

    gregoire_unity128

    Joined:
    Jan 18, 2021
    Posts:
    11
    Hello,
    I encountered the same problems as you with the khonos plugin.
    A bit disapointed, but the unity package to import and export fbx isn't better.(the import script is officialy tagged "wip").

    Except write your own plugin either based on FBX or GLTF there is no easy solution.
     
  22. paxron

    paxron

    Joined:
    Aug 22, 2014
    Posts:
    8
    The initial build time on a project using glTFUtility is many hours because of the huge amount of shader variants, using HDRP
     
  23. congxin210

    congxin210

    Joined:
    May 5, 2022
    Posts:
    2
    I think it's only Unity that is not following the modern and should become standard (IMO) format.
     
    jipsen likes this.