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
Add a light type of entity for lighting effects #267
Comments
This might be worth looking at: https://github.com/gre/illuminated.js |
This issue hasn't had any recent activity lately and is being marked as stale automatically. |
I hope you don't mind me bumping this old issue, but I'm looking for something like this. In the meantime while we wait I've got something that may help others looking to light their scenes. I've conjured up a very cheap way to fake lighting: This is the general process:
Objects can register their lighting in their constructor like this: const lightSprite = Resources.light_Spot.toSprite();
LightingManager.instance.on(LightingEventTypes.RegisteringLights, (ev) => {
// This event handler is called everytime lighting is updated
// Let this big light be drawn:
ev.lightingManager.registerLight(
new GraphicLightEmitter({
pos: this.pos,
graphic: lightSprite,
scale: vec(5, 5)
})
);
}); I quickly made a little demo based on the platformer demo and it's custom-loader.ts shows how to light the whole screen on loading. Of course it isn't realistic lighting at all, but for some style of pixel art it may just be enough. I hope this helps someone. |
@luttje Wow this is very cool! |
Context
It would be useful to have the ability to utilize dynamic lighting effects.
Proposal
Something like this
The text was updated successfully, but these errors were encountered: