I'm so easily distracted (new benchmarks)
I was supposed to finish the collision and action systems tonight... And what do I do? I just had to implement a feature that wasn't even in my original list of features for the framework: dynamic lighting. So, now you'll be able to create light sources, and they can move and smoothly alter their color/brightness (via Actions of course).
Here are some benchmarks with moving Sprites (using simple newtonian physics) and dynamic light sources.
As you can see, there's still some room for optimization, but implementing different levels of lighting detail should help a bit in situations typical to games. Currently, each light source affects every corner of every sprite, so that's four calculations for every sprite for every light source. Small sprites don't really need this, so they can be optimized by calculating a single light value for the center of the sprite and using it for the whole image.
On the other hand, having 100+ dynamic light sources might not be the most typical scenario...
Here are some benchmarks with moving Sprites (using simple newtonian physics) and dynamic light sources.
sprites: 1000 3000 10000
------------------------------------
10 lights 85fps 85fps ~35fps
30 lights 85fps ~59fps ~18fps
100 lights ~64fps ~21fps ~6fps
As you can see, there's still some room for optimization, but implementing different levels of lighting detail should help a bit in situations typical to games. Currently, each light source affects every corner of every sprite, so that's four calculations for every sprite for every light source. Small sprites don't really need this, so they can be optimized by calculating a single light value for the center of the sprite and using it for the whole image.
On the other hand, having 100+ dynamic light sources might not be the most typical scenario...
4 Comments:
awesome! but, euh, where can I download it??
>> where can I download it??
Sorry, the new framework isn't publicly available yet. I want the APIs to get a bit more mature before releasing the first version, so I won't get frustrated users whose code breaks after every revision.
That plus I haven't yet decided on the specific license I'm going to use.
Looks brilliant so far. I will eagerly follow the Opioid progress now. Sounds like you got some good thoughts to put into this rewrite based on earlier experiences.
Best regards
I'm interested in your project, too - I'll be following this blog and wishing you the best.
Post a Comment
<< Home