bayerDitherFunctions.js 699 B

1234567891011121314151617
  1. // Do not edit.
  2. import { ShaderStore } from "../../Engines/shaderStore.js";
  3. const name = "bayerDitherFunctions";
  4. const shader = `float bayerDither2(vec2 _P) {return mod(2.0*_P.y+_P.x+1.0,4.0);}
  5. float bayerDither4(vec2 _P) {vec2 P1=mod(_P,2.0);
  6. vec2 P2=floor(0.5*mod(_P,4.0));
  7. return 4.0*bayerDither2(P1)+bayerDither2(P2);}
  8. float bayerDither8(vec2 _P) {vec2 P1=mod(_P,2.0);
  9. vec2 P2=floor(0.5 *mod(_P,4.0));
  10. vec2 P4=floor(0.25*mod(_P,8.0));
  11. return 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);}
  12. `;
  13. // Sideeffect
  14. ShaderStore.IncludesShadersStore[name] = shader;
  15. /** @internal */
  16. export const bayerDitherFunctions = { name, shader };
  17. //# sourceMappingURL=bayerDitherFunctions.js.map