Skip to content

Commit dcd46d7

Browse files
committed
add visual test for multi-material buildGeometry
1 parent c7853e8 commit dcd46d7

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

  • test/unit/visual

test/unit/visual/cases/webgl.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,33 @@ visualSuite('WebGL', function () {
932932
p5.model(geom);
933933
screenshot();
934934
});
935+
936+
visualTest(
937+
'a texture change splits into parts that each keep their texture',
938+
async function (p5, screenshot) {
939+
p5.createCanvas(50, 50, p5.WEBGL);
940+
const texA = await p5.loadImage('test/unit/assets/cat.jpg');
941+
const texB = await p5.loadImage('test/unit/assets/spheremap.jpg');
942+
const geom = p5.buildGeometry(() => {
943+
p5.push();
944+
p5.translate(-12, 0, 0);
945+
p5.texture(texA);
946+
p5.box(12);
947+
p5.pop();
948+
p5.push();
949+
p5.translate(12, 0, 0);
950+
p5.texture(texB);
951+
p5.box(12);
952+
p5.pop();
953+
});
954+
p5.background(255);
955+
p5.rotateX(0.4);
956+
p5.rotateY(0.4);
957+
p5.noStroke();
958+
p5.model(geom);
959+
screenshot();
960+
}
961+
);
935962
});
936963

937964
visualSuite('font data', () => {
2.12 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}

0 commit comments

Comments
 (0)