Game Development Reference
In-Depth Information
Figure 2.2. Faces that are adjacent in model space are not generally adjacent in texture
space. A filter kernel that spills over the edge of a face must pick up texels from the
adjacent face, which will generally be somewhere else in the texture atlas.
We copy
border texels from adjacent face textures to handle this case.
Just as in the original Ptex system, each face texture has its own mip chain.
We sort the faces by their base (level 0) resolution to create the packing we
describe here, and for runtime as described in Section 2.3.2. Since we are including
face textures with different base resolutions, a given block will include different
mip levels ( Figure 2.1 ).
Borders for Filtering
Texture filtering hardware assumes that neighbors in texture space are also neigh-
bors in model space. Generally, this is not true either for conventional texture
atlasing methods nor for Ptex. It's the reason conventional texture atlasing meth-
ods often come with seam artifacts.
For our method, we copy texels from the border of a neighboring face to
solve this problem (Figure 2.2). That way, there will be data available when
the texture filter crosses the edge of the face texture. The padding on each side
will be equal to at least half the filter width. This is a common solution to the
problem, particularly for situations like tile-based textures for terrain. However,
the memory overhead for this solution is generally much higher for Ptex than for
conventional texture atlasing methods. This is one disadvantage in using Ptex;
anisotropic filtering quickly becomes too expensive in terms of memory cost.
Texture Compression
Current GPUs have hardware support for texture compression. The compression
relies on coherency within 4
4 texel blocks.
For this reason, it is best not
4 block span face textures. We have already discussed adding a
single-texel border to support hardware bilinear filtering. To get good results
with compression, we add an additional border to get to a multiple of 4
to have a 4
Generally, this means two-texel borders for compressed textures.
Search Nedrilad ::

Custom Search