diff --git a/README.md b/README.md index b9a6a54..0a639e4 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ --- ### about -This project is a web implementation of the raining green code seen in the *Matrix* franchise. It's built right on top of the upcoming graphics API [WebGPU](https://github.com/gpuweb/gpuweb), but falls back to the functional WebGL wrapper, [REGL](https://regl.party); its previous Three.js version is maintained in a separate branch. +This project is a web implementation of the raining green code seen in the *Matrix* franchise. It's built right on top of the functional WebGL wrapper, [REGL](https://regl.party), with beta support for the upcoming graphics API [WebGPU](https://github.com/gpuweb/gpuweb); its previous Three.js version is maintained in a separate branch. --- ### goals diff --git a/js/config.js b/js/config.js index 7b9317f..cc08a5e 100644 --- a/js/config.js +++ b/js/config.js @@ -108,7 +108,7 @@ const defaults = { slant: 0, // The angle at which rain falls; the orientation of the glyph grid resolution: 0.75, // An overall scale multiplier useHalfFloat: false, - renderer: "webgpu", // The preferred web graphics API + renderer: "regl", // The preferred web graphics API isometric: false, useHoloplay: false, loops: false, diff --git a/js/main.js b/js/main.js index dca7bd6..4268bf3 100644 --- a/js/main.js +++ b/js/main.js @@ -13,7 +13,7 @@ const supportsWebGPU = async () => { document.body.onload = async () => { const urlParams = Object.fromEntries(new URLSearchParams(window.location.search).entries()); const config = makeConfig(urlParams); - const useREGL = !(await supportsWebGPU()) || ["webgl", "regl"].includes(config.renderer?.toLowerCase()); - const solution = import(`./${useREGL ? "regl" : "webgpu"}/main.js`); + const useWebGPU = (await supportsWebGPU()) && ["webgpu"].includes(config.renderer?.toLowerCase()); + const solution = import(`./${useWebGPU ? "webgpu" : "regl"}/main.js`); (await solution).default(canvas, config); };