WangTiles

 

 

Motivation
Creating realistic, natural-looking scenes presents a challenge to graphics programmers. The complexity of the real world requires modeling large expanses of non-similar objects. The traditional approach of repeating a small amount of complex structure on a large scale usually produces a visually unappealing and distracting image. Many large graphics studios lay out complex scenes by hand--a time consuming process. Cohen, Shade, Hiller and Deussen presented in 2003 a method of creating arbitrarily large non-repeating expanses of texture, geometry, and distributions using Wang Tiles.


Examples of large-scale computer-generated scenes abound in modern Hollywood productions. Often these scenes are assembled by hand.

 
 

Wang Tiles
Wang Tiles are sets of 2D patches that may be fit together to non-periodically tile a plane. Each edge of a Wang Tile is assigned a color; one lays Wang Tiles on a plane such that the colors of adjacent edges match. By tiling a plane from West to East and North to South one needs to find at any location a tile with an appropriate North-West corner. As few as eight Wang Tiles can be shown to generate non-repeating textures:

  • Horizontal and vertical edges each have two color possibilities
  • There exist 4 (2^2) possible North-West edge combinations
  • Doubling the number of tiles that have any NW edge combination allows for a choice when laying down any tile

Wang Tile set created by Cohen et. al. and a valid tiling of a plane.

One of my colored Wang Tiles.
 
 

Instead of tiling a flat plane, one may tile a parametric surface. The type of parametric surface determines the number of Wang Tiles needed to tile the surface--in general one needs (colors)^edges tiles to uniquely tile the surface, where edges is the maximum number of edges that need to be matched at any location and colors is the number of colors in use. In order to allow for non-repeating tiling, one needs to increase this number by some factor.

Consider tiling a sphere, for example. One would apply patches to the sphere like patches on a globe--patches would be parallel to lines of latitude. Each patch would have the same North-West corner criteria as seen in tiling a flat plane. The top and bottom of the sphere, however, would require special patches that could have any of the North or South colors on all of its edges. If two colors were in use this would require 2^4 = 16 tiles for a unique tiling and 32 tiles for random tiling.


Tiling of a parametric surface.
 
 

Extensions
This tiling only specifies how one should lay out a valid set of Wang Tiles. The contents of Wang Tiles is arbitrary. One may carefully fill a set of Wang Tiles with texture patches to create expanses of non-repeating texture. One may fill Wang Tiles with 3D objects, or specify the distribution of objects within tiles. The application to games, cinema, and advanced modeling is apparent.


Forest created using Wang Tiles.
 
 

One can also extend the concept of Wang Tiles to 3 dimensions--Wang Cubes would have six colored sides. When filling space one would need to color match 3 sides of a Wang Cube--a minimal non-repeating volume would require 2 * 2^3 = 16 Wang Cubes. One challenge of 3D Wang Cubes is deciding what sort of geometry one could add to each cube to create an interesting scene. Particle systems such as clouds and stars have been suggested by Cohen et al. Perhaps one could also create volumes of sea life, aerial battles, blood plasma, or dust particles.


Single Wang Cube and a set of Wang Cubes filling space.
 
 

Goals
The goal of this project was to implement 2D and 3D Wang Tiles (Cubes). We demonstrate an effective algorithm for creating and displaying Wang Tiled planes, and support 3D geometries, parametric surfaces (sheets), and arbitrary scaling. We extended the concepts of 2D tiles to 3 dimensions, and created some interesting volumes of non-periodic geometry.

One key issue addressed by Cohen et al is beyond the scope of this project: automatic and interactive creation of interesting textures and geometry distributions. Some of the images created with this project may not be strictly non-periodic; for example, it is much easier to place one piece of geometry in each tile than to allow geometry to overlap tile boundaries. A reasonable attempt was made, however, to come up with interesting examples.