Computer graphics toolkit for WebAssembly applications.
Rust-based graphics libraries for WebGL/WebGPU applications, mathematical computation, and game development.
Prerequisites:
rustup target add wasm32-unknown-unknown
cargo install trunkRun example:
git clone https://github.com/Wandalen/cgtools
cd cgtools/examples/minwebgl/hexagonal_grid
trunk serve --releaseAdd to Cargo.toml:
[dependencies]
minwebgl = "0.2"
tiles_tools = "0.1"
ndarray_cg = "0.3"
browser_input = "0.1"| Crate | Description |
|---|---|
minwebgl |
WebGL 2.0 toolkit |
minwebgpu |
WebGPU toolkit |
tiles_tools |
Tile-based game systems |
ndarray_cg |
Computer graphics mathematics |
browser_input |
Input handling |
browser_log |
WebAssembly logging |
renderer |
3D rendering system |
line_tools |
Line rendering |
embroidery_tools |
Embroidery pattern tools |
- Hexagonal Grid - Interactive pathfinding
- Deferred Shading - 3D rendering pipeline
- Text Rendering - GPU text rendering
- Hello Triangle - WebGPU basics
# Test workspace
cargo test --workspace
# Run example
cd examples/minwebgl/trivial
trunk serve --releaseRun the following command to test the entire project:
RUSTFLAGS="-D warnings" cargo nextest run --all-features && RUSTDOCFLAGS="-D warnings" cargo test --doc --all-features && cargo clippy --all-targets --all-features -- -D warnings