Renaming some variables

This commit is contained in:
Rezmason
2021-10-20 01:13:55 -07:00
parent 7ec03bbeb1
commit 5902ecc625
3 changed files with 9 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ const defaultBGURL =
export default (regl, config, inputs) => {
const output = makePassFBO(regl, config.useHalfFloat);
const bgURL = "bgURL" in config ? config.bgURL : defaultBGURL;
const bgLoader = loadImage(regl, bgURL);
const background = loadImage(regl, bgURL);
return makePass(
{
primary: output
@@ -16,23 +16,23 @@ export default (regl, config, inputs) => {
precision mediump float;
uniform sampler2D tex;
uniform sampler2D bloomTex;
uniform sampler2D bgTex;
uniform sampler2D backgroundTex;
varying vec2 vUV;
void main() {
vec3 bgColor = texture2D(bgTex, vUV).rgb;
vec3 bgColor = texture2D(backgroundTex, vUV).rgb;
float brightness = pow(min(1., texture2D(tex, vUV).r * 2.) + texture2D(bloomTex, vUV).r, 1.5);
gl_FragColor = vec4(bgColor * brightness, 1.0);
}
`,
uniforms: {
bgTex: bgLoader.texture,
backgroundTex: background.texture,
tex: inputs.primary,
bloomTex: inputs.bloom
},
framebuffer: output
}),
null,
bgLoader.ready
background.loaded
);
};