lanczos16.vs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // This is a port of the original CG shader to the quark format
  2. // the original shader can be found here :
  3. // https://github.com/libretro/common-shaders/tree/master/handheld/gameboy
  4. /*
  5. Copyright (C) 2007 guest(r) - guest.r@gmail.com
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #version 150
  19. in vec4 position;
  20. in vec2 texCoord;
  21. out Vertex {
  22. vec2 texCoord;
  23. vec4 t1;
  24. vec4 t2;
  25. vec4 t3;
  26. vec4 t4;
  27. } vertexOut;
  28. uniform vec4 targetSize;
  29. uniform vec4 sourceSize[];
  30. void main() {
  31. gl_Position=position;
  32. vertexOut.texCoord=texCoord;
  33. vertexOut.t1=texCoord.xxyy + vec4(-sourceSize[0].z, 0.0, -sourceSize[0].w, 0.0);
  34. vertexOut.t2=texCoord.xxyy + vec4( sourceSize[0].z, 2.0*sourceSize[0].z, -sourceSize[0].w, 0.0);
  35. vertexOut.t3=texCoord.xxyy + vec4(-sourceSize[0].z, 0.0, sourceSize[0].w, 2.0*sourceSize[0].w);
  36. vertexOut.t4=texCoord.xxyy + vec4( sourceSize[0].z, 2.0*sourceSize[0].z, sourceSize[0].w, 2.0*sourceSize[0].w);
  37. }