Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main() {
- float t_00 = rgb_2_luma(textureOffset(tex, uv, ivec2(-1,-1)).rgb);
- float t_01 = rgb_2_luma(textureOffset(tex, uv, ivec2(0,-1)).rgb);
- float t_02 = rgb_2_luma(textureOffset(tex, uv, ivec2(1,-1)).rgb);
- float t_10 = rgb_2_luma(textureOffset(tex, uv, ivec2(-1,0)).rgb);
- float t_11 = rgb_2_luma(textureOffset(tex, uv, ivec2(0,0)).rgb);
- float t_12 = rgb_2_luma(textureOffset(tex, uv, ivec2(1,0)).rgb);
- float t_20 = rgb_2_luma(textureOffset(tex, uv, ivec2(-1,1)).rgb);
- float t_21 = rgb_2_luma(textureOffset(tex, uv, ivec2(0,1)).rgb);
- float t_22 = rgb_2_luma(textureOffset(tex, uv, ivec2(1,1)).rgb);
- float gxin = -1*t_00 -2*t_01 -1*t_02 + 0*t_10 + 0*t_11 + 0*t_12 + 1*t_20 + 2*t_21 + 1*t_22;
- float gyin = -1*t_00 + 0*t_01 + 1*t_02 -2*t_10 + 0*t_11 + 2*t_12 -1*t_20 + 0*t_21 + 1*t_22;
- color = vec3(1.0 - sqrt(gxin*gxin + gyin*gyin));//texture(tex,uv).rgb;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement