iakov.dev

Iron Cube 0.52: baked shadows, lens flares and better physics

· 1 min read

Video

Iron Cube has a new lighting system. Shadows are baked when the level is edited: for each voxel I cast a ray towards the light source, and if the ray hits anything on the way to the sun, the voxel is in shadow. The algorithm is primitive and took a couple of hours to write. Calculating the lighting for a whole level takes 20-30 seconds.

The shadows look smooth because they are applied at the corners of voxels, and they work well with the existing ambient occlusion and diffuse lighting. All of it runs on 7-year-old mobile devices.

The lens flares are fairly standard: transparent squares that move relative to the projected position of the sun. They disappear when a ray cast from the camera to the sun hits something on the way, which means the sun isn’t visible.

This release also has improved tank physics, a rescaled heavy tank and bug fixes.

Get it on Google Play