mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-17 13:59:30 -07:00
More cleanup
This commit is contained in:
23
js/utils.js
23
js/utils.js
@@ -99,7 +99,7 @@ const makeFullScreenQuad = (regl, uniforms = {}, context = {}) =>
|
||||
count: 3
|
||||
});
|
||||
|
||||
const makePalette = (regl, data) =>
|
||||
const make1DTexture = (regl, data) =>
|
||||
regl.texture({
|
||||
data,
|
||||
width: data.length / 3,
|
||||
@@ -109,6 +109,24 @@ const makePalette = (regl, data) =>
|
||||
min: "linear"
|
||||
});
|
||||
|
||||
const makePass = (output, render, resize) => {
|
||||
if (render == null) {
|
||||
render = () => {};
|
||||
}
|
||||
if (resize === undefined) {
|
||||
// "default" resize function is on the FBO
|
||||
resize = (w, h) => output.resize(w, h);
|
||||
}
|
||||
if (resize == null) {
|
||||
resize = () => {};
|
||||
}
|
||||
return {
|
||||
output,
|
||||
render,
|
||||
resize
|
||||
};
|
||||
};
|
||||
|
||||
export {
|
||||
makePassTexture,
|
||||
makePassFBO,
|
||||
@@ -118,5 +136,6 @@ export {
|
||||
loadImage,
|
||||
loadImages,
|
||||
makeFullScreenQuad,
|
||||
makePalette
|
||||
make1DTexture,
|
||||
makePass
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user