Archive for May, 2009

Can’t Read Alpha Channel of Textures

Wednesday, May 6th, 2009

I’ve made a bit more progress since last time. It seems that the problem was that I wasn’t getting the alpha value of the texture maps correctly. I found a couple web pages that talk about the problem of alpha channels with glReadPixels, but I think they’re both talking about Mac OS X and not iPhone specific Open GL. I did find one other guy that was doing iPhone stuff with glReadPixels and alpha channels but he seems to have the same problem I have.

Fortunately, in my case, it’s just a single channel stencil mask so I can just copy the red channel for the alpha channel. It’s a bit inefficient and kludgy. But hey, it works. And after spending several days on this one issue, that’s all I care about.

Saving Texture Files

Monday, May 4th, 2009

Part of the Hologram app is drawing something on the screen. That means dynamically modifying a texture map based on touches on the device. This is done through framebuffers which allow you to render into that texture map. I’ve got that part working. But eventually, I’d like to save out those texture maps and that’s where it’s getting a bit tricky. I’ve almost got it working through a call to glReadPixels and something like this. And then I need to convert that data into an image using CGImageCreate and CGDataProviderCreateWithData doing something like this.

The problem is that the process seems to work the first time I load a file, but not after that. I think I’m close to fixing it, though…

Hologram Icons

Friday, May 1st, 2009

Icons are important for any piece of software nowadays. But they’re even more important for iPhone apps. With such limited real-estate and no method for doing things like hover-text, your icons have to be simple, clear, and self-explanatory.

So here’s a question: can you guess what each of the icons in my Hologram app does? (Incidentally, that’s my cat Bandit helping me beta test my software.)