#version 330 core
in vec2 texCoord;
out vec4 fragColor;

uniform sampler2D texture0;

void main()
{
	vec4 n = texture(texture0, (texCoord+vec2(0,0.001)));
    vec4 e = texture(texture0, (texCoord+vec2(0.001,0)));
    vec4 s = texture(texture0, (texCoord+vec2(0,-0.001)));
    vec4 w = texture(texture0, (texCoord+vec2(-0.001,0)));
    vec4 dy = (n - s)*.5;
    vec4 dx = (e - w)*.5;
    vec4 edge = sqrt(dx*dx + dy*dy);
    vec4 angle = atan(dy, dx);
    
  
	fragColor = n;
	  fragColor.xyz = n.xyz+edge.xyz*2.;
}