More code cleanup. Replacing Neapolitan ice cream stripes with trans flag stripes.

This commit is contained in:
Rezmason
2021-10-20 09:19:06 -07:00
parent 4e88f68560
commit 28d38b032f
7 changed files with 57 additions and 55 deletions

View File

@@ -1,24 +1,15 @@
import { loadText, extractEntries, make1DTexture, makePassFBO, makePass } from "./utils.js";
const colorToRGB = ([hue, saturation, lightness]) => {
const a = saturation * Math.min(lightness, 1 - lightness);
const f = (n) => {
const k = (n + hue * 12) % 12;
return lightness - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));
};
return [f(0), f(8), f(4)];
};
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: {
...extractEntries(config, ["backgroundColor"]),
backgroundColor,
tex: inputs.primary,
bloomTex: inputs.bloom,
ditherMagnitude: 0.05,