q5.js
q5.js copied to clipboard
q5-webgpu: 2D rendering
The devs of the WebGL renderer for p5.js, namely Dave Pagurek, did a great job with it. I have no intention of reinventing the wheel by recreating webgl mode for q5.
WebGPU is the latest and greatest graphics API for the web. It's meant to supersede WebGL 2. It's built on the modern, low-level GPU APIs Metal, Vulkan, and Direct3D 12.
I've seen some impressive demos of it, like this one that can draw millions of boids! https://jtsorlinis.github.io/BoidsWebGPU/
Work on the WebGPU API began all the way back in 2017. WebGPU has been available in Google Chrome and Edge since April 2023. It's also been available for developer testing in Safari Technology Preview since December 2023 and in iOS Safari under a flag since March 2024. I'm guessing that Apple will enable it by default in Safari in September to coincide with the release of iOS 18. https://developer.chrome.com/docs/web-platform/webgpu/overview
I would love for q5 to have basic WebGPU rendering support by the end of July!
Basic WebGPU support in q5 will consist of drawing shapes and images in two dimensions. Although this can already be done in three.js and Babylon.js, these libraries are not as lightweight or easy to use as I hope q5-webgpu will be.
Once all that is complete, more complex rendering functionality like support for text and strokes, can be implemented.
Basic 3D drawing would be nice too but personally my focus will be on 2D. I don't think q5 should attempt to compete with three.js or Babylon.js on providing more advanced 3D capabilities.