added a bloom filter

This commit is contained in:
Alexander G. Morano
2025-03-27 22:55:26 -04:00
parent 9947ba93d6
commit 2cfe4a54f1
4 changed files with 33 additions and 32 deletions
+3 -31
View File
@@ -44,6 +44,9 @@ Please consider sponsoring me if you enjoy the results of my work, code or docum
## UPDATES
**2025/03/27** @1.1.26:
* added a bloom filter
**2025/03/18** @1.1.25:
* dunno how to work around comfyui not doing type conversion
@@ -59,37 +62,6 @@ Please consider sponsoring me if you enjoy the results of my work, code or docum
**2025/03/01** @1.1.13:
* fixed all the year dates in readme since I have been writing 2024! =D
**2025/02/23** @1.1.13:
* vector fields can now be reset by clicking on the header of the field
**2025/02/18** @1.1.12:
* removed over-zealous texture hashing for matching images [issue 7](https://github.com/Amorano/Jovi_GLSL/issues/7#issuecomment-2661241411)
**2025/02/18** @1.1.11:
* patched VECTOR type
**2025/02/18** @1.1.10:
* updated vector widget to match Jovimetrix
**2025/02/05** @1.1.02:
* polish on regex parsing for uniforms -- supports are much more lenient on spacing
**2025/02/05** @1.1.0:
* fixed value not updating when uniforms set to 0.0 [issue #4](https://github.com/Amorano/Jovi_GLSL/issues/4#issuecomment-2638367429)
**2025/02/01** @1.0.7:
* change all `JOV_ANY_IMAGE` to `IMAGE` type
* registry pyproject and code cleanup
* fix enumeration list presentation for dynamic enumerations
* wrapping controls for transform GL programs
**2025/01/31** @1.0.6:
* fixed all tooltips
**2025/01/29** @1.0.5:
* fixed parsing bug where uniforms could be defined inside comments [issue #2](https://github.com/Amorano/Jovi_GLSL/issues/2)
* empty defaults will no longer complain about `None` values
# INSTALLATION
[Please see the wiki for advanced use of the environment variables that can be used at startup](https://github.com/Amorano/Jovi_GLSL/wiki)
+28
View File
@@ -0,0 +1,28 @@
// name: BLOOM
// desc: Bloom filter pass
// category: FILTER
uniform sampler2D image; // | RGB(A) image
uniform float threshold; // 0.25; 0; 1; 0.01; | Brightness threshold to start the bloom effect
uniform float intensity; // 2; 0; 200; 0.1; | Ramp up to intensity of bloom
uniform float blurSize; // 3; 0; 100; 0.1; | Number of pixels to fade effect across
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 uv = (fragCoord.xy / iResolution.xy);
vec4 color = texture(image, uv);
vec2 texel = blurSize / vec2(iResolution.x, iResolution.y);
vec4 pixel = texture(image, uv, blurSize);
pixel += texture(image, uv + vec2(texel.x, 0.0), blurSize);
pixel += texture(image, uv + vec2(-texel.x, 0.0), blurSize);
pixel += texture(image, uv + vec2(0.0, texel.y), blurSize);
pixel += texture(image, uv + vec2(0.0, -texel.y), blurSize);
pixel += texture(image, uv + vec2(texel.x, texel.y), blurSize);
pixel += texture(image, uv + vec2(-texel.x, texel.y), blurSize);
pixel += texture(image, uv + vec2(texel.x, -texel.y), blurSize);
pixel += texture(image, uv + vec2(-texel.x, -texel.y), blurSize);
pixel /= 9.0;
vec4 bloom = clamp(pixel - threshold, 0.0, 1.0) * 1.0 / (1.0 - threshold);
fragColor = 1.0 - (1.0 - color) * (1.0 - bloom * intensity);
}
+1
View File
@@ -1,5 +1,6 @@
{
"BLEND LINEAR (JOV_GL)": "Simple linear blend between two images",
"BLOOM (JOV_GL)": "Bloom filter pass",
"COLOR CONVERSION (JOV_GL)": "Convert an image from one color space (RGB, HSV, LAB, XYZ) to another",
"COLOR PALETTE (JOV_GL)": "Color palette creation using the formula: color(t) = a + b * cos[tau(c*t+d)]",
"CONICAL GRADIENT (JOV_GL)": "Generate a conical gradient from black to white",
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "jovi_glsl"
description = "ComfyUI Nodes that integrate GLSL shader support."
version = "1.1.25"
version = "1.1.26"
license = { file = "LICENSE" }
readme = "README.md"
authors = [{ name = "Alexander G. Morano", email = "amorano@gmail.com" }]