Git Product home page Git Product logo

gltfast's People

Contributors

alex-huot avatar atteneder avatar aurorahcx avatar avseoul avatar bersaelor avatar camnewnham avatar chrisdjali-wrld3d avatar dandovi avatar dhasl002 avatar ericbeetsofficial-opuscope avatar gauthial avatar holo-krzysztof avatar hybridherbst avatar jdebelle-unity avatar jf-gagnon avatar jiangboyu13 avatar jonathanb-vobling avatar mikejurka avatar nickconstantinidis avatar nyxstudio avatar querielo avatar samuel-proulx avatar stephengower avatar wonkee-kim avatar zharry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gltfast's Issues

Skin support

Support meshes/rigs with skinning applied.

  • Joints
  • Weights

glb import from network share failed

I tried to import a .glb from a network share and got the following error.

HTTP/1.1 502 Bad Gateway \\server\share\file.glb
UnityEngine.Debug:LogErrorFormat(String, Object[])
GLTFast.<LoadRoutine>d__6:MoveNext() (at Assets/GLTFast/GltfAsset.cs:41)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

All nodes and meshes are in wrong coordinate space

glTF is right-handed whilst Unity uses a left-handed coordinate system. Initially glTFast simply scaled the root node by -1 in the Z-axis to fix this. Turns out this can have some negative impact on, for example, shader or physics behaviour.

TODO: convert node's transforms and meshes into Unity space

Performance on ios

The (impressive) speed of this library in the editor gets lost when building for ios. The loading duration increases by 400%. Switching from .glb to .gltf does not affect the duration.

Unity Package

Make this project a UnityPackage

  • Easier usage for developers
  • Separation of core and usage/example code

Loading glb from Application.persistantdatapath in android.

Hi,
I downloaded the glb files in persistantPath in Android and when I try to load from this path I get an error
Unity: Cannot connect to destination host /storage/emulated/0/Android/data/com.xxx.xxxx/files/C772BCFB-B2FD-406E-8B32-05D3D5DEFAD6.glb

Loading of draco file fails

I'm getting a decoding error when trying to load draco compressed files.

Failed: Decoding error.
UnityEngine.Debug:LogError(Object)
GLTFast.PrimitiveDracoCreateContext:CreatePrimitive() (at Library/PackageCache/com.atteneder.gltfast@64f3c1b978d7139af3da6d9c48b02ae06a375d90/Runtime/Scripts/GltFast.cs:159)
GLTFast.<Prepare>d__43:MoveNext() (at Library/PackageCache/com.atteneder.gltfast@64f3c1b978d7139af3da6d9c48b02ae06a375d90/Runtime/Scripts/GltFast.cs:545)
GLTFast.<LoadContent>d__8:MoveNext() (at Library/PackageCache/com.atteneder.gltfast@64f3c1b978d7139af3da6d9c48b02ae06a375d90/Runtime/Scripts/GltfAsset.cs:77)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

I tried running with 2019.2 as well as 2019.3 on windows 10, git as well as lsf are up to date.
Packages appear to also be in order and up to date:

{
  "dependencies": {
    "com.atteneder.draco": "https://gitlab.com/atteneder/DracoUnity.git",
    "com.atteneder.gltfast": "https://github.com/atteneder/glTFast.git",
    "com.unity.ext.nunit": "1.0.0",
    "com.unity.ide.vscode": "1.1.2",
    "com.unity.test-framework": "1.1.1",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0"
  },
  "testables": [
    "com.atteneder.gltfast"
  ],
  "lock": {
    "com.atteneder.draco": {
      "revision": "HEAD",
      "hash": "b04c2d09ff4d4889e68e0cdfe6b3dc47f4a58a29"
    },
    "com.atteneder.gltfast": {
      "revision": "HEAD",
      "hash": "64f3c1b978d7139af3da6d9c48b02ae06a375d90"
    }
  }
}

I created the file using the fbx2gltf converter 0.9.7 using .\FBX2glTF-windows-x64.exe --input .\Y_Bot.fbx --output Y_Bot.glb --binary --draco (also tried without --binary)

I attached the file in question and would be extremly happy for any pointers where to start debugging / fixing the whole thing!

data.zip

Draco compressed files do not load

I receive this error whenever the plugin tries to decode a gltf or glb compressed with draco:

'''
EntryPointNotFoundException: DecodeMeshForUnity
DracoMeshLoader+DracoJob.Execute () (at Library/PackageCache/com.atteneder.draco@b04c2d09ff4d4889e68e0cdfe6b3dc47f4a58a29/Runtime/Scripts/DracoMeshLoader.cs:64)
Unity.Jobs.IJobExtensions+JobStruct`1[T].Execute (T& data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at /Users/builduser/buildslave/unity/build/Runtime/Jobs/Managed/IJob.cs:30)
'''

I've tried files exported from Blender 2.8 as well as this sample file:
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/CesiumMilkTruck/glTF-Draco

I've also tried Unity 2019.2.3f1 on both Windows 10 and OSX with the same result.

Support for Universal Render Pipeline (URP)

Currently there's only support for the Built-In render pipeline via DefaultMaterialGenerator. It implements the interface IMaterialGenerator.

To add support for the URP, the corresponding code creating the materials has to go into a new class implementing IMaterialGenerator.

It has to be used in the constructor of GLTFast instead of the default one (ideally dynamically).

        public GLTFast() {
            materialGenerator = new DefaultMaterialGenerator();
        }

Optimized Shader/Material System

Right now the Unity Standard Shader is utilized which has some downsides:

  • costly texture transformations for occlusion/roughness/metalic textures, since the channel usage differs

  • missing features (like double sidedness or unlit)

An optimized shader (or a derivate of the Standard Shader) could improve speed/size.

Things to consider:
(Scriptable) Render Pipeline compatibility:
Forward/Deferred, Lightweight, HQ, custom

Thread support

Investigate if the loading process can be moved off the main thread and spread accross multiple worker threads.

Invalid Package Dependency

I am not incredibly well versed in how Unity's fancy new Package Manager works, but when I follow your instructions on attempting to add glTFast to my manifest.json file, it returns the following error.

An error occurred while resolving packages:
  Package com.atteneder.gltfast@https://github.com/atteneder/glTFast.git has invalid dependencies:
    com.atteneder.draco: Package [[email protected]] cannot be found

poor performance on editor/android with large glb file

Hi, i was testing this project and i have very bad performance with "large" glb scene (40mb-100mb) (3d models with lot of objects, ~1M verts ), this was designed just for litle objects? what about performance on mobile devices? what are the limits of this library?

Missing namespaces

I've just cloned the project and opened inside of Unity 2018.3.0 which is causing missing namespaces. These are:

  • TestTools
  • NUnit
  • TestAttribute
  • Unity TestAttribute
  • Unity Test

Is this because i'm using a newer version of Unity or are these carried over from the Kronos project and i'm missed something?

So I can't load GLTF files?

Do I need to use another library to convert a GLTF file into GLB in order to use :

var loadModel = new GameObject().AddComponent<GLTFast.GlbAsset>();
loadModel.url = gltf;

Camera support

Optional camera import support. Default should be to not import cameras (or at least not activate them).

Streamable

Make loading glTFs streamable, so the already received part of the content can be parsed while the rest is loading.

  • Detect Binary/JSON
  • Parse JSON ahead
  • Fill individual BufferViews/Accessors instead of single Buffer
  • Start buffer to data conversion ahead
    • Vertex/Index/Matrix Buffers
    • Textures

Related:

  • #318
  • Streamable instantiation: Instantiate right after parsing but before loading is done and have the content (meshes, textures) appear once they are there.
    • Texture streaming
      • Instantiate first and assign textures once they are ready
      • Mipmap streaming: stream in low levels first and improve resolution on the go

Load Progress and state reporting

It would be interesting to get a progress (done vs pending percentage) and provide data/interfaces required for progress bars and ETA calculation.

Callbacks for major loading events, like:

  • Geometry is ready
  • Materials are ready
  • Textures are ready
  • Animations are ready
  • Everything is ready

Edit: Since version 4.0.1 you can retrieve warning/error messages via ICodeLogger injection.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.