first commit

This commit is contained in:
marwy 2026-11-27 13:16:36 +03:00
commit a408df2a76
218 changed files with 52376 additions and 0 deletions

33
shaders/gl/blur.frag Normal file
View file

@ -0,0 +1,33 @@
#version 330 core
// 2-Pass Dual Kawase Blur Fragment Shader (OpenGL 3.3 Core)
// u_mode == 0: 5-tap downsample; u_mode != 0: 8-tap upsample.
uniform sampler2D u_tex;
uniform vec2 u_texel_size;
uniform float u_offset;
uniform int u_mode;
in vec2 v_uv;
out vec4 o_color;
void main() {
vec2 hp = u_texel_size * 0.5 * u_offset;
if (u_mode == 0) {
vec4 sum = textureLod(u_tex, v_uv, 0.0) * 4.0;
sum += textureLod(u_tex, v_uv - hp, 0.0);
sum += textureLod(u_tex, v_uv + hp, 0.0);
sum += textureLod(u_tex, v_uv + vec2(hp.x, -hp.y), 0.0);
sum += textureLod(u_tex, v_uv - vec2(hp.x, -hp.y), 0.0);
o_color = sum * 0.125;
} else {
vec4 sum = textureLod(u_tex, v_uv + vec2(-hp.x * 2.0, 0.0), 0.0);
sum += textureLod(u_tex, v_uv + vec2(-hp.x, hp.y), 0.0) * 2.0;
sum += textureLod(u_tex, v_uv + vec2(0.0, hp.y * 2.0), 0.0);
sum += textureLod(u_tex, v_uv + vec2(hp.x, hp.y), 0.0) * 2.0;
sum += textureLod(u_tex, v_uv + vec2(hp.x * 2.0, 0.0), 0.0);
sum += textureLod(u_tex, v_uv + vec2(hp.x, -hp.y), 0.0) * 2.0;
sum += textureLod(u_tex, v_uv + vec2(0.0, -hp.y * 2.0), 0.0);
sum += textureLod(u_tex, v_uv + vec2(-hp.x, -hp.y), 0.0) * 2.0;
o_color = sum * (1.0 / 12.0);
}
}