From e024f4bd4dd96c85db2f031c9b4b8d49c9a8f1fb Mon Sep 17 00:00:00 2001 From: Rezmason Date: Sun, 7 Aug 2022 21:21:50 -0700 Subject: [PATCH] Add camera setup to WebGPU project --- TODO.txt | 5 +++++ js/webgpu/main.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/TODO.txt b/TODO.txt index 57115d1..2264ed7 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,5 +1,10 @@ TODO: +Add mirror effect to WebGPU + +Reformulate the basis + https://buf.com/films/the-matrix-resurrections + Resurrections Support random glyph order Support annomaly streaks diff --git a/js/webgpu/main.js b/js/webgpu/main.js index edfa107..f452ad7 100644 --- a/js/webgpu/main.js +++ b/js/webgpu/main.js @@ -8,6 +8,7 @@ import makeStripePass from "./stripePass.js"; import makeImagePass from "./imagePass.js"; import makeResurrectionPass from "./resurrectionPass.js"; import makeEndPass from "./endPass.js"; +import { setupCamera } from "../camera.js"; const loadJS = (src) => new Promise((resolve, reject) => { @@ -34,6 +35,10 @@ const effects = { export default async (canvas, config) => { await loadJS("lib/gl-matrix.js"); + if (config.useCamera) { + await setupCamera(); + } + const canvasFormat = navigator.gpu.getPreferredCanvasFormat(); const adapter = await navigator.gpu.requestAdapter(); const device = await adapter.requestDevice();