Three.js: Support loading GLTF 2.0 files with custom shaders using 'KHR_techniques_webgl' specification.

Created on 21 Nov 2019  路  6Comments  路  Source: mrdoob/three.js

It would be helpful to import custom shader code through GLTF files.

The draft specification for KHR_techniques_webgl is available here:

https://github.com/KhronosGroup/glTF/blob/c1c12bd100e88ff468ccef1cb88cfbec56a69af2/extensions/2.0/Khronos/KHR_techniques_webgl/README.md

It is currently used by Cesium and Hilo3d (Alibaba's webgl engine)

Enhancement Loaders

Most helpful comment

I thought the Cesium implementation had just implemented the glTF 1.0 version, but you're right it's 2.0 as well. The sample is good to know about too, thanks!

It would be awesome if someone wanted to implement support in THREE.GLTFLoader and share that, but all the same, I would prefer not to merge support for draft extensions into three.js unless they are nearer to approval than this one appears to be.

All 6 comments

I'm interested in supporting it. Actually I tried before but I gave up due to no glTF example model including KHR_techniques_extension. Is there any good model including it for the test now?

(I've been very busy, so anyone feel free to work on implementing it if we decide to support)

The draft specification for KHR_techniques_webgl is available...

This draft hasn't been updated in a while. I think that Cesium implementation might only be glTF 1.0, but I'm not sure. @ggetz do you know?

is there any good model including it for the test now?

Afraid not.

Unfortunately I would vote against merging support for KHR_techniques_webgl into three.js unless it's really going to be approved and supported by more tools. I'm not sure whether that will be the case. If we were able to make GLTFLoader extensible enough that this could be done without modifying the loader (https://github.com/mrdoob/three.js/issues/11682) that could help users to work around it and use the draft extension for their own projects if they wanted to.

If we were able to make GLTFLoader extensible enough that this could be done without modifying the loader (#11682) that could help users to work around it and use the draft extension for their own projects if they wanted to.

Agreed with this.

This draft hasn't been updated in a while. I think that Cesium implementation might only be glTF 1.0, but I'm not sure. @ggetz do you know?

If you visit the spec README, it states that it's written against glTF 2.0.

is there any good model including it for the test now?

Hilo3d has a working example derived from example provided in the Khronos Group spec.

SampleTechniques model
Viewer Demo with custom shader

I thought the Cesium implementation had just implemented the glTF 1.0 version, but you're right it's 2.0 as well. The sample is good to know about too, thanks!

It would be awesome if someone wanted to implement support in THREE.GLTFLoader and share that, but all the same, I would prefer not to merge support for draft extensions into three.js unless they are nearer to approval than this one appears to be.

I'm closing this issue just to avoid any confusion with the "Feature Request" label, since we're not ready to accept this as a pull request unless the draft extension is approved or near approval. I think there are some other approaches to this worth exploring, too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

boyravikumar picture boyravikumar  路  3Comments

jlaquinte picture jlaquinte  路  3Comments

seep picture seep  路  3Comments

clawconduce picture clawconduce  路  3Comments

jack-jun picture jack-jun  路  3Comments