Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scene shutdown does not clear the pipeline out of lights #3707

Closed
s4m2d opened this issue May 27, 2018 · 1 comment
Closed

Scene shutdown does not clear the pipeline out of lights #3707

s4m2d opened this issue May 27, 2018 · 1 comment

Comments

@s4m2d
Copy link
Contributor

s4m2d commented May 27, 2018

Reproducable problem: If you got a scene (scene1), that implements light:
Enable lights in the scene1:
this.lights.enable().setAmbientColor(0xffffff);
use a light in the scene1:
this.lights.addLight( x, y ).setColor(0xff5f0a).setIntensity(1);

And then switch to a second scene via: this.scene.start('scene2')
The light is successfully cleared from the array of lights in the Manager.
But a "ghostimage" remains in the new, started scene2 if:
Scene2

  1. scene2 has lights enabled.
  2. But scene2 got no own lights.

result: you see the lights from scene1 in scene2

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

JasonHK pushed a commit to JasonHK/phaser that referenced this issue Jun 4, 2019
…a flag if the Scene doesn't contain any lights. All of the Game Objects now check this flag and don't even bother adding themselves to the batch if there are no lights in the Scene, as they'd never render anyway. This also avoids the ghost-image problem if you swap Scenes to a new Scene with the Light Manager enabled, but no actual lights defined. Fix phaserjs#3707
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants