mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-20 23:09:30 -07:00
The primary and bloom textures are now combined with a weight so that fainter bloom doesn't create a fainter overall effect.
This commit is contained in:
@@ -7,11 +7,13 @@ const defaultBGURL = "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/
|
||||
export default ({ regl, config }, inputs) => {
|
||||
const output = makePassFBO(regl, config.useHalfFloat);
|
||||
const bgURL = "bgURL" in config ? config.bgURL : defaultBGURL;
|
||||
const bloomStrength = config.bloomStrength;
|
||||
const background = loadImage(regl, bgURL);
|
||||
const imagePassFrag = loadText("shaders/glsl/imagePass.frag.glsl");
|
||||
const render = regl({
|
||||
frag: regl.prop("frag"),
|
||||
uniforms: {
|
||||
bloomStrength,
|
||||
backgroundTex: background.texture,
|
||||
tex: inputs.primary,
|
||||
bloomTex: inputs.bloom,
|
||||
|
||||
@@ -65,7 +65,7 @@ const makePalette = (regl, entries) => {
|
||||
export default ({ regl, config }, inputs) => {
|
||||
const output = makePassFBO(regl, config.useHalfFloat);
|
||||
const palette = makePalette(regl, config.paletteEntries);
|
||||
const { backgroundColor, ditherMagnitude } = config;
|
||||
const { backgroundColor, ditherMagnitude, bloomStrength } = config;
|
||||
|
||||
const palettePassFrag = loadText("shaders/glsl/palettePass.frag.glsl");
|
||||
|
||||
@@ -75,6 +75,7 @@ export default ({ regl, config }, inputs) => {
|
||||
uniforms: {
|
||||
backgroundColor,
|
||||
ditherMagnitude,
|
||||
bloomStrength,
|
||||
tex: inputs.primary,
|
||||
bloomTex: inputs.bloom,
|
||||
palette,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { loadText, make1DTexture, makePassFBO, makePass } from "./utils.js";
|
||||
|
||||
export default ({ regl, config }, inputs) => {
|
||||
const output = makePassFBO(regl, config.useHalfFloat);
|
||||
const { backgroundColor, ditherMagnitude } = config;
|
||||
const { backgroundColor, ditherMagnitude, bloomStrength } = config;
|
||||
const resurrectionPassFrag = loadText("shaders/glsl/resurrectionPass.frag.glsl");
|
||||
|
||||
const render = regl({
|
||||
@@ -19,6 +19,7 @@ export default ({ regl, config }, inputs) => {
|
||||
uniforms: {
|
||||
backgroundColor,
|
||||
ditherMagnitude,
|
||||
bloomStrength,
|
||||
tex: inputs.primary,
|
||||
bloomTex: inputs.bloom,
|
||||
},
|
||||
|
||||
@@ -31,7 +31,7 @@ const prideStripeColors = [
|
||||
export default ({ regl, config }, inputs) => {
|
||||
const output = makePassFBO(regl, config.useHalfFloat);
|
||||
|
||||
const { backgroundColor, ditherMagnitude } = config;
|
||||
const { backgroundColor, ditherMagnitude, bloomStrength } = config;
|
||||
|
||||
// Expand and convert stripe colors into 1D texture data
|
||||
const stripeColors =
|
||||
@@ -50,6 +50,7 @@ export default ({ regl, config }, inputs) => {
|
||||
uniforms: {
|
||||
backgroundColor,
|
||||
ditherMagnitude,
|
||||
bloomStrength,
|
||||
tex: inputs.primary,
|
||||
bloomTex: inputs.bloom,
|
||||
stripes,
|
||||
|
||||
Reference in New Issue
Block a user