xbr-mlv4-multipass-2.vs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #version 150
  2. /*
  3. Hyllian's xBR MultiLevel4 Shader - Pass3
  4. Copyright (C) 2011-2015 Hyllian - sergiogdb@gmail.com
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11. The above copyright notice and this permission notice shall be included in
  12. all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. THE SOFTWARE.
  20. */
  21. in vec4 position;
  22. in vec2 texCoord;
  23. out Vertex {
  24. vec2 vTexCoord;
  25. vec4 t1;
  26. };
  27. uniform vec4 outputSize;
  28. uniform vec4 sourceSize[];
  29. // compatibility macros
  30. #define mul(a,b) (b*a)
  31. #define float2 vec2
  32. #define float3 vec3
  33. #define float4 vec4
  34. #define bool2 bvec2
  35. #define bool3 bvec3
  36. #define bool4 bvec4
  37. #define float3x3 mat3x3
  38. #define float4x3 mat4x3
  39. #define texture_size (sourceSize[0].xy)
  40. #define video_size (sourceSize[0].xy)
  41. #define output_size (outputSize.xy)
  42. void main() {
  43. gl_Position = position;
  44. vTexCoord = texCoord * 1.0004;
  45. float2 ps = sourceSize[2].zw;
  46. float dx = ps.x;
  47. float dy = ps.y;
  48. // A3 B3 C3
  49. // A1 B1 C1
  50. //A2 A0 A B C C4 C6
  51. //D2 D0 D E F F4 F6
  52. //G2 G0 G H I I4 I6
  53. // G5 H5 I5
  54. // G7 H7 I7
  55. t1 = float4(dx, 0., 0., dy); // F H
  56. }