uniform sampler2D normal; uniform vec2 mouse; uniform float Za; vec4 effect(vec4 color,sampler2D tex,vec2 tc,vec2 pc) { vec4 img_color = texture2D( tex, tc ); vec4 normalColor = texture2D( normal, tc ); float X = (mouse.x - pc.x); float Y = (mouse.y - pc.y); float Z = Za; float dotProduct = X * normalColor.r + Y * normalColor.g + Z * normalColor.b; dotProduct /= sqrt(X * X + Y * Y + Z * Z) * sqrt(normalColor.r * normalColor.r + normalColor.g * normalColor.g + normalColor.b * normalColor.b); float factor = dotProduct; img_color.r = img_color.r + factor; img_color.g = img_color.g + factor; img_color.b = img_color.b + factor; return img_color; }