Commit Graph
483 Commits
Author SHA1 Message Date
Ben Doherty 0754edbf9b Fix broken iOS build (#411) 2018-10-19 12:51:53 -07:00
Philip Rideout 9916af3ab1 Simplify docgen script per code review. 2018-10-19 12:40:38 -07:00
Philip Rideout dcfbe694b1 Add fullscreen button to embedded JS demos. 2018-10-19 12:40:38 -07:00
Philip Rideout 835cc93b71 Doc generator now uses argparse. 2018-10-19 12:40:38 -07:00
Mathias Agopian 2f14ac64a7 fix iOS build on case-sensitive filesystems 2018-10-19 11:42:54 -07:00
Mathias Agopian e96f982c9f Fix typo in RangeSet
Fixes #407
2018-10-19 11:42:39 -07:00
Philip Rideout 605a836565 Add JavaScript utility functions to reduce boilerplate. (#406)
* JS utilities: simplified render method.

* redball tutorial now rotates camera.

* JS utilities: add createTextureFromKtx.

* JS utilities: add createIblFromKtx.

* Repair testwasm.

* Update libs/filamentjs/docs/tutorial_redball.md

Co-Authored-By: prideout <philiprideout@gmail.com>

* Update libs/filamentjs/docs/tutorial_redball.md

Co-Authored-By: prideout <philiprideout@gmail.com>

* Update libs/filamentjs/docs/tutorial_redball.md

Co-Authored-By: prideout <philiprideout@gmail.com>
2018-10-18 18:19:05 -07:00
Mathias Agopian 1cde20d822 Avoid a normalize() in the vertex shader
This is achieved by pre-scaling the normals 
transform so that the resulting normal doesn't have
any large component allowing to do the normalize()
in the fragment shader in mediump.

This must be done for skinning too.
2018-10-18 17:37:06 -07:00
Mathias Agopian a547f11a8c fix more comment typos 2018-10-18 16:49:47 -07:00
Philip Rideout 83de0fc3e8 The redball tutorial now describes matc and cmgen.
This commit also adds a help option to `build.py` and allows
customization of the output folder.
2018-10-18 16:46:15 -07:00
Ben Doherty 3ed2dd08fb Handle device orientation changes (#399) 2018-10-18 14:43:32 -07:00
Ben Doherty db729b157a Remove development team for iOS sample (#401) 2018-10-18 13:53:55 -07:00
Ben Doherty 29119c7248 Add iOS support to Filament (#360) 2018-10-18 12:42:13 -07:00
Philip Rideout 356c3a2c24 Flesh out the JavaScript tutorials. 2018-10-18 12:29:22 -07:00
Philip Rideout b0853b5eb6 jsbindings: fix buffer lifetime bug.
This is a fix-up to f5319f2.
2018-10-18 12:29:22 -07:00
Philip Rideout d324dc724a Start another literate tutorial / demo for JavaScript.
Unlike the triangle tutorial, this is more focused on materials and 3D
rendering. While much of the verbiage is still TBD, the code snippets
already produce a functional demo after being glued together by the
tangler script.
2018-10-18 12:29:22 -07:00
Romain Guy e6435a7431 Update README 2018-10-17 16:30:30 -07:00
Philip Rideout d3e7f40398 Add IBL to jsbinding and testwasm. 2018-10-17 16:13:53 -07:00
Philip Rideout f5319f2492 jsbindings: fix buffer lifetime bug.
In order to match its JavaScript counterpart, the Buffer wrapper needs
to use reference counting, and the easiest way to achieve that is
with shared_ptr.
2018-10-17 16:13:53 -07:00
Philip Rideout e00ba80561 jsbindings: add JS utilities, enhance testwasm. sceneform-1.6pr5 2018-10-17 10:17:04 -07:00
Philip Rideout d15e275de0 Add glMatrix to third_party.
Some of our web tests and demos will make use of this library, and it's
useful to leverage a local copy instead of a CDN during development.
2018-10-17 09:57:08 -07:00
Romain Guy 920cc7a84a Normalize normals and tangents in the vertex shader (#388)
This avoids breaking bitangents when a scale value is set in the
transform matrix
2018-10-16 17:12:54 -07:00
Mathias Agopian 3b504f2941 add Stream::getTimestamp() to java api 2018-10-16 16:52:26 -07:00
Mathias Agopian f697b41a2b fix a few typos in comments 2018-10-16 16:50:10 -07:00
Mathias Agopian 8452c4f8f2 Add usage hints to the driver 2018-10-16 16:23:24 -07:00
Mathias Agopian c238027e49 implemented Stream::getTimestamp()
this returns a timestamp in nanosecond corresponding
to the desired presentation time of the latest frame
bound to a filament texture.
2018-10-16 15:56:43 -07:00
Mathias Agopian b374340ebb skinning allows 256 bones again, but disallow skews. 2018-10-16 15:56:30 -07:00
Romain Guy c581b755fd Add helper to upload Android bitmaps to textures (#382)
* WIP Add helper to upload Android bitmaps to textures

* Add missing file

* Pass custom constants for bitmap formats

* Add sample app for texturing

* Update the README for samples

* Rename variable from callback to autoBitmap
2018-10-16 14:24:18 -07:00
Philip Rideout 9e5f44bd34 Consolidate two filamesh readers into a lib. 2018-10-16 13:31:16 -07:00
Philip Rideout d9204052c8 Fix potential issue with detached ArrayBuffer. 2018-10-15 18:35:53 -07:00
Philip Rideout 5a8d4d818c Remove bad exception handler from wasmloader.
It is incorrect to assume that any exception thrown during onReady
must be due to a faulty download.
2018-10-15 18:35:53 -07:00
Philip Rideout cd84980c84 Add tests for filamentjs. 2018-10-15 18:35:53 -07:00
Philip Rideout 9b8d5fdf12 Add JS bindings for Texture, PixelBufferDescriptor, et al. 2018-10-15 18:35:53 -07:00
Romain Guy 7cb01929a3 Clean up Kotlin samples (#380)
* Clean up Kotlin samples

* Further code cleanup
2018-10-15 15:28:39 -07:00
Philip Rideout e7777ef330 Add literate JavaScript tutorial and Python tangler.
This commit contains a markdown file for a "hello triangle" tutorial
as well as a Python script that does two things:

1) Extracts JavaScript code blocks from the markdown to generate the
   code for the demo.

2) Converts the markdown into a nicely-rendered web page.

After we invoke the Python script for the first time, it will create
a set of files in the root docs folder, which will automatically be
published via GitHub Pages to the following URL.

    https://google.github.io/filament/webgl

This gives us an official place to host the latest web demos and
tutorials.

The tutorial can be previewed
[here](https://prideout.net/prototype/webgl/tutorial_triangle.html).
More JavaScript tutorials are forthcoming.
2018-10-15 12:42:13 -07:00
Philip Rideout 0326d60d0a jsbindings: simplify BufferDescriptor wrapper.
The JS BufferDescriptor wrapper is used in two directions: JS => WASM
and WASM => JS. In both cases, it needs to be sure to delete the
underlying driver::BufferDescriptor. This is safe because the contents
of the underlying descriptor are always moved to its final destination
before the wrapper is destroyed.
2018-10-15 12:16:02 -07:00
Ben Doherty 0d709b6074 Add a few new nodes to Tungsten (#326) 2018-10-15 12:02:05 -07:00
Ben Doherty 6992c8a584 Update README on linking against Filament (#379)
* Add section to README on linking against Filament
2018-10-15 11:18:45 -07:00
Philip Rideout 7c54faa8bd Add filamentjs to web release archive.
The web archive now has two subfolders: public and filamentjs.

- public contains the three C++ based web demos.
- jsbindings contains the new JS bindings and Filament-only WASM module.
2018-10-15 10:43:28 -07:00
Romain Guy 3a0f9791cc Remove outdated comment 2018-10-12 18:37:34 -07:00
Philip Rideout 473824b15e Introduce JavaScript API using embind.
This adds filamentjs to libs, which builds a Filament-only WASM file.
Unlike our existing web demos, this WASM file contains no application
code.

These bindings are by no means complete, but they are sufficient for a
"hello triangle" demo that I have working locally. Sneak peak of the
Triangle JS app code:

    https://gist.github.com/prideout/e9d6dd0e312146c8a287d2d109affa4d

This commit merely adds the bindings to the build. Demos and docs are
forthcoming.
2018-10-12 17:09:52 -07:00
Mathias Agopian b4c77166b7 fix normals when skinning with non-uniform scales 2018-10-11 18:46:42 -07:00
Mathias Agopian 920113b076 fix a typo that caused skinning to just not work sceneform-1.6pr4 2018-10-11 16:50:52 -07:00
Philip Rideout 2a10f8122d Remove STB from web samples.
Every texture now uses KTX, so there is no need to fatten the WASM with
a PNG decoder.
2018-10-11 11:34:05 -07:00
Philip Rideout 182d95c6ce Use filamat file instead of inc in a web sample.
For test coverage, ensure that one of our C++ based web samples
uses a filamat file instead of inc, because this is how the JS based
web samples will work.

This makes pre-zipped triangle wasm go from 747 KB to 741 KB.
2018-10-11 10:22:48 -07:00
Philip Rideout ed76aa04ca Shrink WASM files 30% by excluding VK materials. 2018-10-11 09:43:21 -07:00
Jonas Karlsson 76035711f4 Fix documentation typo (#368) 2018-10-11 08:53:51 -07:00
Philip Rideout 7959f31ebf OpenGL Backend fix for INVALID_OPERATION regression.
Recent changes to UBO management introduce the possibility of calling
glBufferSubData on zero-length regions, which cause a cascade of
GL_INVALID_OPERATION with the Suzanne WebGL demo. Note that the WebGL
variant of BufferSubData has special behavior when length = 0.

This also seems like a potentially useful optimization for non-web
platforms, since a CPU branch is likely cheaper than a GL entry point.

This commit also seems to fix a segfault seen with the "vk_imgui" sample
after changing its backend to OPENGL.

Fixes #366
2018-10-10 14:01:13 -07:00
Philip Rideout 10a3addf1a Filaweb now uses compression for the IBL.
The web build now invokes cmgen three times for each IBL: uncompressed,
S3TC (desktop), and ETC (mobile). Alternatively, we could enhance cmgen
to accept multiple compression strings, but per discussion with Mathias
we decided to keep it simple.

I decided not to use compression for the skybox in our web demos because
the quality is too poor (see PR image). I did not try playing with
compression settings, might be worth revisiting in the future.
2018-10-10 12:09:25 -07:00
Romain Guy 89982e6e97 Improve APIs for Kotlin usage (#361) 2018-10-10 10:13:07 -07:00