This repository is now archived as I don't have time to track WebGPU changes...
Worry not :) I see that WebGPU enthusiast are starting to provide simple and updated WebGPU starters, check this one for example: https://github.com/monfera/minimal-webgpu-triangle
WebGPU/WGSL Hello Triangle!
An example of how to render a triangle with WebGPU using WebGPU Shading Language - the "Hello World!" of computer graphics. Details in blog post: https://en.morzel.net/post/webgpu-wgsl-hello-triangle
What it does?
If your browser supports WebGPU and WGSL, you should be able to see a gray square with a green triangle in the center. And that's it.
Live example: https://morzel85.github.io/webgpu-wgsl-hello-triangle/index.html
WebGPU and WGSL are work in progress!
Please mind that WebGPU and WGSL specs are not finalized and implementations are changing! Visit webgpu.io to check current status.
Keep it simple!
Is it possible to simplify the code further? Teach me how! :)
Test results (2021-03-25)
- Renders properly and without warnings in Chrome Canary v91.0.4457.2 x64 Win 10 with --enable-unsafe-webgpu flag set.
Code is based on https://github.com/austinEng/webgpu-samples