diff --git a/Nodes/11 Image Modifier (Post Process)/Chromatic Aberration.clbnode b/Nodes/11 Image Modifier (Post Process)/Chromatic Aberration.clbnode index cd5a9518..201d0268 100644 --- a/Nodes/11 Image Modifier (Post Process)/Chromatic Aberration.clbnode +++ b/Nodes/11 Image Modifier (Post Process)/Chromatic Aberration.clbnode @@ -1,11 +1,11 @@ -INPUT UV->sRGB 'Image'; +INPUT UV->sRGB_PremultipliedA 'Image'; INPUT Point2D 'Center'; INPUT int 'Sample Count'; INPUT float 'Blur'; INPUT float 'Falloff'; -sRGB main(UV uv) +sRGB_PremultipliedA main(UV uv) { float inverse_sample_count = 1.0 / 'Sample Count'; @@ -21,14 +21,21 @@ sRGB main(UV uv) velocity * 4.0 * inverse_sample_count ); - vec3 accumulator = vec3(0); + vec4 accumulator = vec4(0); mat3x2 offsets = mat3x2(0); for (int i = 0; i < 'Sample Count'; i++) { - accumulator.g += 'Image'(uv + offsets[1]).g; - accumulator.b += 'Image'(uv + offsets[2]).b; - accumulator.r += 'Image'(uv + offsets[0]).r; + vec4 color0 = 'Image'(uv + offsets[0]); + vec4 color1 = 'Image'(uv + offsets[1]); + vec4 color2 = 'Image'(uv + offsets[2]); + accumulator.r += color0.r; + accumulator.g += color1.g; + accumulator.b += color2.b; + accumulator.a += (color0.a + + color1.a + + color2.a) + / 3.; offsets -= increments; } diff --git a/Nodes/11 Image Modifier (Post Process)/LED Screen.clbnode b/Nodes/11 Image Modifier (Post Process)/LED Screen.clbnode new file mode 100644 index 00000000..c250fc99 --- /dev/null +++ b/Nodes/11 Image Modifier (Post Process)/LED Screen.clbnode @@ -0,0 +1,42 @@ +INPUT UV->sRGB_StraightA 'Image'; +INPUT float 'BOB'; +INPUT float 'BAB'; +INPUT float 'Off'; + +float sat(float x) +{ + return clamp(x, 0., 1.); +} +vec3 sat(vec3 v) +{ + return vec3(sat(v.x), sat(v.y), sat(v.z)); +} + +vec3 pow3(vec3 v, float p) +{ + return vec3(pow(v.x, p), pow(v.y, p), pow(v.z, p)); +} + +sRGB_StraightA main(UV uv) +{ + vec2 r = vec2(_aspect_ratio, 1.); + + float x = cos(uv.x * PI * 'BOB' * r.x); + float y = cos(uv.x * PI * 'BOB' * r.x + 'Off'); + float z = cos(uv.x * PI * 'BOB' * r.x + 'Off' * 2); + vec3 grid = sat(vec3(x, y, z)); + grid = pow3(grid, 'BAB'); + // grid = sat(grid - .3); + // grid = pow3(grid, .5); + float g = pow(abs(cos(uv.y * PI * 'BOB' * r.y)), .3); + grid *= g; + grid *= 1.5; + + uv = round(uv * 'BOB' * r) / ('BOB' * r); + + vec3 c = 'Image'(uv).rgb; + + vec3 col = grid * c; + + return vec4(col, 1.0); +} \ No newline at end of file diff --git a/Nodes/11 Image Modifier (Post Process)/Posterize.clbnode b/Nodes/11 Image Modifier (Post Process)/Posterize.clbnode index a0385f62..39cbb5da 100644 --- a/Nodes/11 Image Modifier (Post Process)/Posterize.clbnode +++ b/Nodes/11 Image Modifier (Post Process)/Posterize.clbnode @@ -1,10 +1,11 @@ INPUT float 'Levels'; -INPUT UV->sRGB 'Image'; +INPUT UV->sRGB_StraightA 'Image'; -sRGB main(UV uv) +sRGB_StraightA main(UV uv) { if ('Levels' == 1.f) - return vec3(0.f); + return vec4(vec3(0.f), 'Image'(uv).a); - return vec3(floor('Image'(uv) * 'Levels') / ('Levels' - 1.)); + vec4 color = 'Image'(uv); + return vec4(vec3(floor(color.rgb * 'Levels') / ('Levels' - 1.)), color.a); } \ No newline at end of file diff --git a/Nodes/11 Image Modifier (Post Process)/Set Opacity (Alpha).clbnode b/Nodes/11 Image Modifier (Post Process)/Set Opacity (Alpha).clbnode index ac542b6c..f1f8f642 100644 --- a/Nodes/11 Image Modifier (Post Process)/Set Opacity (Alpha).clbnode +++ b/Nodes/11 Image Modifier (Post Process)/Set Opacity (Alpha).clbnode @@ -2,8 +2,7 @@ INPUT float 'Opacity'; -Oklab_StraightA main(Oklab_StraightA Image) +Oklab_PremultipliedA main(Oklab_PremultipliedA Image) { - Image.a = 'Opacity'; - return Image; + return Image * 'Opacity'; } \ No newline at end of file diff --git a/Nodes/11 Image Modifier (Post Process)/Set Opacity (Alpha).clbnode.presets.json b/Nodes/11 Image Modifier (Post Process)/Set Opacity (Alpha).clbnode.presets.json new file mode 100644 index 00000000..8267cfc6 --- /dev/null +++ b/Nodes/11 Image Modifier (Post Process)/Set Opacity (Alpha).clbnode.presets.json @@ -0,0 +1,42 @@ +{ + "Presets": { + "Underlying container": [ + { + "first": "73c034ed-8075-46ef-a8a4-bc8a3bc1542d", + "second": { + "Name": "Default", + "Values": [ + { + "index": 2, + "data": { + "Name": "Opacity", + "Value": 0.5, + "Metadata": { + "Bounds": { + "Has min bound": true, + "Min": 0.0, + "Has max bound": true, + "Max": 1.0, + "Drag speed": 0.009999999776482582, + "Use slider": true + } + }, + "Default Value": 0.0, + "Default Metadata": { + "Bounds": { + "Has min bound": false, + "Min": 0.0, + "Has max bound": false, + "Max": 1.0, + "Drag speed": 0.009999999776482582, + "Use slider": false + } + } + } + } + ] + } + } + ] + } +} \ No newline at end of file