Commit Graph
65 Commits
Author SHA1 Message Date
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 fdefa16cae jsbindings: add setColor4Parameter and rename setColorParam.
JavaScript does not have overloading so we generally use a numeric
suffix to distinguish overloads.

Fixes #1202
2019-05-20 10:43:38 -07:00
Gareth Morgan 45636e5afe Correct JS bindings for (#1137)
* Correct bindings for TransformManager::create and VertexBuffer::Builder::attribute

* Correct types
2019-05-01 17:09:32 -07:00
prideout 8d9ebb7a68 Use older JS syntax to fix Linux + Web. 2019-04-23 13:33:49 -07:00
Philip Rideout 15a8828a6c Bump the npm package to v1.2.0. 2019-04-23 12:54:32 -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 7b05d4fdeb Convert web helmet demo to use gltfio. (#1094)
This also adds an overlay element to show progress since this model
can take a while to load.
2019-04-12 09:41:04 -07:00
Philip Rideout c6e2086e67 gltfio: add JavaScript bindings. (#1092) 2019-04-11 20:05:32 -07:00
Philip Rideout bd20d005ce gltfio: split out a core library for WebGL and Android (#1080) 2019-04-08 12:43:30 -07:00
Philip Rideout dcc17b9b7e Allow dynamic doubleSided and materialThreshold. (#1072)
* MaterialInstance now has setMaskThreshold for convenience.

* Materials now support dynamic doubleSided property.

This does not change the format of material packages because they
already have both getDoubleSided() and getDoubleSidedSet().

The only way in which this change could impact existing applications is
that materials that explicity set doubleSided to "false" will now
respect the material's culling mode, rather than forcing it to NONE.

Fixes gltf_viewer with littlest_tokyo in ubershader mode.

Fixes #963.

* JNI for dynamic material properties.

* Add underscore prefix to internal material params.

* Remove un-needed mat info field.
2019-04-08 11:43:01 -07:00
Philip Rideout 230f0e1b2b Fix setCustomProjection JS binding.
Fixes #1073.
2019-04-05 08:37:45 -07:00
Philip Rideout 1fc8e8dbeb WebGL fix for "createContext is not a function".
One of the recent releases of emsdk moved its GL-related utility methods
into an object called GL, previously it exposed them directly.

This change also makes it so that we create the WebGL 2.0 context
and register it with emscripten, rather than the other way around.

Note that our CI does "emsdk activate latest", not sure when this broke
exactly.
2019-03-28 11:23:05 -07:00
Philip Rideout feb7d968b6 Fix web build break. 2019-03-28 08:09:24 -07:00
Jack Diver 5366105ed2 Removing STL headers from filameshio (#1050)
* Removed STL headers from filameshio/MeshReader.h modified the samples to work the same, and made an effort to remedy the jsbindings although I'm not experienced with them.

* Fixed assignment operators for MaterialRegistry

* Fixed formating for MeshReader Material Registry

* Forgot one format

* Forgot another format
2019-03-28 07:30:22 -07:00
Mathias Agopian 0b8acb451d attempt to fix filament-js 2019-03-26 11:47:47 -07:00
Philip Rideout c97e812056 Update FlightHelmet path. 2019-03-13 16:21:58 -07:00
Philip Rideout 3b827da834 geometry: add JS bindings for SurfaceOrientation
These bindings are not user friendly because clients need to
manually allocate / deallocate memory. However it gets the job done.

Fixes #959.
2019-03-12 14:31:09 -07:00
Philip Rideout 960d1321e6 Repair web builds. 2019-03-11 18:36:29 -07:00
Philip Rideout 031ff260f7 Repair web builds. 2019-03-11 17:44:12 -07:00
Romain Guy 41397e1b82 Move 3p models to models/ directory 2019-03-11 14:21:51 -07:00
Philip Rideout f1f9fde3a4 Various JavaScript updates.
Add shadows to the FlightHelmet demo, add a link to it on the site,
and add recently-introduced entry points to the JS bindings.
2019-03-08 12:56:48 -08:00
Philip Rideout 147dafb4c1 Fix webgl on kokoro. 2019-02-25 12:02:47 -08:00
Philip Rideout be18155996 Build web docs only when opting in.
See #807.
2019-02-13 10:28:51 -08:00
prideout 5ee359cf40 Move math namespace to fix #746. 2019-02-07 09:23:07 -08:00
prideout 72a987057e Move MeshReader into filamesh namespace.
This class will not extend well to glTF so this cordons it off into the
filamesh namespace, which is an already-existing namespace that we use
for the things related to the filamesh file format.

For glTF we might create a new library with its own MeshReader so
this will mitigate confusion.
2019-02-06 12:59:48 -08:00
Philip Rideout 9fd69ec7a9 Add skinning demo.
Motivated by #764.
2019-02-02 09:02:32 -08:00
Philip Rideout 2f35f26148 VertexBuffer builder normalized now accepts "false". 2019-01-17 06:09:17 -08:00
Philip Rideout 04f3268961 Introduce test to ensure buildability of TypeScript declarations. 2019-01-16 14:31:42 -08:00
Philip Rideout a3c939894c Add more JavaScript bindings and TypeScript annotations.
The following type bindings are now complete:

 - RenderableManager
 - RenderableManager$Builder
 - RenderableManager$Bone
 - TransformManager
 - Box, Camera, Frustum
2019-01-16 14:31:42 -08:00
Philip Rideout 8228deb209 Add a multi-material model and JS demo.
This is a more complex test than suzanne because it has multiple
materials and exercises the named materials functionality in
loadFilamesh.

This also exercises our glTF-to-Filamesh pipeline at build time.

See issue #663
2019-01-11 09:18:41 +05:30
Philip Rideout 0158e7e858 JS API: loadFilamesh can now return material names.
See issue #663
2019-01-10 07:48:19 +05:30
Romain Guy a38c40cf11 Turn on shaders optimization by default (#614)
* Turn on shaders optimization by default

Release builds of Filament only work well with optimize shaders,
turning optimizations on by default will help avoid mismatches.

This change also adds -g to disable all optimizations, for debug
builds.

* Use -g on debug builds

* Use -g on debug builds

* Update tutorial_redball.md to remove matc's -O

* Update tutorial_suzanne.md to remove matc's -O

* Use -g in debug builds
2018-12-11 09:36:37 -08:00
Philip Rideout 1feb07ba8b Add webpack / TypeScript demo. 2018-12-07 09:50:06 -08:00
Philip Rideout f4f6fb75dc Support JPEG textures in the JS API.
This restores the canvas-based decoding method that was removed in #214,
but only for JPEG images. We continue to decode PNG images in C because
canvas-decoding mucks with alpha and prevents us from reading 16-bit
PNG.
2018-12-07 08:15:54 -08:00
Philip Rideout 71e9c13b94 Add TypeScript annotations file (hand authored for now) 2018-12-06 15:43:11 -08:00
Philip Rideout 8bb68b3c55 Rename MeshIO class to MeshReader.
This makes the name symmetrical with MeshWriter.
2018-12-05 17:15:52 -08:00
Philip Rideout beaf751604 filamesh: Compress attributes individually.
This further reduces compressed suzanne from 333489 bytes to 272761.

Tested with vk_hellopbr and tutorial_suzanne.html

Issue #558
2018-12-05 17:15:52 -08:00
Philip Rideout 6c55b3b989 filamesh: Add support for COMPRESSION.
Note that the WebGL build uses filameshio, but Android does not. Our
Android samples therefore do not yet understand the compressed format.
For web, I measured the before / after:

```
BEFORE: filament.wasm = 505796, suzanne.filamesh = 521476
 AFTER: filament.wasm = 510915, suzanne.filamesh = 333489
```

Issue #558
2018-12-05 13:20:55 -08:00
Philip Rideout 7366bdb500 More KtxUtility improvements.
This makes it easier for C++ clients to use KTX files and simplifies
the JavaScript bindings.
2018-11-30 13:16:47 -08:00
Philip Rideout bcfe03c8e1 KtxUtility improvements.
This makes it easier for C++ clients to use KTX files and simplifies
the JavaScript bindings.
2018-11-29 16:39:30 -08:00
Philip Rideout 84d2fb222b Flesh out JS bindings a bit. 2018-11-16 17:21:44 -08:00
Philip Rideout e652507315 Tutorial fixups per code review feedback. 2018-11-16 14:09:41 -08:00
Philip Rideout ffff8437ba Add tutorial that describes compression and async loading. 2018-11-16 14:09:41 -08:00
Mathias Agopian 870d15b9ab Add MaterialInstance::setPolygonOffset()
The polygon offset can now be set through MaterialInstance. 
USE WITH CAUTION, this impacts performance negatively.
2018-11-13 19:27:52 -08:00
Ben Doherty 74573c7ce4 Fix undefined symbols issue with web builds (#482) 2018-11-13 18:11:03 -08:00
Philip Rideout 17003106d2 Prep for new JavaScript tutorial.
This adds a few new functions to the JavaScript bindings. It also adds
our JavaScript docs into the CMake build system for machines that meet
the Python requirements.
2018-11-13 17:27:34 -08:00
Philip Rideout 73a2ef7944 Add favicon. 2018-11-13 12:07:57 -08:00
Philip Rideout 7c2c4f3b11 Fix parquet wrap mode. 2018-11-13 12:07:47 -08:00
Philip Rideout 3407302954 Minor suzanne cleanup. 2018-11-08 16:21:54 -08:00
Philip Rideout f4806461ee Fix JavaScript leaks with BufferDescriptor.
Fixes #429
2018-11-08 16:17:29 -08:00