Skip to content

Commit 13035a6

Browse files
committed
If you had a sprite on the display list using the LightPipeline, followed by a Mesh using the LightPipeline, and you invalidated the mesh (i.e. by rotating it), it would cause a runtime error in the current batch. Fix #6822
1 parent c5d8c7e commit 13035a6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/renderer/webgl/pipelines/LightPipeline.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,13 @@ var LightPipeline = new Class({
292292
rotation = gameObject.rotation;
293293
}
294294

295+
if (this.currentBatch === null)
296+
{
297+
this.createBatch(texture);
298+
299+
this.addTextureToBatch(normalMap);
300+
}
301+
295302
this.setNormalMapRotation(rotation);
296303

297304
return 0;
@@ -339,6 +346,13 @@ var LightPipeline = new Class({
339346
this.setNormalMapRotation(gameObject.rotation);
340347
}
341348

349+
if (this.currentBatch === null)
350+
{
351+
this.createBatch(texture);
352+
353+
this.addTextureToBatch(normalMap);
354+
}
355+
342356
return 0;
343357
},
344358

0 commit comments

Comments
 (0)