Hi again 4fingers.

I should have mentioned that I'd replaced the texture lookup with a procedural circle in my code above. I did this mainly because I was working through the GPU Gems page primarily because I wanted to implement the Voronoi method mentioned later on. I did actually get somewhere near 20-10a, but it's still a bit 'glitchy' in places.

Code :
varying vec3 MCPosition;
 
//Create uniform variables so dots can be spaced and scaled by user
uniform float Scale, DotSize;
uniform sampler2D RandomTex;
 
// Create colors as uniform variables so they can be easily changed
uniform vec4 BGColor, PolkaDotColor;
uniform vec3 DotOffset;
uniform vec2 PositionTextureMultiplier;
 
void main(void)
{
	float radius2;
	vec2  randomXY;
	vec3  finalcolor = BGColor.xyz;
	vec3  dotSpacing = vec3(Scale);
	vec3  scaledXYZ = MCPosition * dotSpacing;
	vec3  cell = floor(scaledXYZ);
	vec3  offset = scaledXYZ - cell;
	vec3  currentOffset;
	vec4  random;
 
	float priority = 999.0;
 
	for(float i = -1.0; i <= 0.0; i++)
	{
		for(float j = -1.0; j <= 0.0; j++)
		{
			for(float k = -1.0; k <= 0.0; k++)
			{
				vec3 currentCell = cell + vec3(i, j, k);
				vec3 cellOffset = offset - vec3(i, j, k);
				randomXY = currentCell.xy * PositionTextureMultiplier + currentCell.z;// * 0.003;
				random = texture2D(RandomTex, randomXY);
                	currentOffset = cellOffset - (vec3(0.5, 0.5, 0.5) + vec3(random));
 
				radius2 = dot(currentOffset, currentOffset);
				if(radius2 < priority)
				{
					//finalcolor = texture2D(RandomTex, randomXY + vec2(0.13,0.4)).xyz;
					finalcolor = vec3(radius2 * 2.0);//texture2D(RandomTex, randomXY).xyz;
					priority = radius2;
				}
			}
		}
	}
 
	gl_FragColor = vec4(finalcolor, 1.0);
}

I'd like to get to 20-10b, but I'm not to sure how to increase the number of samples per cell. In fact, this itself is only a stepping-stone to what I'm really after, which is some kind of realtime voronoi approximation based in live camera input rather than a random texture. I think the code will need quite a lot of tweaking to get to that though. I'll need much larger variation in the sizes of the regions, which I guess means a smaller cell size, but more samples per cell. Lots of intriguing possibilities....

a|x