No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

27 líneas
577 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. uniform float pixelWidth = 5.0f;
  10. uniform float pixelHeight = 5.0f;
  11. void main()
  12. {
  13. float dx = pixelWidth*(1.0/renderWidth);
  14. float dy = pixelHeight*(1.0/renderHeight);
  15. vec2 coord = vec2(dx*floor(fragTexCoord.x/dx), dy*floor(fragTexCoord.y/dy));
  16. vec3 tc = texture2D(texture0, coord).rgb;
  17. gl_FragColor = vec4(tc, 1.0);
  18. }