diff --git a/js/camera.js b/js/camera.js index f229615..9409fc9 100644 --- a/js/camera.js +++ b/js/camera.js @@ -14,12 +14,15 @@ const drawToCanvas = () => { const setupCamera = async () => { try { - const stream = await navigator.mediaDevices.getUserMedia({video: { - width: { min: 800, ideal: 1280 }, - frameRate: { ideal: 60 } - }, audio: false}); + const stream = await navigator.mediaDevices.getUserMedia({ + video: { + width: { min: 800, ideal: 1280 }, + frameRate: { ideal: 60 }, + }, + audio: false, + }); const videoTrack = stream.getVideoTracks()[0]; - const {width, height} = videoTrack.getSettings(); + const { width, height } = videoTrack.getSettings(); video.width = width; video.height = height; diff --git a/js/config.js b/js/config.js index b3702d3..e1b532b 100644 --- a/js/config.js +++ b/js/config.js @@ -92,7 +92,7 @@ const defaults = { ], raindropLength: 1, // Adjusts the frequency of raindrops (and their length) in a column slant: 0, // The angle at which rain falls; the orientation of the glyph grid - resolution: .75, // An overall scale multiplier + resolution: 0.75, // An overall scale multiplier useHalfFloat: false, renderer: "webgpu", // The preferred web graphics API useHoloplay: false, @@ -179,7 +179,7 @@ const versions = { fallSpeed: 0.35, cycleStyle: "cycleRandomly", cycleSpeed: 0.8, - glyphEdgeCrop: .1, + glyphEdgeCrop: 0.1, paletteEntries: [ { hsl: [0.39, 0.9, 0.0], at: 0.0 }, { hsl: [0.39, 1.0, 0.6], at: 0.5 }, diff --git a/js/regl/mirrorPass.js b/js/regl/mirrorPass.js index 4beeafa..c5b0606 100644 --- a/js/regl/mirrorPass.js +++ b/js/regl/mirrorPass.js @@ -12,10 +12,9 @@ window.onclick = (e) => { clicks[index * 3 + 1] = 1 - e.clientY / e.srcElement.clientHeight; clicks[index * 3 + 2] = (Date.now() - start) / 1000; index = (index + 1) % numClicks; -} +}; export default ({ regl, config }, inputs) => { - const cameraTex = regl.texture(cameraCanvas); const output = makePassFBO(regl, config.useHalfFloat); @@ -29,7 +28,7 @@ export default ({ regl, config }, inputs) => { cameraTex, clicks: () => clicks, aspectRatio: () => aspectRatio, - cameraAspectRatio: () => cameraAspectRatio + cameraAspectRatio: () => cameraAspectRatio, }, framebuffer: output, });