Created
April 11, 2016 10:19
-
-
Save marcosbitetti/ef2f425066fb2e05755fe5f8d199c60f to your computer and use it in GitHub Desktop.
Simple Faster Blur for Godot Shader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VERTEX SHADER | |
uniform vec2 screen_size = vec2(1280,800); | |
VAR1 = vec4(1.0/screen_size.x,1.0/screen_size.y,0.0,0.0); | |
// FRAGMENT SHADER | |
vec3 sc = | |
texscreen( vec2(SCREEN_UV.x-VAR1.x*4.0, SCREEN_UV.y-VAR1.y*4.0) ) * 0.0162162162 + | |
texscreen( vec2(SCREEN_UV.x-VAR1.x*3.0, SCREEN_UV.y-VAR1.y*3.0) ) * 0.0540540541 + | |
texscreen( vec2(SCREEN_UV.x-VAR1.x*2.0, SCREEN_UV.y-VAR1.y*2.0) ) * 0.1216216216 + | |
texscreen( vec2(SCREEN_UV.x-VAR1.x, SCREEN_UV.y-VAR1.y) ) * 0.1945945946 + | |
texscreen(SCREEN_UV) * 0.2270270270 + | |
texscreen( vec2(SCREEN_UV.x+VAR1.x, SCREEN_UV.y+VAR1.y) ) * 0.1945945946 + | |
texscreen( vec2(SCREEN_UV.x+VAR1.x*2.0, SCREEN_UV.y+VAR1.y*2.0) ) * 0.1216216216 + | |
texscreen( vec2(SCREEN_UV.x+VAR1.x*3.0, SCREEN_UV.y+VAR1.y*3.0) ) * 0.0540540541 + | |
texscreen( vec2(SCREEN_UV.x+VAR1.x*4.0, SCREEN_UV.y+VAR1.y*4.0) ) * 0.0162162162 | |
; | |
COLOR = color(sc.r,sc.g,sc.b,1.0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how do you use this, but using vec4 instead of vec3?