Llorx Posted April 4, 2016 Share Posted April 4, 2016 That's it. I've managed to add normal mapping to Phaser engine. Only about ~150 lines of code. Right now is resource consuming. My laptop can handle it but in my Android device FPS drops at half speed. The thing is to have your default image (your world), and then add different images with lighting coming from the left, top, right and bottom. With all this we only have to draw with a radial gradient alpha mask the different light maps around your light source, depending if they are under/top/left or right side of your light source. The quality can be optimized having 8 mappings instead of 4, but it will consume much more resources this way. If you are interested I can drop a demo file elsewhere. The good thing about this is that works with canvas instead of gl (gl has native normal mapping support). Tom Atom and drhayes 2 Link to comment Share on other sites More sharing options...
Recommended Posts