As background, my Accidental project is an exploration into many things procedural. The tool is merely an implementation of a Lua script command-line interpreter with some of my own home-grown tools. To see the floor script in action, execute the accidental.exe interpreter, then enter the following commands at the prompt:
dofile("tilingfloor.lua")setup(256,256)create_floor("tile.tga")
This generates a tile floor. As with most things procedural, the possible domain of variable settings is fairly extensive, even in this rudimentary stage. Open up the tilingfloor.lua file and take a look at the various values at the top. There are values for the number of points to seed the Voronoi with, the width of the mortar lines, radius of the blur effect, type and strength of turbulence, etc... A typical tile generated from the default settings looks like this:
I modified the lighting parameters of the bump map and reduced the detail of the mortar texture to reduce the problem noted in the preceding journal entry of the mortar lines appearing raised, rather than the stones.
There is another option I added (disabled by default) called dooverlay. Setting this option to true before creating a floor causes the stone texture to be overlain with a random color overlay, to give the various stones different hues. While this functionality is extremely crude at the moment, it could be used with more detail to achieve more realistic results. A sample floor created with overlay enabled looks like this:
Forgive the garish red colors; the table was thrown together in haste, and the overlay function is a simple half-and-half blend of the underlying texture and the overlay color.
You can modify the settings to achieve more complicated results. In this version, the mortar and stone textures are loaded from TGAs, but there is no reason they themselves could not also be procedurally generated.