Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

Commit

Permalink
Added Filter Preset 'Channel Offset'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaoticByte committed Jun 19, 2024
1 parent 2c6cfde commit e79c992
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/presets/Presets.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const dir = "res://src/presets/shaders/"
"Empty": load(dir + "empty.gdshader"),
"Greyscale": load(dir + "greyscale.gdshader"),
"Lowpass": load(dir + "lowpass.gdshader"),
"Channel Offset": load(dir + "channel_offset.gdshader"),
"RGB -> UV Distort": load(dir + "rgb_uv_distort.gdshader"),
"Mix": load(dir + "mix.gdshader")
}
Expand Down
12 changes: 12 additions & 0 deletions src/presets/shaders/channel_offset.gdshader
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
shader_type canvas_item;

const vec2 offset_r = vec2(-0.002, -0.002);
const vec2 offset_g = vec2(0., 0.);
const vec2 offset_b = vec2(0.002, 0.002);

void fragment() {
COLOR.r = texture(TEXTURE , UV + offset_r).r;
COLOR.g = texture(TEXTURE , UV + offset_g).g;
COLOR.b = texture(TEXTURE , UV + offset_b).b;
COLOR.a = COLOR.a;
}

0 comments on commit e79c992

Please sign in to comment.