Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. void main() {
  2. float t_00 = rgb_2_luma(textureOffset(tex, uv, ivec2(-1,-1)).rgb);
  3. float t_01 = rgb_2_luma(textureOffset(tex, uv, ivec2(0,-1)).rgb);
  4. float t_02 = rgb_2_luma(textureOffset(tex, uv, ivec2(1,-1)).rgb);
  5.  
  6. float t_10 = rgb_2_luma(textureOffset(tex, uv, ivec2(-1,0)).rgb);
  7. float t_11 = rgb_2_luma(textureOffset(tex, uv, ivec2(0,0)).rgb);
  8. float t_12 = rgb_2_luma(textureOffset(tex, uv, ivec2(1,0)).rgb);
  9.  
  10. float t_20 = rgb_2_luma(textureOffset(tex, uv, ivec2(-1,1)).rgb);
  11. float t_21 = rgb_2_luma(textureOffset(tex, uv, ivec2(0,1)).rgb);
  12. float t_22 = rgb_2_luma(textureOffset(tex, uv, ivec2(1,1)).rgb);
  13.  
  14. 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;
  15. 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;
  16.  
  17.  
  18.  
  19. color = vec3(1.0 - sqrt(gxin*gxin + gyin*gyin));//texture(tex,uv).rgb;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement