mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-18 22:29:28 -07:00
Matrix React component 1.0.0
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { loadText, makePassFBO, makePass } from "./utils.js";
|
||||
import { makePassFBO, makePass } from "./utils.js";
|
||||
import quiltPassFrag from "../../shaders/glsl/quiltPass.frag.glsl";
|
||||
|
||||
// Multiplies the rendered rain and bloom by a loaded in image
|
||||
|
||||
@@ -10,7 +11,7 @@ export default ({ regl, config, lkg }, inputs) => {
|
||||
}
|
||||
|
||||
const output = makePassFBO(regl, config.useHalfFloat);
|
||||
const quiltPassFrag = loadText("shaders/glsl/quiltPass.frag.glsl");
|
||||
|
||||
const render = regl({
|
||||
frag: regl.prop("frag"),
|
||||
uniforms: {
|
||||
@@ -23,11 +24,11 @@ export default ({ regl, config, lkg }, inputs) => {
|
||||
{
|
||||
primary: output,
|
||||
},
|
||||
Promise.all([quiltPassFrag.loaded]),
|
||||
null,
|
||||
(w, h) => output.resize(w, h),
|
||||
(shouldRender) => {
|
||||
if (shouldRender) {
|
||||
render({ frag: quiltPassFrag.text() });
|
||||
render({ frag: quiltPassFrag });
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user