first commit

This commit is contained in:
2025-02-16 14:28:47 +01:00
commit f1f0ae6ce1
63 changed files with 4018 additions and 0 deletions

22
blur.gdshader Normal file
View File

@@ -0,0 +1,22 @@
shader_type canvas_item;
uniform float sigma: hint_range(0.0, 20.0) = 3.3;
float gaussian(float x, float std) {
return exp(x * x / (-2.0 * std * std)) / (sqrt(2.0 * PI) * std);
}
void fragment() {
float ksize = round(3.0 * sigma);
float std = (sigma != 0.0 ? sigma : 1.0);
vec4 col = vec4(0.0);
float total_weight = 0.0;
for(float i = -ksize ; i <= ksize; ++i) {
for(float j = -ksize; j <= ksize; ++j) {
float weight = gaussian(i, std) * gaussian(j, std);
col += texture(TEXTURE, UV + vec2(i, j) * SCREEN_PIXEL_SIZE) * weight;
total_weight += weight;
}
}
COLOR = col / total_weight;
}