Commit Graph
8 Commits
Author SHA1 Message Date
Powei Feng d49eb5e111 webgpu: add initial WebGPU support on Emscripten
This commit introduces the initial implementation for WebGPU on the
web via Emscripten. It enables the WebGPU backend in Filament when
compiling for WebAssembly, allowing both WebGL and WebGPU to be
shipped in the same filament.wasm binary.

Major changes:
- Build & CMake: Configured the WASM build to append the linker flag
  `--use-port=emdawnwebgpu` and enable the WebGPU backend alongside WebGL.
- Platform Bridge: Added `WebGPUPlatformWasm`, connecting Filament's
  WebGPU backend to the browser via `emscripten_webgpu_get_device()`.
- JS Bindings: Updated `utilities.js`, `extensions.js`, and `wasmloader.js`
  to support asynchronous WebGPU adapter and device initialization
  (`initWebGPU()`), skipping WebGL initialization when WEBGPU is selected.
- Workarounds: Integrated polyfills for Emscripten Dawn limitations,
  including bypassing buggy pipeline layout bindings for `immediateSize`
  and disabling unsupported WASM features like `TransientAttachments`.
2026-05-01 17:02:08 -07:00
Powei Feng 9b2959d3a4 web: fix redball and fl0 examples (#9942)
- Remove conditional forgotten by #9897
   Fixes cube_fl0 example
 - Add byte array view methods that are no longer exported by
   default in emscripten 5.0.4 (#9921)
   Fixes redball tutorial
2026-04-30 17:58:16 +00:00
Powei Feng 96b8015fb4 web: rename WEBGL to WASM for cmake (#9941)
This is a more accurate name because it specifies the platform and
not the graphics API.
2026-04-29 22:21:25 +00:00
Mathias Agopian e85c021dec remove the now unneeded FL0 materials
Filament needed to compile FL0 materials for both FL0 and FL1, but this
is now done automatically when a material is a FL0 material.
2026-04-15 09:20:26 -07:00
StreetwareGames defba15173 update the cached image too 2026-04-13 13:58:32 -07:00
StreetwareGames 4b4074450a fix milkyway image url 2026-04-13 13:58:32 -07:00
Mathias AgopianandPowei Feng 4b040fbae6 A new Sky simulation Web demo (#9828)
* sky simulation sample

Also added documentation on how to add another web sample

---------

Co-authored-by: Powei Feng <powei@google.com>
2026-03-26 22:40:34 -07:00
Powei Feng a73957a590 web: refactor examples and tutorials (#9833)
* Refactor web examples and tutorials

- Consolidate web/docs and web/samples into web/examples
- Remove literal programming blocks from Markdown tutorials
- Replace tutorial_template.html with a fully embedded template in serve.py
- Move serve.py to web/examples/serve.py and update dependency rules
- Update filament-js wrapper to expose _malloc, _free and set GEN_MIPMAPPABLE usage
- Update sample materials and WebGL asset generation within web/examples/CMakeLists.txt
- Add python venv instructions and usage details to web/README.md
- Remove obsolete examples, Pipfile, and demo templates

* Transfer web tutorials and samples to docs_src

- Introduce copy_web_docs.py api to deploy and rewrite web sample outputs into the docs output tree
- Hook copy_web_docs into docs_src/build/run.py natively
- Configure duplicates.json to map WebGL outputs to embedded .md docs
- Strip html skeleton out of examples in run.py so they map into markdown cleanly
- Update update-docs workflow to pre-build the WebGL target
- Remove obsolete remote docs path from src_raw
- Add explanatory comments to copy_web_docs.py and run.py
- Add index page with thumbnails for Web Tutorials and samples
2026-03-25 23:52:48 +00:00