DEV Community

Cover image for Deno X WebGPU X Threejs
James Kaguru Kihuha
James Kaguru Kihuha

Posted on

Deno X WebGPU X Threejs

As the tradition goes in computer graphics we always start by drawing our first triangle on the screen. Personally I did my first following the WebGPU Fundamentals. And as you can imagine drawing the first triangle was easy, everything after that was a steep learning curve. But today we are on a different topic. Something I've been eyeing recently which is Deno WebGPU.

For those who aren't familiar with Deno its basically a different runtime for JS, a swap in replacement for NodeJs which comes with alot of benefits such as the one I'm talking about today which Deno WebGPU.

Deno WebGPU expands the reach of the JS Developer allowing them to run their graphics application natively on the users device rather than in a browser enviroment which has the benefit of less overhead and something which I'm really excited about is the reduced network cost of transfering large gltf models (These are basically the the 3d objects that get rendered). With this out of the way you can now focus on creating a good 3d epxerience using Deno which can compile your 3d application into an executable than can be run on various platforms i.e macOS, Windows and Linux using Deno compile.(At the moment deno doesn't support targeting Android)

And as you can imagine inorder to create 3d applications you require a decent renderer and thats where threejs comes in. Threejs allows you to define your scene in JS and render them on a screen. Ideally threejs works on the browser but with a few tweaks here and there you can have threejs running on your native application.

Anyway I've created a threejs starter repo to help track how the changes in threejs affect rendering on deno and you can download or even fork the repo to try it out.

https://github.com/james-kaguru/threejs_starter/tree/dev

Cheers. 🍻

Top comments (0)