* 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
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.
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.
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.
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.
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
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.
The UniformBuffer class is moved out of the Driver,
and the driver api now takes a BufferDescriptor
as input of updateUniformBuffer. This makes it
more generic.
As an added benefit, we can now allocate the
uploaded uniform data directly into the
command stream, which saves synchronization points.
This change will allow the skybox use a compressed texture format.
For now, the old internal format "RGBM" is still honored, but in a
forthcoming change we will replace the enum with UNUSED.
* Add support for save/replay of the current view.
* Add support for having distinct draw/read surfaces.
Adds support to egl & glx drivers for distring draw/read surfaces and
uses this support to implement mirrorFrame using a single blit.
* Use src/dst, Viewport, clean up apis.
* Add SwapChain READABLE Config.
* Commit & setPresentationTime optional on mirror.
* Fix flag check.
* Add documentation for READABLE swap chain config.
* Fix missed s/ExternalContext/Platform/ cases.
* Build break fix.