Created
May 30, 2018 22:08
-
-
Save aferriss/66e394880eb5b62f263654e84741989a to your computer and use it in GitHub Desktop.
How to use wrap and filter funcs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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