JTronLabs Posted March 27, 2017 Share Posted March 27, 2017 So I'm interested in creating a 2D game (currently partially implemented in Phaser-CE) in JS using dynamic lighting. I want directional lights to cast shadows behind P2 sprites, be customizable by blur, dropoff, intensity, and interact with 2D normal maps (created with Sprite Illuminator), and maybe more (that I don't know yet). After doing some research, I've found a variety of tutorials for implementing point lighting in JS - Game Mechanic Explorer, Red Blob Games, 3D by Mozilla, and Byron Knoll. Phaser-CE has a Filter class for accessing GPU accelerated shaders, but its seems difficult to interface between game sprites and shaders, and there seems to be no ready-made lighting solution. Phaser3 seems to be planning some sort of lighting support, but release is far away. So I don't really want to use these options as they seem fragile or overly difficult. Illuminated seems to be the most popular 2D lighting library, though I remember reading somewhere it has some perf issues (doesn't use WebGL or something, not sure). I also came across this LightingEngine project, which while small/unknown has some really cool demos and really great documentation. Neither of these appear to have SpriteIlluminator integration though. All in all, I'm new to this and want to find the easiest way to get dynamic lighting started in a Phaser-CE game. Before I go down the rabbit hole of a specific library/start re-implementing things, I was wondering if anybody has done something similar and has some guidance. Thanks! espace 1 Quote Link to comment Share on other sites More sharing options...
mattstyles Posted March 30, 2017 Share Posted March 30, 2017 I rolled my own, based on a Red Blob article I think, but it wasn't great. I'd love it if one of those projects you mentioned works well enough that you end up using it. Quote Link to comment Share on other sites More sharing options...
mattstyles Posted March 30, 2017 Share Posted March 30, 2017 Wowsers, I just checked out Lighting Engine, some of those demos are incredible! Doesn't look like its had much activity of late so hopefully the maintainer gets in touch re your open issue! JTronLabs 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.