“Greebles” are those thousands and thousands of little tiny details you’ve seen on the surface of spaceships in science fiction movies. Think of the star destroyers from Star Wars — all those tiny grey dohickeys all over the ship are called “greebles.”
I’m interested in generating greeble-like textures not because I want to model spaceships (though I suppose that could be fun) but because the idea of variegated and detailed 3-D surfaces appeals to me as the procedural equivalent of a bas-relief. My first attempt at executing this used Cinder and OpenGL, but I found that the images I was able to render didn’t include a very essential property of greebling or bas-relief: self-shadowing. Without pieces of the structure casting shadows on other pieces of the structure, the surface looks dull and lifeless. It’s possible to create shadow maps in OpenGL, but the way a basic shadow map works is that you have a distinct shadow-casting object and a surface being shadowed. With the kind of complex surfaces I was planning to model, almost every object would be both shadowed and shadowing another object. So, rather than diving even deeper into advanced types of shadow maps and/or shadow volumes, I just ditched OpenGL and turned to POV-Ray.
POV-Ray turned out to be perfect for this. The syntax is simple and the usage is easy: in your text file, you just describe the objects in your scene, cameras, lights, etc., and compile it. Here is the result of my first attempt at an autogreebling algorithm:
The algorithm is recursive: basically there’s a function that takes as input a rectangular area on the x-y plane specified in terms of left, right, top, and bottom edges. This function extrudes a box of that area in the z direction and then subdivides randomly into 4 smaller areas, and then recursively calls itself. When the area of a box gets small enough, the base case is reached and the recursion stops.
I’m hoping to do more with this technique.