Skip to content

Conversation

@davepagurek
Copy link
Contributor

Resolves #5631

Changes:

  • Passes all vertex data to Tessy when using beginshape(TESS)
  • Updates Tessy callbacks to properly interpolate data at intersection points

Screenshots of the change:

let tex;

function preload() {
  tex = loadImage('cat.jpg');
}

function setup() {
  createCanvas(400, 400, WEBGL);
  textureMode(NORMAL)
  noLoop();
}

function draw() {
  background(220);
  scale(3, 3);
  translate(-50, -50);
  texture(tex);
  beginShape(TESS);
  vertex(20, 20, 0, 0);
  vertex(80, 20, 1, 0);
  vertex(80, 40, 1, 0.33);
  vertex(40, 40, 0.33, 0.33);
  vertex(40, 60, 0.33, 0.67);
  vertex(80, 60, 1, 0.67);
  vertex(80, 80, 1, 1);
  vertex(20, 80, 0, 1);
  endShape(CLOSE);
}
Before After

PR Checklist

  • npm run lint passes
  • [Inline documentation] is included / updated
  • [Unit tests] are included / updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

beginShape(TESS) does not respect UV coordinates when tessellating.

2 participants