Guest User

Untitled

a guest
Apr 20th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. / 2xGLSL shader
  2. // by guest(r)
  3. // License: GNU-GPL
  4.  
  5. uniform sampler2D OGL2Texture;
  6.  
  7. void main()
  8. {
  9. vec3 c11 = texture2D(OGL2Texture, gl_TexCoord[0].xy).xyz;
  10. vec3 c00 = texture2D(OGL2Texture, gl_TexCoord[1].xy).xyz;
  11. vec3 c20 = texture2D(OGL2Texture, gl_TexCoord[2].xy).xyz;
  12. vec3 c02 = texture2D(OGL2Texture, gl_TexCoord[4].xy).xyz;
  13. vec3 c22 = texture2D(OGL2Texture, gl_TexCoord[3].xy).xyz;
  14.  
  15. vec3 dt = vec3(1.0,1.0,1.0);
  16.  
  17. float k00=dot(abs(c00-c11),dt);
  18. float k20=dot(abs(c20-c11),dt);
  19. float k02=dot(abs(c02-c11),dt);
  20. float k22=dot(abs(c22-c11),dt);
  21.  
  22. float md1=dot(abs(c00-c22),dt);
  23. float md2=dot(abs(c02-c20),dt);
  24.  
  25. float w1 = md2*k22; float w2 = md1*k02;
  26. float w3 = md2*k00; float w4 = md1*k20;
  27.  
  28. float t1 = w1+w3; float t2 = w2+w4;
  29.  
  30. float ww = max(t1,t2)+0.001;
  31.  
  32. gl_FragColor.xyz = (w1*c00+w2*c20+w3*c22+w4*c02+ww*c11)/(t1+t2+ww);
  33. }
Add Comment
Please, Sign In to add comment