# How do I add two effects together? (Shockwave and Chromatic Aberration)

Attention Topic was automatically imported from the old Question2Answer platform.

I want to add the Chromatic Aberration to the shockwave. Much like in the tutorial.
I have no idea how to do this and have been stuck for a while.

uniform vec2 center;
uniform float force;
uniform float size;
uniform float thickness;
uniform float offset;

void fragment(){

``````float ratio = SCREEN_PIXEL_SIZE.x / SCREEN_PIXEL_SIZE.y;
vec2 scaledUV = (SCREEN_UV - vec2(0.5, 0.0) ) / vec2(ratio, 1.0) + vec2(0.5, 0.0);
float mask = (1.0 - smoothstep(size-0.1, size, length(scaledUV - center))) *
smoothstep(size-thickness-0.1, size-thickness, length(scaledUV - center));
vec2 disp = normalize(scaledUV - center) * force * mask;
COLOR = texture(SCREEN_TEXTURE, SCREEN_UV - disp);

//Chromatic Aberration (I want to apply chromatic Aberation to the shockwave.I'm nt sure how to combine the effects')(The code below is something used in shadertoy)
vec4 rc = texture(SCREEN_TEXTURE, vec2(scaledUV.x - offset, scaledUV.y));
vec4 gc = texture(SCREEN_TEXTURE, vec2(scaledUV.x + offset, scaledUV.y));
vec4 bc = texture(SCREEN_TEXTURE, vec2(scaledUV.x, scaledUV.y));

vec3 distortion = vec3(rc.r, gc.g, bc.b);
``````

}
//This is the code I’m trying to replicate from for the chromatic abberation.
//void mainImage( out vec4 fragColor, in vec2 fragCoord ) {

``````//vec2 scaledUV = fragCoord/iResolution.xy;
//vec4 rc = texture(iChannel0, vec2(scaledUV.x - offset, scaledUV.y));
//vec4 gc = texture(iChannel0, vec2(scaledUV.x + offset, scaledUV.y));
//vec4 bc = texture(iChannel0, vec2(scaledUV.x, scaledUV.y));

//fragColor = vec4(rc.r, gc.g, bc.b, 1.0);
``````

//}

i think each shader has a nextPass var in inspector that you can set to another shader or something

// MAYBE A LITTLE LATE, BUT HERE YOU GO.

render_mode blend_mix;
uniform float size:hint_range (0.0,2.0);
uniform vec2 center = vec2(0.5,0.5);
uniform float thickness:hint_range (0.0,0.50);
uniform float force =0.123;
// uniform used to move the texture by pixels
uniform float pixel_move:hint_range(-0.003,0.003);
void fragment()
{

``````
float ratio = (SCREEN_PIXEL_SIZE.x/SCREEN_PIXEL_SIZE.y );
vec2 scaledUV = (SCREEN_UV-vec2(0.5,0.0)) / vec2(ratio,1.0) +vec2 (0.5,0.0);
*smoothstep(size-thickness-0.1,size-thickness,length(scaledUV-center));
vec2 displacement = normalize(scaledUV-center) *force;