Saturday, November 24, 2012

Game-off: Day 21

Mostly fixed the vertex bug in shadow projections. There's still a rare case where it chooses a vertex incorrectly that is at a very similar angle to the optimal choice. It's probably just a calculation error, something like using asin when I should be using atan. I don't know just yet.

I also have multiple light sources working well on iPhone 4S. The demo runs at 45 fps on iPhone 4S with two light sources that both have an intensity radius of 100px. The heaviest operation is the radial gradient, so a smaller radius is much better. When I start doing beams of light (flash lights, lamp shades, etc) I can experiment with linear gradients, and see how much better they perform. Not that they will look as convincing. ;p

The screenshot above shows an interesting side-effect of computing the shadow projections from individual objects instead of treating the light as a single flow; beams of light appear through the "cracks" between two touching objects. I don't mind it, though. The last remaining vertex selection bug is more annoying.

No comments: