This commit is contained in:
2026-07-13 23:03:41 -07:00
parent aa9d6bc044
commit b423b78061
3 changed files with 0 additions and 627 deletions
-35
View File
@@ -1,35 +0,0 @@
#version 330
// Input vertex attributes (from vertex shader)
in vec2 fragTexCoord;
in vec4 fragColor;
// Input uniform values
uniform sampler2D texture0;
uniform vec4 colDiffuse;
// Output fragment color
out vec4 finalColor;
// NOTE: Add your custom variables here
// NOTE: Render size values must be passed from code
const float renderWidth = 1280;
const float renderHeight = 800;
float offset[3] = float[](0.0, 1.3846153846, 3.2307692308);
float weight[3] = float[](0.2270270270, 0.3162162162, 0.0702702703);
void main()
{
// Texel color fetching from texture sampler
vec3 texelColor = texture(texture0, fragTexCoord).rgb*weight[0];
for (int i = 1; i < 3; i++)
{
texelColor += texture(texture0, fragTexCoord + vec2(offset[i])/renderWidth, 0.0).rgb*weight[i];
texelColor += texture(texture0, fragTexCoord - vec2(offset[i])/renderWidth, 0.0).rgb*weight[i];
}
finalColor = vec4(texelColor, 1.0);
}
-29
View File
@@ -1,29 +0,0 @@
#version 330
in vec2 fragTexCoord;
in vec4 fragColor;
uniform sampler2D texture0;
uniform vec4 diffuse;
uniform vec2 resolution;
uniform vec2 direction;
out vec4 outColor;
void main() {
vec2 texel = direction / resolution;
const float weight[5] = float[](
0.22027, 0.1945946, 0.1216216, 0.054054, 0.016216
);
vec4 color = texture(texture0, fragTexCoord) * weight[0];
for (int i = 1; i < 5; i++) {
vec2 offset = texel * float(i);
color += texture(texture0, fragTexCoord + offset) * weight[i];
color += texture(texture0, fragTexCoord - offset) * weight[i];
}
outColor = color * diffuse * fragColor;
}