Skip to content

Instantly share code, notes, and snippets.

@aferriss
Created May 30, 2018 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aferriss/66e394880eb5b62f263654e84741989a to your computer and use it in GitHub Desktop.
Save aferriss/66e394880eb5b62f263654e84741989a to your computer and use it in GitHub Desktop.
How to use wrap and filter funcs
let canvas;
let img;
function preload(){
img = loadImage("img.jpg");
}
function setup() {
// shaders require WEBGL mode to work
canvas = createCanvas(windowWidth, windowHeight, WEBGL);
let tex = canvas.getTexture(img);
tex.setTextureWrap(REPEAT, REPEAT);
tex.setTextureFilters(NEAREST, NEAREST);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment