jagenjo / webglstudio.js

A full open source 3D graphics editor in the browser, with scene editor, coding pad, graph editor, virtual file system, and many features more.
MIT License
5.2k stars 604 forks source link

Requesting support for gltf, glb #48

Open KnightCoder opened 4 years ago

KnightCoder commented 4 years ago

I've noticed that you support obj files only for 3D models. However, gltf and glb are support widely for WebGL. Compared to these, an obj file is heavier as well. Hence, consider supporting gltf and glb file formats as well.

Alternatively, an option to convert obj to light weight gltf/glb files. That way at least the published version will have light weight gltf and glb files.

jagenjo commented 4 years ago

I know well gltf, I support it in all my engines. The problem is that WebGLStudio asumes that a resource is a single file, and gltf are two files (json and bin) so supporting it will imply a big reestructuring of the code, and I dont have much time now.

Is something I have in my TODO list from long time ago.

KnightCoder commented 4 years ago

Is that same for GLB as well? AFAIK, it is a single file however it is a binary format.

jagenjo commented 4 years ago

Is there any javascript library to parse glb?

KnightCoder commented 4 years ago

I understand. I will also look for one and share it with you.

But, the importance of a light weight file format is significant for supporting WebGL on browsers and mobile phones.

Thank you @jagenjo

KnightCoder commented 4 years ago

@jagenjo I found this GLTFLoader in ThreeJS. I am not sure how much helpful this will be but still sharing.

KnightCoder commented 4 years ago

@jagenjo here are a few glTF/glb parsers that you may refer: https://github.com/KhronosGroup/glTF-Sample-Viewer https://github.com/cx20/gltf-test https://github.com/google/filament

ThorstenBux commented 4 years ago

@jagenjo support for glb would be huge and I think it would be sufficient to only support glb instead of glb and glTF. If you could point me into a direction I could start working on an importer