WGLFX (“WebGL Effects” or “wiggle fix”) is a WebGL2 playground app written in ES module JavaScript. The project’s main goal is to create a simple tool to play directly with shader code, but allow for (and create tools to easily facilitate) advanced, multi-pass set-ups. Currently a work in progress and is mostly still a proof of concept. So far: supports a one-pass basic vert/frag shader setup, some simple mesh data, some UBO variable capability, multiple projects and some basic project management. The primary feature of editing shader code in real time is implemented, with a feature rich editor and in-line compile error indicators.
Feel free to play with this Live Version, but do expect many bugs and probably incompatible project saves as development continues.
Supports some keyboard shortcuts:
Win | Mac | Function |
---|---|---|
Ctrl+S | ⌘ S | Save current shader code and mesh data to local storage. Will reload code and data on next page load. |
Ctrl+E | ⌘ E | Toggle UI |
This project includes a WebAssembly Z85 encoder/decoder based on the C code from the Z85 reference spec. To facilitate the wasm module and its build pipeline this project also includes some useful generic tools for working with WebAssembly.
WASM.mjs
/wasm.h
: A basic wasm module handler class and corresponding header. Designed to run small modules with no standard library or memory allocation requirements. Facilitates the basics of loading the compiled wasm module and communicating between the JavaScript and WebAssembly runtimes.- See
WASMTest.mjs
/test.c
for a simple example. build_wasm
: A sample build script intended to build very small WebAssembly modules. Usesclang
and llvm'swasm-ld
directly.
Usage:
./build_wasm test.c test.wasm
Library/Function | Credit |
---|---|
Ace text editor | Ace |
Coloris color picker | Coloris |
wasm minimal setup, wasm build script | ern0 |
WASM_EXPORT | jaredkrinke |