Add camera setup to WebGPU project

This commit is contained in:
Rezmason
2022-08-07 21:21:50 -07:00
parent 6aa025870c
commit e024f4bd4d
2 changed files with 10 additions and 0 deletions

View File

@@ -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

View File

@@ -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();