Skip to content

Commit f591bbe

Browse files
slimbuckDonovan Hutchence
andauthored
test indexBuffer correctly in mesh class (playcanvas#2024)
Co-authored-by: Donovan Hutchence <dhutchence@snapchat.com>
1 parent 4fb6fa0 commit f591bbe

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/scene/mesh.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ Object.assign(pc, function () {
545545
// set up primitive parameters
546546
this.primitive[0].type = (primitiveType === undefined ? pc.PRIMITIVE_TRIANGLES : primitiveType);
547547

548-
if (this.indexBuffer && this.indexBuffer[0]) { // indexed
548+
if (this.indexBuffer.length > 0 && this.indexBuffer[0]) { // indexed
549549
if (this._geometryData.indexStreamUpdated) {
550550
this.primitive[0].count = this._geometryData.indexCount;
551551
this.primitive[0].indexed = true;
@@ -647,7 +647,7 @@ Object.assign(pc, function () {
647647

648648
var lines = [];
649649
var format;
650-
if (this.indexBuffer[0]) {
650+
if (this.indexBuffer.length > 0 && this.indexBuffer[0]) {
651651
var offsets = [[0, 1], [1, 2], [2, 0]];
652652

653653
var base = this.primitive[pc.RENDERSTYLE_SOLID].base;

tools/glb-viewer/src/debug.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ var DebugLines = function (app, camera) {
4444

4545
// construct the material
4646
var material = new pc.BasicMaterial();
47-
material.blend = false;
4847
material.blendType = pc.BLEND_NORMAL;
4948
material.update();
5049

0 commit comments

Comments
 (0)