This makes our createTexture* helpers more consistent with the
createMaterial helper, and extends the wrapped Engine class with new
methods.
Before, clients did something like this:
const ao = Filament.createTextureFromPng(Filament.assets['foo.png'], engine);
...
engine.destroyTexture(ao);
Now, they can do:
const ao = engine.createTextureFromPng('foo.png');
...
engine.destroyTexture(ao);
This is more symmetric and concise. In general the JS API now supports a
class of "buffer-like" objects which exploit dynamic typing in order to
accept any of the following: BufferDescriptor, asset string, or
Uint8Array.
This test recreates a renderable every few frames and dumps the heap
pointer to the console so we can check if it increases over time.
Also simplified the personal web server script so that it uses twisted
and avoid doing a chdir, seems to be more reliable this way.
We were not normalizing one of the orthonormal basis vectors, causing
the visual aberration reported in #423.
This CL also add a "back light" to the redball demo to lighten up the
dark area in the IBL.
Fixes#423
Shameless recreation of the Android `textured-android` sample. I will
make this into a tutorial soon.
Also made some improvements to the test-builder Python script. Really,
this script exists only to make iteration easier; we need a better
solution for automated tests...
- move UBO declarations in UibGenerator, i.e. next
to their Uniform Interface Block definition.
This should help forgetting to update one but
not the other.
- move UniformInterfaceBlock.h and SamplerInferfaceBlock.h under
private/filament/.
- do the same things for samplers
The docgen script now looks for /// comments in the binding definitions,
and generates markdown from those. The reference page has three
sections: classes, free functions, and enums.
Before this CL, the web archive had two folders: "public" (which
contained web demos written in C++) and "filamentjs" (for the barebones
WASM).
After this CL, the web archive will instead have "dist" and "docs". The
dist folder will have the WASM and accompanying JS file, while the docs
folder has the tutorials and their accompanying demos.
If your machine has Python 3 installed, then "build -ap webgl" will
attempt to generate the JavaScript docs. If Python 3 isn't available,
this build step will be skipped. Note that our Kokoro macOS machines
already have Python 3 pre-installed.
Also removed the pipenv file to simplify the Kokoro Python environment.
Fixes#394.
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.
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.
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.
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.
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.