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.

20 lines
441 B

4 years ago
  1. varying vec2 V_Texcoord;
  2. uniform sampler2D U_MainTexture;
  3. void main()
  4. {
  5. vec4 minValue = vec4(1.0);
  6. int coreSize = 6;
  7. int halfCoreSize = coreSize / 2;
  8. float texelOffset = 1/100.0;
  9. for(int y=0; y<coreSize; y++){
  10. for(int x=0; x<coreSize; x++){
  11. vec4 color = texture2D(U_MainTexture, V_Texcoord+vec2((-halfCoreSize+x)*texelOffset, (-halfCoreSize+y)*texelOffset));
  12. minValue = min(minValue,color);
  13. }
  14. }
  15. gl_FragColor=minValue;
  16. }