mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
27 lines
595 B
JavaScript
27 lines
595 B
JavaScript
import { loadText, make1DTexture, makePassFBO, makePass } from "./utils.js";
|
|
|
|
export default (regl, config, inputs) => {
|
|
const output = makePassFBO(regl, config.useHalfFloat);
|
|
const { backgroundColor } = config;
|
|
const resurrectionPassFrag = loadText("../shaders/resurrectionPass.frag");
|
|
|
|
const render = regl({
|
|
frag: regl.prop("frag"),
|
|
|
|
uniforms: {
|
|
backgroundColor,
|
|
tex: inputs.primary,
|
|
bloomTex: inputs.bloom,
|
|
ditherMagnitude: 0.05,
|
|
},
|
|
framebuffer: output,
|
|
});
|
|
|
|
return makePass(
|
|
{
|
|
primary: output,
|
|
},
|
|
() => render({ frag: resurrectionPassFrag.text() })
|
|
);
|
|
};
|