3D software renderer written in C, compiled to wasm (via wasi) and controlled by Javascript. Its an hobby project for learning purposes only.
- OBJ model loader (mesh data only)
- Z-buffering
- Flat shading (directional lighting)
- Wireframe, shaded and textured render modes
https://brunoperry.github.io/gizmo_wasm/web/
Clone the repo and run index.html on localhost, no dependencies needed.
Open the /web/resources/data.json
file and add/edit your new object (name, url, texture). Also include/edit your new texture (name, url).
Next, open the script.js
file, change the Demo class to add your new model to the scene (line 50).
To compile your C code/changes, make sure you have wasi installed then update your .makefile --sysroot
directory accordingly (line 9).
- WASI -> https://wasi.dev
I'm developing this project on MacOs (Ventura) and testing with chromium. If you have a different environment, it may not compile/work properly :(
A lot of them. The most noticable being:
- x clipping.
- Frame rate below 60.
- Camera not working properly.
- "Monkey Pressing" play/pause button messes with cursor lock (UI).
- Occasional crash.
- ...
Have fun!