2
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
747 B
GLSL

#version 120
uniform sampler2D DiffuseSampler;
varying vec2 texCoord;
varying vec2 oneTexel;
void main(){
vec4 center = texture2D(DiffuseSampler, texCoord);
vec4 left = texture2D(DiffuseSampler, texCoord - vec2(oneTexel.x, 0.0));
vec4 right = texture2D(DiffuseSampler, texCoord + vec2(oneTexel.x, 0.0));
vec4 up = texture2D(DiffuseSampler, texCoord - vec2(0.0, oneTexel.y));
vec4 down = texture2D(DiffuseSampler, texCoord + vec2(0.0, oneTexel.y));
vec4 leftDiff = center - left;
vec4 rightDiff = center - right;
vec4 upDiff = center - up;
vec4 downDiff = center - down;
vec4 total = clamp(leftDiff + rightDiff + upDiff + downDiff, 0.0, 1.0);
gl_FragColor = vec4(total.rgb, center.a);
}