mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
37 lines
959 B
JavaScript
37 lines
959 B
JavaScript
import { loadText, make1DTexture, makePassFBO, makePass } from "./utils.js";
|
|
|
|
// Matrix Resurrections isn't in theaters yet,
|
|
// and this version of the effect is still a WIP.
|
|
|
|
// Criteria:
|
|
// Upward-flowing glyphs should be golden
|
|
// Downward-flowing glyphs should be tinted slightly blue on top and golden on the bottom
|
|
// Cheat a lens blur, interpolating between the texture and bloom at the edges
|
|
|
|
export default (regl, config, inputs) => {
|
|
const output = makePassFBO(regl, config.useHalfFloat);
|
|
const { backgroundColor } = config;
|
|
const resurrectionPassFrag = loadText("shaders/resurrectionPass.frag.glsl");
|
|
|
|
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() }),
|
|
null,
|
|
resurrectionPassFrag.loaded
|
|
);
|
|
};
|