Skip to content

Latest commit

 

History

History
29 lines (15 loc) · 1.31 KB

File metadata and controls

29 lines (15 loc) · 1.31 KB

Requirements

A compatible WebGPU browser since it's currently in development

Currently working on Chrome 113 (Windows and Mac tested)

Working on Firefox Nightly, only video texture is pending.

WebGPU API reference (JavaScript): https://gpuweb.github.io/gpuweb/

WGSL reference: https://gpuweb.github.io/gpuweb/wgsl/

Syntax highlight and IDE

We use VSCode with WGSL Literal; if you have a different IDE with WGSL hightlight go for it.


You might have noticed or will notice the modules are actually JavaScript modules and imported to vert.js, compute.js, and frag.js which are then again JavaScript files, no WGSL files. This is based on a recommendation by Brandon Jones from Google, so we take advantage of the power of the JavaScript string interpolation, instead of creating fetch calls to import wgsl files, so we can just simply interpolate the modules in our projects. Also, there's currently no way to create or import WGSL modules in other files.

The simpler route we took is just to declare a single function, struct or constant as a JavaScript export, and then import them as you do, and then interpolate the reference with the same name.