April 19, 2010

(0) Comments

Rectangle Packing is Hard! Part 2

Brad

In the first post, we looked at some of the difficulties of rectangle packing and how the easy algorithms can fail. While the recursive algorithm can work well for lots of similarly-shaped rectangles, it falls apart when we have fewer rectangles or a large variety of shapes. So I decided to start from scratch, trying to come up with an algorithm which could sort the rectangles below:

More »

March 13, 2010

(0) Comments

Rectangle Packing is Hard! Part 1

Rectangle packing, or 2D box packing (or bin packing), is a pretty common problem in computer graphics. Plasma needs a good rectangle packer because most GL ES hardware only supports textures with sides that are powers of 2, and this isn’t an acceptable limitation. Our current solution is to pack all bitmaps into one big texture which meets any hardware requirements. Then we can just draw the parts of the texture that the frame requires.

So, how can we efficiently pack a bunch of bitmaps into one big image?

More »

March 6, 2010

(1) Comment

Parallax Scrolling Demo

One of the really neat features of Plasma is the way in which it handles multiple background layers. By drawing backgrounds on top of each other, we enable some cool effects such as Parallax Scrolling. Check out this demo video:

More »