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:
Rezmason
2021-12-24 21:33:39 -08:00
parent a962a6128d
commit 928067996d
20 changed files with 113 additions and 35 deletions

View File

@@ -3,6 +3,7 @@ precision mediump float;
uniform sampler2D tex;
uniform sampler2D bloomTex;
uniform float bloomStrength;
uniform float ditherMagnitude;
uniform float time;
uniform vec3 backgroundColor;
@@ -38,7 +39,7 @@ void main() {
// Mix the texture and bloom based on distance from center,
// to approximate a lens blur
vec3 brightness = mix(
texture2D( bloomTex, vUV ).rgb,
texture2D( bloomTex, vUV ).rgb * bloomStrength,
texture2D( tex, vUV ).rgb,
(0.7 - length(vUV - 0.5))
) * 1.25;