rjungemann Posted June 22, 2014 Share Posted June 22, 2014 Hey all, I would like to have my game completely blacked out, except for masked out areas around each player and enemy, to simulate being in pitch blackness. I tried using a Graphics object, but it only works for the first primitive drawn to the screen (so I would only be able to do it around the first entity), and it would not allow for soft edges. BitmapData would get expensive because I would need to re-render the BitmapData each frame and it would have to get transferred to a WebGL buffer every frame, which I would imagine would impair performance. Is this possible? Even just a broad idea of how something like this could be achieved would be helpful. Attached is a mockup of the effect I hope to achieve. Thanks, I really appreciate it! Link to comment Share on other sites More sharing options...
lewster32 Posted June 22, 2014 Share Posted June 22, 2014 This example is exactly what you'll need: http://gamemechanicexplorer.com/#lighting-3 For what it's worth your guess that you'd have to update BitmapData each frame is pretty much correct but the performance cost isn't too great. Link to comment Share on other sites More sharing options...
rjungemann Posted June 22, 2014 Author Share Posted June 22, 2014 Amazing! Thanks for sharing that link, that's exactly what I'm looking for! lewster32 1 Link to comment Share on other sites More sharing options...
Recommended Posts