Tuesday, June 29, 2010

Aquarium v1.6

- Bug Fix: Smoothing home screen scrolling
- New Feature: Angel fish!
- New Feature: Trigger fish!
- Update: Faster plant motion
- Update: More colors in default backdrop

Nothing too crazy, just progressing with more artwork mostly.  The smoother scrolling is the same code as Galactic Core for the same reasons, that's one that's snuck into most of my wallpapers and will get fixed as updates occur.  Beyond that I got some comments that the default background is too purple, so I pulled it a little more towards cyan and allowed more of the colors to show through.

android.Bitmap and premultiplied alpha

While working on City at Night, I had to work out how to get the streaks of traffic to blend cleanly with the photographic image.  I couldn't just stack them on top, because they need to be behind the signs and lamp posts that line the road.  I also wanted to keep my number of passes to a minimum.

After some consideration, I decided to render the streaks first, then draw the city image on top, with an alpha channel cutting out the roadway features.  The plan was to blend this using GL_ONE GL_ONE_MINUS_SRC_ALPHA, which would keep all the brightness of the source image, but mask out streaks based on the alpha channel.  Simple.

I made my alpha cutout, got the images loaded, and discovered that my road surface seemed awfully dark.  Holding  the phone side by side with my original, they were really strangely dark.  My first thought was to blame Gimp, which I used to create the alpha.  I've seen it needlessly throw away color data in places with 0% alpha before.

After double and triple checking Gimp and not solving the problem, I downloaded paint.net and tried it there, but got the same result.  Then I tried it with an out of date version of Paint Shop Pro that I know for an absolute fact didn't mess with the color channel when you changed the alpha.  Same problem.

At this point I was confident the image was fine.  That means that after the image gets loaded, my colors turned dark.  I conducted an experiment by making a java array of a 2x2 texture, with pure white colors but alpha values of 50%.  I used android.Bitmap to make a bitmap of this, and lo and behold discovered that when blended GL_ONE GL_ZERO, I got middle grey instead of white.  Ahah!

So, the question then was:  is this happening at load time or when I hand it to OpenGL?  I pack my color values into ints and hand the array directly to glTexImage2D, and when I do that, I get the pure white I'm expecting.  Some searching around online confirmed this - android.Bitmap premultiplies your alpha for you, and there's no way to stop it from doing so.

This identified the culprit but didn't solve the problem.  PNG itself is a relatively complex image format, but I've read TGA files before, so proceeded to get a TGA loader working.  Reading in a TGA and handing the resultant arrays to OpenGL finally got me proper colors on my city highways, at the cost of some bloated filesize

So, if you're trying to do any kind of special alpha blending and are having mysterious problems with the colors in your artwork, keep that in mind: android.Bitmap forcibly premultiplies your alpha, so your colors will be darker than you started.

Angelfish!

Should be in the next Aquarium update, along with a touch sensitivity fix and a few other small things.  A pic from the modelling program:

Monday, June 28, 2010

City at Night v1.0

Going back to my "Beautiful backgrounds, but better" philosophy, this wallpaper takes a gorgeous image of Kuala Lumpur at night and animates the clouds and the slow-shutter-speed traffic streaks.  It's quite pretty and I'm very happy with the results!

Galactic Core v1.52

- Bug Fix: Smoother home-screen scrolling
- Bug Fix: Better enable/disable of the orientation sensor

I spent a substantial amount of time trying to problem-solve the orientation sensor option's battery usage, and while I did get the wallpaper to enable/disable the sensor more properly, the battery usage screen still reports very high usage by the wallpaper when this feature is enabled.  I almost wonder if this is a bug, as even though I'm requesting the default sensor update frequency (which should be the same as the UI is already using, meaning it shouldn't cost any extra work), it seems much too responsive for that.  Maybe default and ui speed updating is broken on my Incredible?  Changing it seemed to make no difference at all to responsiveness or battery usage.

This update also included the removal of a 33ms delay when getting touch updates.  This was actually sort of intentional, as it was inherited from Synergy.  For whatever reason this was necessary in Synergy to avoid huge framerate hits when you touched the screen.  As part of a wallpaper, however, it seems like the touch thread is the same one that's doing home-screen swiping as well, so that 33ms delay was making swiping from one screen to the next less responsive feeling.  A stupid bug, but that happens sometimes.

I have gotten a couple from folks saying this update flickers for them sometimes, but it's rock solid on my HTC Incredible.  I received a logfile from one user that didn't have anything suspect in it, and am currently wondering if it's only on a specific handset.

Friday, June 18, 2010

Aquarium v1.55

- Update: Higher res background images
- Update: Localization into French, Italian, German, Spanish

The biggest change here is actually the default (blue) background.  The original source image wasn't high res enough, so I had to go looking for alternatives -- a surprisingly time consuming process, as the backdrops for Aquarium require a fairly specific camera angle and layout.  I did find a good candidate, and while it needs a bit more touch up think it's a solid improvement to the overall sharpness.

The other backgrounds already had source material of at least 1024x1024 in size, so they're not appreciably different.

This is in testing now, and will likely be uploaded Sunday.

Monday, June 14, 2010

Aquarium v1.5

- Update: Molly replaced with clownfish
- Update: Higher res fish textures
- Update: Raised the fish limit to ten

After a lot of complaints about the salt/freshwater mixing, everything's finally in the saltwater camp.  At the same time I doubled the resolution of the fish textures, which made a noticeable difference on some phones.  I also upped the number of allowed fish to ten, though the default is still six.

Saturday, June 12, 2010

YouTube Videos of All Wallpapers

Got these made and uploaded this morning, something I've been meaning to do and putting off for god knows how long.  Links are on the Wallpapers page.

Friday, June 11, 2010

Clownfish model!

That's right, due to popular demand the molly is going away in favor of a clown fish.  I just got him modeled, rigged, and animated and he looks quite good swimming around!  Here's a pic from inside the modeler:
















When the alpha's working, he reads quite well for 55 triangles.  :P

Thursday, June 10, 2010

Silhouette v1.4

- Update: Time of Day now has four keyframes instead of three
- New Feature: User-selectable time of day images
- New Feature: Time of day preview

All this is available via the settings button.  Select which image you want for each of the four time points (midnight, 6am, noon, 6pm) and it'll use them if you're using the time of day option.  In addition, there's a "Super Fast Day" checkbox that will cycle the whole day in about 12 seconds, so you can see how it looks with your selected images.

Wednesday, June 9, 2010

Galactic Core v1.51

- New Feature: Enable Mipmapping pref
- Bug Fix: Halo around first pass

I made mipmapping a pref rather than a default because I've since become aware that at least one handset provides an OpenGL 1.1 instance that doesn't actually support the baseline 1.1 features -- in this case I think it was a Moment.  Running Cyanogen, admittedly, but as I expect the drivers were the Samsung originals I'd rather get my libraries using a pref now rather than later.

The halo thing was frustrating.  Basically, the first pass of the Galactic Core wallpaper is a very detailed image, and to save file size I made it a JPG.  Well, I've noticed since then that on some screens you could see a slight grey outline where the geometry was... even though when opening the image in an image editor it reports true black on the edges (Meaning an RGB of 0,0,0).  Switching this back to a (much bigger) PNG fixed this.  As best I can tell, the jpg decoder on an HTC incredible won't quite let black be black, so that's the workaround.

A similar problem was happening with the additive bubbles in Aquarium, and switching it to a PNG, once again, fixed it.

Tuesday, June 8, 2010

Aquarium v1.45

- New Feature: Double tap to feed fish!

This also incorporated a couple of other minor issues and so on being addressed.

If the fish in general seem to behave more actively, that's because a ton of restructuring happened to enable support for multiple behaviors and switching between them, so not everything shook out to be exactly the same math as previously.  The actual feeding behavior seems to work fine and transition in and out pretty well, and considering the simplicity of the system does a good job of creating the illusion, I think.

Friday, June 4, 2010

Thursday, June 3, 2010

To Do List

So there's a few items that've piled up, here's what's on deck:

- Fix mipmapping (again) as the current implementation is unsupported on at least one handset
    - Done
- Add behaviors to Aquarium fish
    - Create a real AI structure - Done
    - Feed the fish - Done
    - Scare the fish
- Model and animate a clownfish - Done
- More preferences for Flowers
    - Lighting - Done, ended up being not worth it
    - Camera Speed - Done
- User-selectable images for Silhouette time-of-day feature
    - Add prefs for this - Done
- Look into removing the "eglMakeCurrent failed" exception
    - Need physical keyboard phones to test with here
- Galactic Core stuff
    - Add mipmap pref, should help framerate in some handsts - Done
    - Investigate sensor battery usage, fix - Done