Back to the floor

Published October 24, 2008
Advertisement
After posting the previous, I kept on tinkering and removed a few steps from the process. It didn't make sense that I kept having to bounce back and forth between the GIMP and the Accidental tool, so I proceduralized the entire thing, removing the GIMP stages completely. The result can be found here. This link is to an executable of my Accidental tool, along with the Lua scripts for this tiling floor creation method, and associated textures.

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.
Previous Entry Programmer Art
Next Entry Still floored
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement