Commit Graph

119 Commits

Author SHA1 Message Date
Philip Rideout
d7e5f2c26b Web: remove more &free callbacks.
It is not safe to take the address of a stdlib function with emscripten,
this causes an intermittent crash in the WebGL backend.
2019-08-14 15:14:49 -07:00
Philip Rideout
6f143b1b54 Fix wasm by avoiding the "&free" trick.
We should not use the address of a stdlib function for BufferDescriptor
callbacks. With emcc this compiles without warnings or errors, but
produces incorrect code that causes intermittent out-of-memory errors at
run time.
2019-08-06 15:03:48 -07:00
Philip Rideout
3263c46355 Add morphing support to gltfio.
Issue #1149, #1417
2019-07-30 10:20:50 -07:00
Philip Rideout
8f45f4ec35 gltfio: Fix skinning offset.
Thanks @iamjinge for the fix.

Fixes #1405.
2019-07-12 09:34:52 -07:00
Philip Rideout
22dcdc770f gltfio: fix issue with bounding box computation.
If the client opts in to "recomputeBoundingBoxes", then we manually
compute a bounding box that ignores the glTF min / max annotations.

This computation was erroneously including the transform of the injected
root node, which is not part of the model.

This could cause a problem when creating the asset, then immediately
positioning it with its injected root node before the ResourceLoader
is done downloading vertex buffers.
2019-07-03 10:20:17 -07:00
Romain Guy
53ea1a00ec Fix warnings 2019-06-27 10:46:52 -07:00
Philip Rideout
e4e439e2bf Fix build break. 2019-06-21 18:48:40 -07:00
Philip Rideout
a79a83d6da gltfio: gracefully error when mesh uses draco. 2019-06-21 16:12:59 -07:00
Philip Rideout
76147a7231 gltfio: fix bug with colliding TANGENT buffers.
ResourceLoader was mistakenly assuming that all primitives in the
entire model have TANGENTS in the same slot index.

Fixes #1326.
2019-06-20 16:29:22 -07:00
Philip Rideout
475cd80faf gltfio: consolidate buffer slots.
Instead of using the actual glTF attribute indices, we now pack them
so that unused indices do not take up any VertexBuffer slots.

Fixes #1256.
2019-06-04 14:35:51 -07:00
Ben Doherty
89c4647c3c Expose gltfio library so it can be used by third_parties (#1230) 2019-05-28 14:50:38 -07:00
Philip Rideout
59f1fb8956 gltfio: fix file path bug. (#1151)
The cgltf "base path" that gets passed to cgltf_load_buffers should
actually be the path to original glTF file, otherwise bin filepaths
are resolved incorrectly.
2019-04-29 22:42:17 -07:00
Philip Rideout
7cf121b5c2 Fix intermittent JavaScript bug in gltfio. (#1132)
* gltfio + web: do not call loadResource twice.

* Fix intermittent JavaScript bug in gltfio.
2019-04-23 11:30:22 -07:00
Philip Rideout
c6e2086e67 gltfio: add JavaScript bindings. (#1092) 2019-04-11 20:05:32 -07:00
Mathias Agopian
b26684deed rename namespace filament::driver -> filament::backend 2019-03-26 11:47:47 -07:00
Philip Rideout
0102489748 gltfio: add UbershaderLoader, an implemention of MaterialProvider. 2019-03-12 15:29:17 -07:00
Philip Rideout
1ccf2d6a08 gltfio: fix up and enhance AABB functionality.
gltfio computes two types of bounding boxes: one for renderables (used
for frustum culling) and one for the overall asset (used for
positioning the camera or asset).

Both of these are based on the min+max attributes in the glTF file, but
the asset-level box was incorrect because only two corners of the
transformed AABB were considered.

This CL also adds optional computation of bounding boxes that crawls
through the vertex positions. This is useful when diagnosing potential
issues with the asset's min+max info.

These enhancements are motivated by a culling issue seen with the voxel
Cathedral on sketchfab.
2019-03-07 14:11:21 -08:00
Philip Rideout
6c75c6436e Add support for glb files.
Tested with DamagedHelmet.glb
2019-03-02 00:02:40 -08:00
Philip Rideout
c7848efd86 Introduce the gltfio library.
This is our new mobile-friendly and web-friendly library for loading
glTF assets. It is still a work in progress, but already capable of
loading many conformance models, including those with animation,
skinning, and a couple of extensions (nonlit and texture transforms).

Next week we will add a sample app demonstrating its usage.
2019-03-01 07:27:03 -08:00