[x3d-public] glTF

GPU Group gpugroup at gmail.com
Mon Jun 22 08:20:01 PDT 2020


My experience implementing glTF loading and rendering in freewrl:
-Doug
RESULTS:

http://dug9.users.sourceforge.net/web3d/tests/gltf/gltf_june22_2020.jpg
- we can load directly as scene, or inline .gltf and.glb
x our physical diffuse texture isn't showing up correctly
- view3dscene is great at loading gltf
http://dug9.users.sourceforge.net/web3d/tests/gltf/box_mat.gltf.glb
http://dug9.users.sourceforge.net/web3d/tests/gltf/separate_test.gltf
http://dug9.users.sourceforge.net/web3d/tests/gltf/texture/TextureCoordinateTest.gltf
- a texture test from:
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/TextureCoordinateTest

TIME
9 days to get a bit rendering - 90% of that was to find ways / places to
integrate into freewrl spaghetti C code base.

METHOD
BufferGeometry node (as Andreas mentioned x3dom uses) allowed me to bypass
some freewrl spaghetti C and save some time.
 i used cgltf https://github.com/jkuhlmann/cgltf
- .h file in C99 allows quick and easy parsing into C structs
Lazy loading - .glb contains .ibin, but JSON .gltf separate needs a .,bin
binary file with the geometry buffers. I found there's enough information
in the JSON .gltf to create all the x3d scene nodes, and each geom node
gets a pointer to a gltf unit struct I made with a flag saying when the
.bin has been loaded and post-applied to the cgltf struct .data. When the
geom node sees bin has been loaded and applied, then it compiles and starts
rendering.
- i hacked the cgltf bin loader to separate out file loading, to integrate
into freewrl http pull system, so it can get .bin even when on a remote
server.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200622/a3ac48c3/attachment.html>


More information about the x3d-public mailing list