This series od experiments are devoted to the developement of fragment shaders that can be configured to generate a wide range of tunnel like backgrounds with the configuration being performed via parameters that are defined in a scene file. Currently only one such fagment shader has been developed, though a rather different one is under consideration. ======================================================================= The "TheEmu - Tunnel A.fsh" fragment shader was originaly inspired by Inigo Quilez's Deform - Square Tunnel downloaded from ShaderToy.com, but other than using the same Minkowski distance metric has nothing in common with it, though it can be configured to produce the same tunnel shape. The shader works by tiling its output window with repetitions of a distorted "tunnel wall" image. By default these will comprise a series of nested rings giving the impression of a tunnel disapearing into the screen. Any image may be used, though the effectiveness of the final result will depend on selecting a suitable image. Simple images such as a rock wall should always be effective, but more complex pictures such as a landscape can be more problematic - though it has been found that most "straight on" views, such as the 2D backgrounds provided by Totem, are reasonable choices. By default the shader generates a static image, but apparent motion along the tunnel's axis may be generated under control of the speed parameter. Refer to the comments in the shader source for details of this parameter. The shader can either wrap one or more repetitions of the tunnel wall image through a full 360 degrees or through 180 degrees and reflect it verticaly, horizontaly or diagonaly. This is controlled by the mode and repeatAngle parameters. Refer to the comments in the shader source for details of these parameters. The shape, position and orientation of the tunnel and the length of each section can be configured by using the shape, center, alpha and zScale parameters. Refer to the comments in the shader source for details of these parameters. By default the copy of the image used to tile the tunnel wall has the same orientation. If the image has not been specialy desined for use as a tile this will result in discontinuities where the tiles meet. It is possible to reduce this by "flipping" alternate tiles so that there are matching colours at the joins. This tile flipping is controled by the tileScheme parameter. Refer to the comments in the shader source for details of this parameter. By default the tunnel walls are tiled without distorting the tunnel wall image with one side of the image parallel to the tunnel axis. If normal images are used the tunnel looks like an untwisted tube (though specialy designed images can change this appearance). However, it is possible to distort the image such that when used to tile the tunnel it appears to be twisted. This is controlled by the twist parameter. Refer to comments in the source for details of this parameter. By default the colours used for the tunnel walls are just those taken from the the supplied tunnel wall image, including preserveing any transparent or partialy transparent area. However, it is often better to fade the colour towards black or white with distance along the tunnel increases as this increases the illusion of depth and also will hide "pixilation" effects in the very small copies of the tunnel wall image that are used for the far end of the tunnel. It is also possible to make the whole tunnel translucent. These effects are controled by using the fade, fadeColour and translucency parameters. Refer to the comments in the shader source for details of these parameters. It is possible to replace the end of the tunnel with a vertical wall, or introduce gaps between tunnel sections. The end wall and gaps are transparent by default but any colour may be used instead. These are controled by the endSize, endColour, gapSize and gapColour parameters. Refer to comments in the source for details of these parameters. ----------------------------------------------------------------------- In order to adequately cover the different configuration possibilities a large number of experimental scenes are used. These are divided into two main groups, A0 and A1. The A0 group is used to look at the effects of individual parameters using a static tunnel. The A1 group looks at slightly more complex combinations of parameters using a moving tunnel. In most of the scenes the image used for the tunnel wall is selected at random from the Images subdirectory. In some cases a specific test image is used, one that clearly shows the effects of tile orientation and twisting. =======================================================================