SangeFault/assets/minecraft/shaders/program/blobs2.fsh
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 a50683c84e Updated to 1.18.1 Vanilla Assets
basically starting over... this is gonna be fun!
2022-01-20 17:44:06 +01:00

32 lines
1,022 B
GLSL

#version 150
uniform sampler2D DiffuseSampler;
in vec2 texCoord;
in vec2 oneTexel;
uniform float Radius;
out vec4 fragColor;
void main(){
vec4 c = texture(DiffuseSampler, texCoord);
vec4 maxVal = c;
for(float u = 0.0; u <= Radius; u += 1.0) {
for(float v = 0.0; v <= Radius; v += 1.0) {
float weight = (((sqrt(u * u + v * v) / (Radius)) > 1.0) ? 0.0 : 1.0);
vec4 s0 = texture(DiffuseSampler, texCoord + vec2(-u * oneTexel.x, -v * oneTexel.y));
vec4 s1 = texture(DiffuseSampler, texCoord + vec2( u * oneTexel.x, v * oneTexel.y));
vec4 s2 = texture(DiffuseSampler, texCoord + vec2(-u * oneTexel.x, v * oneTexel.y));
vec4 s3 = texture(DiffuseSampler, texCoord + vec2( u * oneTexel.x, -v * oneTexel.y));
vec4 o0 = max(s0, s1);
vec4 o1 = max(s2, s3);
vec4 tempMax = max(o0, o1);
maxVal = mix(maxVal, max(maxVal, tempMax), weight);
}
}
fragColor = vec4(maxVal.rgb, 1.0);
}