We achieve this by packing a set of Wang tiles into a single texture map, ensuring that any tile edges shared between two tiles have identical edge color encoding. In our approach, we pack all the texture tiles into a single texture map without any boundary padding, in a way that makes it possible to perform the texture filtering directly via the texturing hardware without fragment program emulation. The first of these is computationally expensive, and the second consumes a large amount of texture memory. There are several possible solutions, among them performing texture filtering in the fragment program, or packing all tiles into a single texture and adding boundary padding between the tiles so that bilinear filtering would be correct. Specifically, given a collection of tiles, how do we perform filtering for the output virtual texture, especially when the sample is on the tile border and requires texels from multiple tiles for bilinear or trilinear filtering? One common problem with previous texture tiling or atlas approaches is the filtering issue. There are additional methods for constructing the tiles we refer readers to Cohen et al. The sample tiles previously shown in Figure 12-1 were generated with this approach. We have found that this approach works well for many natural texture patterns, and we provide the source code on the accompanying CD. This manual approach works only for line art.įor natural texture patterns such as those from photographs, there are algorithmic ways to build the tile set, as described in Cohen et al. Figures 12-5 and 12-6, later in this chapter, show a tile set drawn by me and the tiling results, respectively. One possibility is to draw the tiles manually all we need to do is to ensure that the drawings are continuous across tile boundaries while producing sufficiently interesting tiling results. There are several methods to construct the Wang tile set. A sample Wang tiling is shown in Figure 12-2.įigure 12-3 An Overview of Tile-Based Texture Mapping 12.2 Texture Tile Construction When a set of Wang tiles is filled with texture patterns that are continuous across matching tile edges, a valid tiling from such a set can produce an arbitrarily large texture without pattern discontinuity. A valid tiling requires all shared edges between tiles to have matching colors. Wang tiles are square tiles in which each tile edge is encoded with a color. There is a huge literature on nonperiodic tiling, but for our method, we chose Wang tiles for their simplicity (Cohen et al. To minimize visual repetition, we assemble the tiles nonperiodically. We represent a large texture as a small set of tiles and assemble the tiles into a large virtual texture on the fly for answering texture requests. Instead, we implement the texture tiling as a fragment program that handles the details of accessing and filtering the tiled texture. Specifically, we do not require changing the original geometry or texture coordinates in order to use texture tiles. Our goal is to present a tile-based texture-mapping scheme that is transparent to the application. The disadvantage, however, lies in the complication of application code and data. The advantage of this approach is that we can achieve infinite compression ratio in theory, because we can produce an arbitrarily large output from a few tiles. For more complex patterns, we can dice up the wall or floor into smaller polygons and apply different texture tiles or texture coordinate transformations for each polygon. Instead, we could have just one tile and repeat it on the wall. For example, if we have a large wall or floor consisting of repeating tiles, then obviously we don't have to store all the tiles. In addition, texture compression cannot handle the problem of texture size limit.Īn alternative approach is texture tiling, as shown in Figure 12-1. However, existing GPU texture-compression techniques such as DXT have a limited compression ratio. One possible solution to address these problems is texture compression. For example, the GeForce 6800 has an upper resolution limit of 4,096x4,096 for RGBA8 textures, and many other GPUs have stricter limitations. Third, most graphics cards impose an upper limit on individual texture sizes. Second, they can consume significant bandwidth, during either initial texture loading or rendering. First, they can consume significant storage, in either disk space, system memory, or graphics memory. There are several issues with large textures. Many graphics applications such as games and simulations frequently use large textures for walls, floors, or terrain. The CD content, including demos and content, is available on the web and for download. You can purchase a beautifully printed version of this book, and others in the series, at a 30% discount courtesy of InformIT and Addison-Wesley. GPU Gems 2 GPU Gems 2 is now available, right here, online.
0 Comments
Leave a Reply. |