Kings Can Fly

by Firedroid

Clouds and skirts

Posted by Willem On July - 7 - 2011

Sadly for us, the iPad 1 is very weak at rendering alpha (semi-transparent surfaces). So using clouds is a bit of a problem, seeing how they’re a significant part of the game’s look and feel.

Performance-wise we can get a single alpha-rendered plane covering the entire map, and then only when the mesh below is flat and has just one solid texture. We get about 28 fps when the alpha plane is covering 2/3 of the screen, which gets better when more solid mesh is visible (rendering alpha is fill-rate bound on the iPad).

Instead of going for a single solid plane with clouds painted on it, and a similar cloud filled alpha plane above it, we opted for loose 2d clouds. The “semi-alpha planes” are cut in half, the center part does not contain an alpha shader. This to reduce the amount of alpha drawn.

Because all the clouds are flat they clip though the mountains, which breaks the illusion and looks weird.
Our answer to this are “skirts”. This is a mesh around the side of the mountains containing a texture with alpha that has a gradient to transparency at towards the mountain and towards the cloud-layer. This gives the illusion that there are clouds around the mountains and blends it together to look smooth and natural without a big performance penalty.

1 Response so far
  1. Kasper Kamperman Said,

    Smart idea!

    Posted on July 7th, 2011 at 14:23

Add your comment