filter.fragment.fx 319 B

1234567891011121314151617
  1. #ifdef GL_ES
  2. precision highp float;
  3. #endif
  4. // Samplers
  5. varying vec2 vUV;
  6. uniform sampler2D textureSampler;
  7. uniform mat4 kernelMatrix;
  8. void main(void)
  9. {
  10. vec3 baseColor = texture2D(textureSampler, vUV).rgb;
  11. vec3 updatedColor = (kernelMatrix * vec4(baseColor, 1.0)).rgb;
  12. gl_FragColor = vec4(updatedColor, 1.0);
  13. }