Implement chromatic aberration filter #3

Closed
opened 2023-06-29 13:24:41 +00:00 by Ghost · 0 comments
First-time contributor

based on:

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 uv = fragCoord/iResolution.xy;
    
    vec3 col = vec3(0);
    
    const float D = 8.;
    
    for (float t = 0.; t < D; t++)
    {
        col += vec3(
            texture(iChannel0, (uv-.5)* mix(0.92, 1., t/D) +.5 ).r,
            texture(iChannel0, (uv-.5)* mix(0.96, 1., t/D) +.5 ).g,
            texture(iChannel0, (uv-.5) +.5 ).b
        );
    }
    col /= D;
    
    fragColor = vec4(col,1.0);
}
based on: ```glsl void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec2 uv = fragCoord/iResolution.xy; vec3 col = vec3(0); const float D = 8.; for (float t = 0.; t < D; t++) { col += vec3( texture(iChannel0, (uv-.5)* mix(0.92, 1., t/D) +.5 ).r, texture(iChannel0, (uv-.5)* mix(0.96, 1., t/D) +.5 ).g, texture(iChannel0, (uv-.5) +.5 ).b ); } col /= D; fragColor = vec4(col,1.0); } ```
Ghost pinned this 2023-06-29 13:25:52 +00:00
Ghost closed this issue 2023-06-30 12:00:03 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: servostar/Shadertoy-Shaders#3
No description provided.