Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

27 lignes
717 B

  1. #version 100
  2. precision mediump float;
  3. varying vec2 fragTexCoord;
  4. uniform sampler2D texture0;
  5. uniform vec4 tintColor;
  6. // NOTE: Add here your custom variables
  7. const float renderWidth = 1280;
  8. const float renderHeight = 720;
  9. float offset[3] = float[]( 0.0, 1.3846153846, 3.2307692308 );
  10. float weight[3] = float[]( 0.2270270270, 0.3162162162, 0.0702702703 );
  11. void main()
  12. {
  13. vec3 tc = texture2D(texture0, fragTexCoord).rgb*weight[0];
  14. for (int i = 1; i < 3; i++)
  15. {
  16. tc += texture2D(texture0, fragTexCoord + vec2(offset[i])/renderWidth, 0.0).rgb*weight[i];
  17. tc += texture2D(texture0, fragTexCoord - vec2(offset[i])/renderWidth, 0.0).rgb*weight[i];
  18. }
  19. gl_FragColor = vec4(tc, 1.0);
  20. }