From 0475f05029d22a3c14f9791b20de74a15478e4b2 Mon Sep 17 00:00:00 2001 From: Rezmason Date: Mon, 26 Sep 2022 09:37:38 -0700 Subject: [PATCH] Switching the default renderer to regl for now, since some folks are seeing issues with the WebGPU renderer and I'm actively investigating its "bloom issues" (which seem to involve bloomStrength and texture/sampler differences) --- README.md | 2 +- js/config.js | 2 +- js/main.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) 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); };