regl-project / resl

💪 Streaming RESource Loader
81 stars 8 forks source link

glTF loader #8

Open milcktoast opened 8 years ago

milcktoast commented 8 years ago

Maybe this is out of scope for this module, but having a built-in glTF parser/loader would be useful. Three.js, BabylonJS, Cesium, PEX, .. have such loaders.

cvan commented 7 years ago

This would be really fantastic!

Here are some related links, including links to some existing glTF loaders:

vorg commented 7 years ago

I've written a gltf loader (no animations support yet, regl version is about to be pushed) https://github.com/pex-gl/pex-gltf and can assure you that its way beyond regl and even resl. Parsing the json, loading the resources and constructing the buffers is only the beginning. What you need next is:

vorg commented 7 years ago

I think the question would be whats the intended use? Regl doesn't even have a mesh format. I think the most regl-way would be to get a list of objects with properties matching regl command syntax as much as possible eg { attributes, vert, frag, modelMatrix, parentIndex } that then could be consumed by the application as it wishes.

donmccurdy commented 6 years ago

Looks like someone wrote a loader: https://github.com/gamedev-js/regltf

Haven't had the chance to look too closely yet; the example is failing with errors that indicate some dependencies might be broken.

zzmp commented 6 years ago

Has anyone made any more headway here, or have plans to?

donmccurdy commented 6 years ago

No plans here but would be excited to try a loader out if anyone is working on it :). I think I agree with @vorg above — glTF uses abstractions that aren't within scope for regl, so treating the glTF file as a library of meshes and materials seems pretty reasonable. The PBR pipeline mentioned above has (in glTF 2.0) replaced the GLSL materials from glTF 1.0. ~glTF 2.0 will eventually also support GLSL through the KHR_techniques_webgl extension, but~ (outdated) we expect the vast majority of glTF 2.0 models to use WebGL-agnostic materials: metal/rough PBR, spec/gloss PBR, and unlit materials.