Jump to content

[WIP] Semi-Normal Mapping in Phaser!


Llorx
 Share

Recommended Posts

That's it. I've managed to add normal mapping to Phaser engine. Only about ~150 lines of code.

 12a3d7e1f0f75113c3041346db9cbf1a.gif

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).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...