feat: blur, sharpen, sepia, noise shader hinzugefügt

This commit is contained in:
2026-04-23 21:19:20 +02:00
parent 4afd22a97a
commit e7c71b2675
4 changed files with 76 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#version 300 es
precision highp float;
in vec2 v_texcoord;
uniform sampler2D tex;
out vec4 fragColor;
void main() {
float o = 0.003;
vec4 c = vec4(0.0);
c += texture(tex, v_texcoord + vec2(-o, -o)) * 0.0625;
c += texture(tex, v_texcoord + vec2( 0, -o)) * 0.125;
c += texture(tex, v_texcoord + vec2( o, -o)) * 0.0625;
c += texture(tex, v_texcoord + vec2(-o, 0)) * 0.125;
c += texture(tex, v_texcoord ) * 0.25;
c += texture(tex, v_texcoord + vec2( o, 0)) * 0.125;
c += texture(tex, v_texcoord + vec2(-o, o)) * 0.0625;
c += texture(tex, v_texcoord + vec2( 0, o)) * 0.125;
c += texture(tex, v_texcoord + vec2( o, o)) * 0.0625;
fragColor = c;
}
+19
View File
@@ -0,0 +1,19 @@
#version 300 es
precision highp float;
in vec2 v_texcoord;
uniform sampler2D tex;
out vec4 fragColor;
float rand(vec2 co) {
return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);
}
void main() {
vec4 c = texture(tex, v_texcoord);
float grain = rand(v_texcoord) * 0.08 - 0.04;
c.rgb += grain;
fragColor = clamp(c, 0.0, 1.0);
}
+16
View File
@@ -0,0 +1,16 @@
#version 300 es
precision highp float;
in vec2 v_texcoord;
uniform sampler2D tex;
out vec4 fragColor;
void main() {
vec4 c = texture(tex, v_texcoord);
float r = dot(c.rgb, vec3(0.393, 0.769, 0.189));
float g = dot(c.rgb, vec3(0.349, 0.686, 0.168));
float b = dot(c.rgb, vec3(0.272, 0.534, 0.131));
fragColor = vec4(clamp(r, 0.0, 1.0), clamp(g, 0.0, 1.0), clamp(b, 0.0, 1.0), c.a);
}
+18
View File
@@ -0,0 +1,18 @@
#version 300 es
precision highp float;
in vec2 v_texcoord;
uniform sampler2D tex;
out vec4 fragColor;
void main() {
float o = 0.002;
vec4 c = texture(tex, v_texcoord) * 5.0;
c -= texture(tex, v_texcoord + vec2( 0, -o));
c -= texture(tex, v_texcoord + vec2(-o, 0));
c -= texture(tex, v_texcoord + vec2( o, 0));
c -= texture(tex, v_texcoord + vec2( 0, o));
fragColor = clamp(c, 0.0, 1.0);
}