https://github.com/dimforge/wgmath.rs
Website for the wgmath ecosystem
https://github.com/dimforge/wgmath.rs
Last synced: 4 days ago
JSON representation
Website for the wgmath ecosystem
- Host: GitHub
- URL: https://github.com/dimforge/wgmath.rs
- Owner: dimforge
- License: apache-2.0
- Created: 2024-11-12T21:28:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-21T21:30:51.000Z (11 months ago)
- Last Synced: 2026-03-03T09:33:22.118Z (7 days ago)
- Language: HTML
- Size: 21.5 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Website
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
### Installation
```
$ yarn
```
### Build
```
$ yarn build
```
This command generates static content into the `build` directory and can be served using any static contents hosting service.
```
$ yarn start
```
This command builds and starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
# WASM loading
Uncompressed, the `.wasm` file from wgsparkl2d demo weighs ~40 MB ; after wasm-opt, it's down to ~25MB.
We can go further by serving a compressed wasm file: using brotli reduces the size to ~5.6MB :tada:.
Now serving compressed wasm is not totally trivial, so our current setup is detailed below:
Manual steps:
- compress `.wasm` with brotli
- rename `.wasm.br` to `.wasm` (so we can keep javascript glue code generated by wasm-bindgen)
Automatic steps:
- `.htaccess` tells apache to consider `.wasm` files as encoding `br` and content type `application/wasm`.
- browser will be able to read correctly the brotlified wasm and run it :tada:.
## To test locally:
- You can use apache locally to approach the server environment.
- Rewrite rules will get in the way, you can remove them temporarily.
- If you use a subfolder of your apache's `www` ; website will complain about docusaurus' `baseUrl`,
which you can update, but it's not relevant to test wasm files.
- Local apache doesn't allow .htaccess by default ; you can enable it within your apached2.conf with `AllowOverride All` for your directory.
Your browser might not be compatible, at the time of writing, chrome is most likely to support the demos, and the following flags might be relevant:
- chrome://flags/#enable-unsafe-webgpu
- chrome://flags/#enable-vulkan