Skip to content

Commit ccfc526

Browse files
committed
add visual test for mixed textured and untextured parts
1 parent dcd46d7 commit ccfc526

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

test/unit/visual/cases/webgl.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,32 @@ visualSuite('WebGL', function () {
959959
screenshot();
960960
}
961961
);
962+
963+
visualTest(
964+
'a textured part and an untextured part both render',
965+
async function (p5, screenshot) {
966+
p5.createCanvas(50, 50, p5.WEBGL);
967+
const tex = await p5.loadImage('test/unit/assets/cat.jpg');
968+
const geom = p5.buildGeometry(() => {
969+
p5.push();
970+
p5.translate(-12, 0, 0);
971+
p5.texture(tex);
972+
p5.box(12);
973+
p5.pop();
974+
p5.push();
975+
p5.translate(12, 0, 0);
976+
p5.fill('red');
977+
p5.box(12);
978+
p5.pop();
979+
});
980+
p5.background(255);
981+
p5.rotateX(0.4);
982+
p5.rotateY(0.4);
983+
p5.noStroke();
984+
p5.model(geom);
985+
screenshot();
986+
}
987+
);
962988
});
963989

964990
visualSuite('font data', () => {
1.42 KB
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}

0 commit comments

Comments
 (0)