Skip to content

Conversation

@alexanderflink-zz
Copy link

Added support for GLTF format using three-gltf-loader. Tested with models from examples folder. Works with both .glb and .gltf. Needed to update three and @types/three to use the GLTF loader, and removed the JSONLoader since it was deprecated. ObjectLoader still works.

I think GLTF would be nicer to use than the three json format, since they removed the exporters and support for json format.

@fand
Copy link
Owner

fand commented Jan 23, 2019

Thanks @alexanderflink , this is great!

I tried GLTF files in examples/models/gltf/ directory by replacing PATH in examples/obj-mtl.frag,
And most files worked well 🙌

      // PATH: './models/gltf/AnimatedMorphSphere/glTF/AnimatedMorphSphere.gltf', // working???

      // PATH: './models/gltf/BoomBox/glTF/BoomBox.gltf',
      // PATH: './models/gltf/BoomBox/glTF-Binary/BoomBox.glb',
      // PATH: './models/gltf/BoomBox/glTF-dds/BoomBox.gltf', // not working
      // PATH: './models/gltf/BoomBox/glTF-pbrSpecularGlossiness/BoomBox.gltf',

      // PATH: './models/gltf/BotSkinned/glTF-MaterialsUnlit/Bot_Skinned.gltf',

      // PATH: './models/gltf/CesiumMan/glTF/CesiumMan.gltf',
      // PATH: './models/gltf/CesiumMan/glTF-Binary/CesiumMan.glb',
      // PATH: './models/gltf/CesiumMan/glTF-Draco/CesiumMan.gltf', // not working
      // PATH: './models/gltf/CesiumMan/glTF-Embedded/CesiumMan.gltf',

      // PATH: './models/gltf/CesiumMilkTruck/glTF/CesiumMilkTruck.gltf',
      // PATH: './models/gltf/CesiumMilkTruck/glTF-Binary/CesiumMilkTruck.glb',
      // PATH: './models/gltf/CesiumMilkTruck/glTF-Draco/CesiumMilkTruck.gltf', // not working
      // PATH: './models/gltf/CesiumMilkTruck/glTF-Embedded/CesiumMilkTruck.gltf',
      // PATH: './models/gltf/CesiumMilkTruck/glTF-MaterialsCommon/CesiumMilkTruck.gltf',
      // PATH: './models/gltf/CesiumMilkTruck/glTF-techniqueWebGL/CesiumMilkTruck.gltf',
      
      // PATH: './models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf',

      // PATH: './models/gltf/Duck/glTF/Duck.gltf',
      // PATH: './models/gltf/Duck/glTF/Duck.gltf',
      // PATH: './models/gltf/Duck/glTF-Binary/Duck.glb',
      // PATH: './models/gltf/Duck/glTF-dds/Duck.gltf', // not working
      // PATH: './models/gltf/Duck/glTF-pbrSpecularGlossiness/Duck.gltf',

      // PATH: './models/gltf/MetalRoughSpheres/glTF/MetalRoughSpheres.gltf',
      // PATH: './models/gltf/MetalRoughSpheres/glTF-Embedded/MetalRoughSpheres.gltf',

      // PATH: './models/gltf/Monster/glTF/Monster.gltf',
      // PATH: './models/gltf/Monster/glTF-Binary/Monster.glb',
      // PATH: './models/gltf/Monster/glTF-Draco/Monster.gltf', // not working
      // PATH: './models/gltf/Monster/glTF-Embedded/Monster.gltf',
      // PATH: './models/gltf/Monster/glTF-lights/Monster.gltf',

      // PATH: './models/gltf/OutlinedBox/OutlinedBox.gltf',

Some files not working, however they seem easy to fix.
we only need to load DRACO Loader and DDS Loader according to error messages .
I'll do that after merge, but if you do that i'll be appreciate it.

I'm gonna merge this PR soon. Could you merge master and resolve conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants