Control Protocol Work Resumes

After having to take a break from Control Protocol work, I have recently resumed the project. I’m focused on getting part of the game complete which I will use to show (through a gameplay video and screenshots) and talk about the game. This will be when I announce the game properly and give people a better idea what Control Protocol will be.

One area of focus has been to start honing in on the look for the target area of the game and being able to start putting together the real levels. To that end I’ve implemented enhancements to the 3D sector system, proper model support and enhancements to the lighting system.

I implemented support for FBX files, which are converted to a binary format for use on the device. Blender can export FBX files, which I then run through a converter. The final files are then quickly loaded by the game. Currently materials, positions, normals and texture coordinates are exported with animation data coming soon.

The lightmaps were showing some color artifacting in bright areas – basically the result of clipping the color to fit within the limited 32 bit precision of the textures (8 bits per channel). The other problem is that bright areas could never exceed the base texture color, which resulted in flat – weird looking lighting if I made the light sources too bright. The obvious solution is HDR lightmaps but it should be obvious this isn’t workable for an iPhone/iPad game.

When saving the lightmaps, I look at the brightest color channel – we’ll call it ‘L’. If L is less then or equal to 1.0 I leave the color alone and set the alpha to 0 (no compression). If L is greater then 1.0, I divide the rgb color by L and store L-1.0 in the alpha channel (clamping at 1.0). Then when rendering the lightmap, the final lighting color is then lightmap.rgb * (1 + lightmap.a). This means that bright areas can have up to double the texture brightness and that color is preserved much better. Also all of the clipping artifacts just disappear. 🙂

You can see this in action here (cropped iPad resolution – taken in the editor):

What’s interesting is that I can use the alpha channel of the lightmap as a bloom mask, which means that on high end phones (and the iPad) I can apply an HDR-like bloom effect. This means that only pixels truly brighter then 1.0 or emissive will glow. I haven’t implemented this yet on the iPhone but I’ll show the results in the editor to give you an idea what it’ll look like:

Right now I’m also working on the data-driven UI system, which will allow interactive UI panels in the world similar to Doom 3. This will be used for puzzles and other in-world interactivity using a touchscreen interface. This system will also be used for the HUD, any status/inventory screens, the title screen and any other UI elements. After that I’ll start putting together some of the game UI elements.


~ by xlcontrol on June 26, 2010.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: