You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
904 B

  1. #version 330
  2. // Input vertex attributes (from vertex shader)
  3. in vec2 fragTexCoord;
  4. in vec4 fragColor;
  5. // Input uniform values
  6. uniform sampler2D texture0;
  7. uniform vec4 fragTintColor;
  8. // Output fragment color
  9. out vec4 finalColor;
  10. // NOTE: Add here your custom variables
  11. const float renderWidth = 1280.0;
  12. const float renderHeight = 720.0;
  13. float offset[3] = float[](0.0, 1.3846153846, 3.2307692308);
  14. float weight[3] = float[](0.2270270270, 0.3162162162, 0.0702702703);
  15. void main()
  16. {
  17. // Texel color fetching from texture sampler
  18. vec3 texelColor = texture(texture0, fragTexCoord).rgb*weight[0];
  19. for (int i = 1; i < 3; i++)
  20. {
  21. texelColor += texture(texture0, fragTexCoord + vec2(offset[i])/renderWidth, 0.0).rgb*weight[i];
  22. texelColor += texture(texture0, fragTexCoord - vec2(offset[i])/renderWidth, 0.0).rgb*weight[i];
  23. }
  24. finalColor = vec4(texelColor, 1.0);
  25. }