Skip to content

brunoperry/gizmo_wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gizmo Engine (wasm)

picture alt

About

3D software renderer written in C, compiled to wasm (via wasi) and controlled by Javascript. Its an hobby project for learning purposes only.

Features

  • OBJ model loader (mesh data only)
  • Z-buffering
  • Flat shading (directional lighting)
  • Wireframe, shaded and textured render modes

Check it out

https://brunoperry.github.io/gizmo_wasm/web/

Test it

Clone the repo and run index.html on localhost, no dependencies needed.

Playing with different models

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).

Development

To compile your C code/changes, make sure you have wasi installed then update your .makefile --sysroot directory accordingly (line 9).

I'm developing this project on MacOs (Ventura) and testing with chromium. If you have a different environment, it may not compile/work properly :(

Bugs

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!

About

3d software render (C->wasm->js)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published