mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
A little reorganization of methods in the passes.
This commit is contained in:
@@ -30,6 +30,10 @@ export default (context, getInputs) => {
|
||||
const bgURL = "bgURL" in config ? config.bgURL : defaultBGURL;
|
||||
const assets = [loadTexture(device, bgURL), loadShader(device, "shaders/wgsl/imagePass.wgsl")];
|
||||
|
||||
const getOutputs = () => ({
|
||||
primary: output,
|
||||
});
|
||||
|
||||
const ready = (async () => {
|
||||
const [bgTex, imageShader] = await Promise.all(assets);
|
||||
|
||||
@@ -57,10 +61,6 @@ export default (context, getInputs) => {
|
||||
output = makePassFBO(device, width, height, canvasFormat);
|
||||
};
|
||||
|
||||
const getOutputs = () => ({
|
||||
primary: output,
|
||||
});
|
||||
|
||||
const execute = (encoder) => {
|
||||
const inputs = getInputs();
|
||||
const tex = inputs.primary;
|
||||
|
||||
@@ -100,6 +100,10 @@ export default (context, getInputs) => {
|
||||
let paletteBuffer;
|
||||
let output;
|
||||
|
||||
const getOutputs = () => ({
|
||||
primary: output,
|
||||
});
|
||||
|
||||
const assets = [loadShader(device, "shaders/wgsl/palettePass.wgsl")];
|
||||
|
||||
const ready = (async () => {
|
||||
@@ -134,10 +138,6 @@ export default (context, getInputs) => {
|
||||
output = makePassFBO(device, width, height, canvasFormat);
|
||||
};
|
||||
|
||||
const getOutputs = () => ({
|
||||
primary: output,
|
||||
});
|
||||
|
||||
const execute = (encoder) => {
|
||||
const inputs = getInputs();
|
||||
const tex = inputs.primary;
|
||||
|
||||
@@ -92,6 +92,11 @@ export default (context, getInputs) => {
|
||||
let output;
|
||||
let highPassOutput;
|
||||
|
||||
const getOutputs = () => ({
|
||||
primary: output,
|
||||
highPass: highPassOutput,
|
||||
});
|
||||
|
||||
const ready = (async () => {
|
||||
const [msdfTexture, rainShader] = await Promise.all(assets);
|
||||
|
||||
@@ -168,11 +173,6 @@ export default (context, getInputs) => {
|
||||
highPassOutput = makePassFBO(device, width, height, canvasFormat);
|
||||
};
|
||||
|
||||
const getOutputs = () => ({
|
||||
primary: output,
|
||||
highPass: highPassOutput,
|
||||
});
|
||||
|
||||
const execute = (encoder) => {
|
||||
// We render the code into an FBO using MSDFs: https://github.com/Chlumsky/msdfgen
|
||||
|
||||
|
||||
Reference in New Issue
Block a user