in development

an endless golden thread, droid style

Well, you know how it is. You buy a tablet, because tablet. Then what?

I’ve ported my Soar toolkit and my thread demo over to Android. Sources can be found at my GitHub hangout and are free to do whatever you want with.

Android’s not a bad enviroment, and the GUI and OS concepts should be familiar to anyone who’s ever done native application work. Java is…Java. It’s clunky but sort of comfortable after a while, like a bulky jacket on a cold morning, and takes forever to put on. Oh, it looks like something your mother picked out for you. Ha! Buuuuurn.

As WebGL wraps OpenGL ES—also like a jacket of some description—I had little difficulty porting the code. I missed closures and first-order functions, but it wasn’t hard to get back into the Java mindset of packing everything into little class boxes.

In fact, the only area I had to strain my brain was shaders. The GLSL code ports directly, but mobile GPUs aren’t anywhere near as powerful as their desktop pals, so my original shaders lagged horribly. I had to cut them down just to get 30 fps. Then, I found surfaces turning blocky and pixelated over long distances. I texture some surfaces using absolute positions instead of texture coordinates in order to achive long-period patterns. Works fine on the desktop, but on a mobile GPU, the loss of floating point precision has a noticable effect as the numbers get bigger. I have a workaround in place which uses a modulus of the position, but it looks kind of messy in places. Ah well.