rainPass now renders multiple cameras and viewports, using data from the hardware.

Added quiltPass (which uses holoplay’s quilting shader).
Added a holoplay effect version. (Versions can also now specify a preferred renderer.)
This commit is contained in:
Rezmason
2021-12-15 07:20:33 -08:00
parent 68ad689e1e
commit 2364bbc8bc
7 changed files with 1047 additions and 12 deletions

34
js/regl/quiltPass.js Normal file
View File

@@ -0,0 +1,34 @@
import { loadImage, loadText, makePassFBO, makePass } from "./utils.js";
// Multiplies the rendered rain and bloom by a loaded in image
export default ({ regl, config, lkg }, inputs) => {
let enabled = lkg.tileX * lkg.tileY > 1;
// enabled = false;
if (!enabled) {
return makePass({
primary: inputs.primary,
});
}
const output = makePassFBO(regl, config.useHalfFloat);
const quiltPassFrag = loadText("shaders/glsl/quiltPass.frag.glsl");
const render = regl({
frag: regl.prop("frag"),
uniforms: {
quiltTexture: inputs.primary,
...lkg,
},
framebuffer: output,
});
return makePass(
{
primary: output,
},
Promise.all([quiltPassFrag.loaded]),
(w, h) => output.resize(w, h),
() => render({ frag: quiltPassFrag.text() })
);
};