There are tree effects in this demo that i’m very happy about:
At the beginning I was playing with using marching cubes algorithm to generate landscapes.
At some point I asked myself. What if instead of making mountains we start to drill holes inside the iso-surface? Hmmm. Just make it longer and narrower and you get... Guess what? A tunnel!
All that left is to add fancy colors and the sky. What's nice is that you can play with resolution of the marching cubes grid. Low res looks kind of cool as well.
Doing particle star fields is easy. It's just a bunch of quads front facing the camera.
But what I always wanted to do is kind of warp speed stretched stars. Like in Start Trek. I started by playing with accumulating frames over time but it was far from perfect. Finally I found a great tutorial on billboarding at Lighthouse3d. That made me think. Basically what you have to do is to place particles around the center of the screen facing Z axis. Then add a little bit of stretching… and bum! Done :)
This one was inspired by experiments of my mate Patrik from shiftcontrol. The idea is to use mask to gradually hide part of the shape and replace it with particles. This can be used to create effects like solid block appearing from dust or in my case shape breaking into small pieces once touching the ground.
The trick is to distribute particles in such a way that we can calculate normals at their positions to compute the lighting and to know when to hide / show them. I use Vertex shaders for that.
Here is desktop version of the same effect with slightly bigger number of particles:
Very often, especially when working with alpha blending I got annoying diagonal line across the screen and some texture errors. It works fine on the iPhone though. Strange...;