Skip to content

Instantly share code, notes, and snippets.

@jimmyjonezz
Created October 28, 2019 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmyjonezz/a0c508e6cb60cdbaef7795876d49f716 to your computer and use it in GitHub Desktop.
Save jimmyjonezz/a0c508e6cb60cdbaef7795876d49f716 to your computer and use it in GitHub Desktop.
shader_type canvas_item;
void fragment() {
vec3 col = -8.0 * texture(SCREEN_TEXTURE, SCREEN_UV).xyz;
col += texture(SCREEN_TEXTURE, SCREEN_UV + vec2(0.0, SCREEN_PIXEL_SIZE.y)).xyz;
col += texture(SCREEN_TEXTURE, SCREEN_UV + vec2(0.0, -SCREEN_PIXEL_SIZE.y)).xyz;
col += texture(SCREEN_TEXTURE, SCREEN_UV + vec2(SCREEN_PIXEL_SIZE.x, 0.0)).xyz;
col += texture(SCREEN_TEXTURE, SCREEN_UV + vec2(-SCREEN_PIXEL_SIZE.x, 0.0)).xyz;
col += texture(SCREEN_TEXTURE, SCREEN_UV + SCREEN_PIXEL_SIZE.xy).xyz;
col += texture(SCREEN_TEXTURE, SCREEN_UV - SCREEN_PIXEL_SIZE.xy).xyz;
col += texture(SCREEN_TEXTURE, SCREEN_UV + vec2(-SCREEN_PIXEL_SIZE.x, SCREEN_PIXEL_SIZE.y)).xyz;
col += texture(SCREEN_TEXTURE, SCREEN_UV + vec2(SCREEN_PIXEL_SIZE.x, -SCREEN_PIXEL_SIZE.y)).xyz;
COLOR.xyz = col;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment