Nav links

Wednesday, 15 October 2014

Fractor 1.1 released

Get it on Google Play I've released a new version of Fractor, my speedy free real-time fractal generator for Android. Click on the button on the right to try it.

This update has some speed and memory optimisations, and an improved interface for phones running Android 4.0 and above. It also has some important bug fixes, which previously stopped the app from running on some specific hardware.

Squashing the bug

The original release of Fractor worked on every device I had access to, including the official Android emulator. However, I had reports that for some people the app would not even start. I recently obtained a phone on which this issue occurred, which allowed me to investigate.

The problem was within the OpenGL ES shader code, and caused by a constant (also known as a uniform) which was shared between different stages. As described in the official documentation:
Like regular OpenGL Objects, program objects encapsulate certain state. In this case, this state is a set of uniforms that will be used when rendering with that program. All of the stages within a program object use the same set of uniforms. Thus, if you have a uniform named "projectionMatrix" defined as a mat4 in both the vertex and the fragment stages, then there will be only one uniform of that name exposed by the program object. Changing this uniform will affect both the vertex and fragment stages.
The problem arose in certain phones which defaulted the uniform in question to different precisions in the vertex and fragment shaders. In both I defined it as an integer, but one defaulted to medium precision and the other to high precision. Having different definitions for the same constant caused conniptions. It has been fixed by explicitly setting the precision. Further information is available on Stack Overflow.

Now that this critical bug has been dealt with I can consider adding exciting new features.