Texture as data in shader has odd behavior

Nice! Thanks for sharing :slight_smile:

In p5.js this seems to fix the funny particle:

function setup() {
  let canvas = createCanvas(300, 300, WEBGL);
  
  // ... unrelated code not shown ...
  
  img = createImage(NUM_PARTICLES, 1);
  
  tex = canvas.getTexture(img);
  tex.setInterpolation(NEAREST, NEAREST); // <--- this
}

I found it here.

Interesting that the odd behavior is present with LINEAR but not with NEAREST (in p5.js).

1 Like