mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
WebGPU and REGL projects now flipY again, and they properly flip the symbolY glyph coordinate in the rain pass's fragment shader. Switching on some older code that was disabled for FF Nightly support— it makes more sense to wait for that support as implementations finalize. Added mipmap to images loaded into REGL project.
35 lines
748 B
JavaScript
35 lines
748 B
JavaScript
import { loadText, makePassFBO, makePass } from "./utils.js";
|
|
|
|
// Multiplies the rendered rain and bloom by a loaded in image
|
|
|
|
export default ({ regl, config, lkg }, inputs) => {
|
|
if (!lkg.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),
|
|
(shouldRender) => {
|
|
if (shouldRender) {
|
|
render({ frag: quiltPassFrag.text() });
|
|
}
|
|
}
|
|
);
|
|
};
|