Search Unity

Unity support for the glTF format by default (to replace Collada and FBX)

Discussion in 'General Discussion' started by Linkooo, Oct 8, 2017.

  1. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    GLTF is better and more compact with more options to embed more things.
    FBX is good but it's best to support a modern exchange format.

    I hope Unity is already working on good Glft support and will bring it in some of the next releases.
     
    Last edited: Aug 6, 2019
  2. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
  3. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    255
    It's barely useable.
    It fails on most of the models in the sample models repo, both glb and gltf, and the release plugin hasn't been updated for several months and it takes a programmer to recompile it. Most of the unofficial plugins are better, this one for example https://github.com/ousttrue/UniGLTF, but none of them are perfect
     
  4. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Sketchfab somehow pretends it's 100% compatible with Unity.

    https://sketchfab.com/features/gltf

    There's even a model posted by Unity Technologies itself right there.
    I've just a bought a model from sketchfab, let's see if 2019.2.1f1 imports it correctly, and natively
    (will be editing in minutes)
     
  5. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Probably after all BIM only Autodesk Roundtripping projects like
    https://unity.com/partners/autodesk
    are done we see bigger moves in glTF integration.
    A paralel development seems not possible.
     
  6. DavidKretschek

    DavidKretschek

    Joined:
    Feb 13, 2017
    Posts:
    1
    Any news on the subject?

    SolidWorks is one of the most used 3d modelling and computer aided design software in mechanical engineering industry and with its 2019 release they've finally announced some integration with XR applications. One way they're doing it is through a .glft and .glb exporter and as announced in their "whats new in SolidWorks 2019" : "You can: Import these files into platforms such as Unity or Unreal to create experiences". When I red it I became very excited and went straight to try it out, cause that's something I was really looking forward. Well it seems like SolidWorks 2019, can really export .gltf files, but as I tried to import them into Unity, nope. Nothing. I don't know what happened, if solidworks marketing dudes dropped the ball or if Unity's. But the thing is, Unity is loosing a great audience for their software, many of the mechanical engineers going for the XR thing and they're a lot and engineering companies have lots of money.

    I'm not using the latest Unity version although, for the vulforia thing has not worked. I'll try the things you mentioned so far. Thanks for the discussion, it helped.
     
    phobos2077 likes this.
  7. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,160
    There's no news on the subject because gltf just... isn't there yet. There's too many issues with it as a format, which is why so few pieces of software actually support it, and the ones that support it don't really support the whole format.

    GLTF just really isn't mature enough at this point in both terms of overall support or functionality in existing support.
     
  8. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    255
    I don't know what went wrong with the marketing team. Unity is really slacking on their GLTF game, while everybody else (who don't have personal stakes in .fbx) seem to be jumping the wagon. Facebook, Sketchfab, UE4, Godot, Blender- and apparently now SolidWorks as well - these are some of the big players who now officially can import/export GLTF. I hope Unity will pick it up soon but it seems they are more interested in their partnership with Autodesk.

    I can tell by the activity of my GLTF plugin that there definitely is an increasing interest for the format. It's the way forward.
     
    paul-velocity and phobos2077 like this.
  9. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    Have you actually used GLTF in production for a commercially succesful application or game though?

    We have and its awful.

    Its a great idea but the tech is not there yet, needs at least another year to get rid of the major issues with it before its really usable and thats why so many people only have very shallow support for it.

    All the programs you mentioned can import it etc, but have you actually tried using GLTF in those? We do and its not what is hyped to be, not yet anyway. The support is very shallow right now in most programs that do support it, and for good reason. Nobody wants to spend time on it while its still in flux.
     
    phobos2077 and Blarp like this.
  10. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    255
    I have not used it in production no, mainly because I work in Unity and Unity does not support it at all yet. That is why this thread exists in the first place. If a full featured importer/exporter were to exist for Unity, maybe you wouldn't have had such a bad experience.

    Which 'major issues' are you referring to? And are you sure these are with the format and not the implementation?

    And what do you mean the 'tech is not there yet'? Writing an importer for GLTF is not very hard. The specification is crystal clear and support on their GitHub page is fast. The reason why support is growing at such a slow pace is because it is opensource, and beyond the blender foundation, nobody gets paid to work on opensource projects.

    That's the thing. GLTF will continue to be in flux until enough people have spent enough time on it. Changing to an opensource standard is an extremely challenging process that depends on a lot of people to plough through on their free time to raise support before it can even begin to gain widespread traction.
     
    phobos2077 likes this.
  11. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    Well I use it outside of unity for Direct X applications, and in some other engines. Mostly its just that almost every program that "supports" it has problems importing all the data from a GLTF file without issue. In particular materials are a real pain, with their weird semi PBR support not really working in a lot of cases.

    The problems are with the format, not what its used in. The same problems exist in all engines and programs I have used it with. A lot of people are reluctant to double down on GLTF because of bugs and issues encountered when using the format.

    I do agree that if a decent importer existed I would be using it as its a great file type in terms of file size. However, because of how much it changes month to month, I still dont think a decent importer will exist for some time as the moment you finish writing it you will need to rewrite it.

    Please dont take my comment as not being interested in GLTF. I really want this format to suceed and I hate FBX with a passion. I just think it wont be usable in a production environment for another few years unless it gets more support, but I think that support wont come from places like here but from those that contribute more to kronos group repositories etc - which tends to not be unity community.

    Also you can import it right now into unity using trilib ;)

    https://assetstore.unity.com/packages/tools/modeling/trilib-model-loader-package-91777

    Its a bit buggy now due to changes in 2018-2019 and spec changes but it always gets updated and usually works. I suspect within a month it will again be mostly bug free.

    Its built on top of a opensource importer which can easily be wrapped up yourself though! (For anyone reading who is interested but doesnt want to fork out cash for what is basically a wrapper)

    I agree that it is the future, and will provide a lot of performance benefits once it is standardised across the industry.
     
    NotaNaN and phobos2077 like this.
  12. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    270
    Anyone doing gltf asset streaming at runtime on mobile yet
     
  13. LiamBlack

    LiamBlack

    Joined:
    Oct 4, 2019
    Posts:
    3
    How many links, now I have to understand half a day. Thanks for the information :)
     
  14. tteneder

    tteneder

    Unity Technologies

    Joined:
    Feb 22, 2011
    Posts:
    175
    Having written a Unity glTF importer myself ( glTFast ) I do understand the frustration of early adopters.

    Many of the tools/importers/exporters out there that claim to support glTF do it poorly
    • missing features
    • incorrect implementation
    • poor performance
    • huge build overhead (ever tried UnityGLTF on WebGL?)
    What's missing from a developer-perspective is transparency. There's an official glTF validator as well as an official sample file repository. Needless to say, all projects(importers,exporters) should adhere to the specification and load all of those items without errors. And if they don't, they should be transparent about it to avoid confusion and dissapointment.

    I didn't do this in the past, but caught up after I realized this. That being said,I'm happy to announce that glTFast is now able to load all sample objects. Every feature missing (notably animation), is documented as such.

    glTF is a good choice of engine-agnostic, common features, but it's not perfect. For example I think it's a shame that texture transform was not in the 2.0 spec (it's an extension) and don't get me started about using Jpeg/PNG as image formats. Like, does your exporter optimize the PNGs before packing them into glTF? Afaik Blender's doesn't.

    At the same time glTF evolves and new extensions are added. Most notably the KTX2 support with Basis Universal compressed textures. This will be a game changer for glTF users that have performance in mind. I've already have a prototype working and I'm looking forward to support this.

    And if Unity ever commits to glTF and provides a good package for it, I'll gladly applaude them and drop mine :)
     
  15. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    phobos2077, arumiat and noemis like this.
  16. lizzl

    lizzl

    Joined:
    Nov 15, 2019
    Posts:
    3
    I like the simplicity of glTF, have been testing https://github.com/KhronosGroup/UnityGLTF and most of the model seems to be working okay, but certain models with animations that work in gltf-viewer is failing here.
    My team is very keen in knowing if Unity will support glTF format?
     
    phobos2077 and arumiat like this.
  17. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    350
    Any news on this? It looks like glTF is the definitive file format for game models, Unreal and Blender both have official plugins for import/export. Unity is lagging behind... again.
     
    xCyborg, keeponshading and JesOb like this.
  18. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,344
    phobos2077 likes this.
  19. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    350
    Yes! This is exactly what I wanted to see!!! I wish threads like this would make such turns more often :)

    I only hope he'll work on full gltf import implementation, and not just this lib. Because AFAIK it only supports runtime loading from URL. I want a normal importer to use for ALL my 3D work.
     
    tteneder and JesOb like this.
  20. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    270
    If you give a mouse GLTF, they will want USDZ next.
     
  21. tteneder

    tteneder

    Unity Technologies

    Joined:
    Feb 22, 2011
    Posts:
    175
    @_geo__ Hi mate! I continued to use my private forum account. Let's see if i can get this fancy black badge :)

    Although my focus initially remains on runtime loading, full editor import/export is planned!

    Until then, try UnityGLTF for import. The fork by @hybridherbst should be even better
    https://github.com/prefrontalcortex/UnityGLTF
     
    NotaNaN, JesOb and phobos2077 like this.
  22. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    633
    Nice, is there going to be a preview package soon or it will be directly embedded in the editor?
     
    phobos2077 and JesOb like this.
  23. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    GLTF, to me, is where models go to die. Once they're in this format, you can't get them out if you want to make changes. There are a few online converters, but they're all pretty bad. Blender supposedly can import them, but few other DCC tools I've tried can, and even Blender doesn't do a good job on many of the models I've tried. For example, here's an animated octopus I found in the Windows 3D Viewer Online Library (which can only be saved in GLB):

    Screenshot 2021-03-25 190846.jpg

    And here's the same thing after importing it into Blender - don't mind the dress:

    Screenshot 2021-03-25 191000.jpg

    Khronos brags about all the converters that are available for software like 3ds Max and Maya, but when you look, most are just exporters - nothing that will let you import and make changes to models you find on sites like Sketchfab. All of the 3rd party converters I've tried so far either don't support animation, lose the materials, mess up the model in some other way, or don't work at all.

    It looks like this format is great for publishing 3d clipart - letting unskilled users paste them into web pages like emojis, but it's pretty useless for distributing models for games or other media at the moment. FBX and OBJ, for all their faults, have been around for a long time, and are well supported by most DCC tools, but GLTF/GLB isn't quite there yet IMO.
     
  24. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
    Probably because GLTF wasn't necessarily intended to be used as an exchange format, but rather something you can quickly load into an engine.

    OBJ does not support skeletal animation and is rather bare bones - there isn't even multiple texture coordinate support, no tangents, binormals, or PBR material parameters

    FBX support in opensource tools is awful, because it relies on proprietary library which can't be linked with a GPL code.
     
    MadeFromPolygons and Siccity like this.
  25. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    So it's 3D clipart as I said. Unfortunately a lot of sites like Sketchfab are using it to distribute models, making them not very useful except "as is". If I want to replace the colored blocks in the animation above with fish or seashells, I'm out of luck. I don't have this limitation with FBX - even in Blender.
    Which is why I use FBX for animated files. Unfortunately, most of the GLB converters and importers I've tried don't support animation, so it doesn't really solve this problem in the real world yet either.
    But as bad as Blender's FBX support is, I can usually still manage to export animated models from Blender to 3ds Max, C4D, or Unity with it. When I can do that with GLB/GLTF models as well, then maybe we can talk about them replacing FBX. Until then, they're more trouble than they're worth for me.

    PS. I found this thread after hours of looking for any solution that would let me use GLB/GLTF content in Unity. Unfortunately some editing is almost always required before content I find online can be used, and this format doesn't seem to like being edited. As you stated, it's an end of pipeline format only. As such, it isn't as broadly useful to me as FBX. I still hope someone can change my mind on that, but that's how things seem to stand now.
     
    arumiat likes this.
  26. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
    However, FBX - in blender - is pretty much the same "clipart". It is, for practical purposes, "Write only". Sometimes you can import it back, when the stars are right and Cthulhu smiles at you. Or something. It also doesn't appear to transfer pbr properties into unity as of now.

    Honestly, FBX is awful, and having an open alternative to it would be good.
     
  27. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    I don't disagree with you - just saying that while GLB/GLTF may be the future, it's not there yet in the present. I'm all in favor of what they're trying to do, but they need to deliver a few more features before I abandon FBX for them. Unfortunately, as the standard becomes more popular, I'm running into more models that are only available as GLB/GLTF, and I can't use many of them because of current import/export limitations. I'm sure it would be a great format, due to its other clear advantages, if not for this frustrating bottleneck. The sooner Khronos stops focusing exclusively on exporters, and starts giving importers a bit of love, so we can actually use these models more widely, the better.
     
  28. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    255
    It's not a problem with the format itself. The format has all the information an importer would need. The problem is the currently existing import tools. All it takes is for someone to write a full featured importer, which is a task any programmer can pick up and have a go at. The official Khronos Blender IO source code is located right here , and if you have the skillset you can contribute to it yourself.
     
    phobos2077 and FargleBargle like this.
  29. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,160
    Yeah, I think functioning as a full interchange format is beyond the scope of the spec at the moment but also this is a problem with import tools, not the format itself.
     
  30. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    No argument there either - but the end result is the same. Because of the abundance of exporters available, a lot more models are appearing in this format online, but because of the lack of importers, I can't use a lot of them. It's great that they're an open standard - I just wish they'd be a bit more open to other use cases. Either that or model publishers should stop using it as an interchange format, and let their users convert them to GLTF when they're finished tweaking them to their liking, using one of the many exporters available.

    @Siccity: Too bad I'm not much of a programmer. I saw a site where someone expressed how easy GLTF files were to modify with a text editor. That gets into Matrix territory for me, but unfortunately, instead of blondes, brunettes, and redheads, all I ever see is a lot of incomprehensible code. I hope there are a few Neos out there with a better grasp of it, who can find better solutions.
     
  31. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
    Additionally, if someone offered bounties or just paid for work, it would speed up the process.
     
    Siccity likes this.
  32. tteneder

    tteneder

    Unity Technologies

    Joined:
    Feb 22, 2011
    Posts:
    175
    When talking about what glTF is best used for (and what problems it's not designed for) I keep coming back to this comparison:

    glTF is a last-mile format, the "JPEG for 3D"

    That being said, you *can* use glTF for 3D interchange, but might end up losing some original information (quads,euler rotation or rigging constraints; much like Jpeg introduces block artifacts).

    So for best results at the production stage you should stick to exchange PNG/PSD/EXR for images and something like FBX or USD for 3D models.

    I also agree that the glTF tools ecosystem is not very mature yet (nowhere near compared to Jpeg). This will improve over time and while it'll probably never be a great inter-DCC format, it might work for a good part of creators someday (much like Jpeg does as well). Especially the PBR material system with its extensions makes me believe that.
     
  33. tteneder

    tteneder

    Unity Technologies

    Joined:
    Feb 22, 2011
    Posts:
    175
    Sorry I missed that. Ping me directly for urgent questions.

    For now I'll continue developing the original repository. I'll keep you posted if that changes.
     
    xCyborg likes this.
  34. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    275
  35. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
  36. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,279
    What is the cloud bit about? Anyway been using this before v5 and is very customisable for runtime - nice & flexible. The only oddity is glb stores mesh data per material so you get a separate mesh per material used which may not be optimal, dunno...
     
  37. Ruuds

    Ruuds

    Joined:
    Dec 3, 2017
    Posts:
    17
    Any Chance we are going to see Feature Parity with the standard 3d Importer? the main thing I am missing from yours is On Demand Material Remapping, Generate colliders and Calculate Normals
     
  38. tteneder

    tteneder

    Unity Technologies

    Joined:
    Feb 22, 2011
    Posts:
    175
    I'd say that's a very desirable goal, but runtime loading is still the main focus point.

    @Ruuds: Can you elaborate on your requests? What do you mean with on-demand material remapping?

    Ironically there's a runtime import script in `GltfBoundsAsset` that supports scene level (Box) collider generation.

    Normals are calculated (if not present and the used material requieres them). Please file an issue if you experience otherwise.
     
    aer0ace likes this.
  39. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,795
    Does it not go through the normal Unity mesh importer? It has its own import settings?
     
  40. tteneder

    tteneder

    Unity Technologies

    Joined:
    Feb 22, 2011
    Posts:
    175
    It's based on ScriptedImporter and unfortunately many parts of the built-in importers (e.g. FBX) are not easily re-usable.
     
  41. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,795
    Okay. That's a pass from me. Have fun everyone else.