The ForwardDiffuseLightPipeline now uses sys.lights instead of the Scene variable to avoid errors due to injection removal.

This commit is contained in:
Richard Davey 2018-03-12 12:55:09 +00:00
parent a005e076fa
commit 063d30602e
2 changed files with 3 additions and 2 deletions

View file

@ -13,6 +13,7 @@
* The TileSprite Canvas Renderer did not support rotation, scaling or flipping. Fix #3231 (thanks @TCatshoek)
* Fixed Group doesn't remove children from Scene when cleared with the `removeFromScene` argument set (thanks @iamchristopher)
* Fixed an error in the lights pipeline when no Light Manager has been defined (thanks @samme)
* The ForwardDiffuseLightPipeline now uses `sys.lights` instead of the Scene variable to avoid errors due to injection removal.
### Updates

View file

@ -71,7 +71,7 @@ var ForwardDiffuseLightPipeline = new Class({
*/
onRender: function (scene, camera)
{
var lightManager = scene.lights;
var lightManager = scene.sys.lights;
if (!lightManager)
{
@ -87,7 +87,7 @@ var ForwardDiffuseLightPipeline = new Class({
var renderer = this.renderer;
var program = this.program;
var lights = scene.lights.cull(camera);
var lights = lightManager.cull(camera);
var lightCount = Math.min(lights.length, LIGHT_COUNT);
var cameraMatrix = camera.matrix;
var point = {x: 0, y: 0};