Game Development Reference
In-Depth Information
rently targets meshes consisting of quads. There can either be additional memory
cost or savings relative to conventional texture atlasing methods depending on
the particular circumstances.
Although this approach works for many texture types, it works particularly
well for vector displacement mapping. The lack of seam issues is particularly
valuable for this application, while many of the drawbacks of the approach are
irrelevant.
There are two barriers to real-time performance in the original Ptex method.
First, it's typically not practical to have an individual texture for each primitive.
Second, the indirection required when a filter kernel crosses from one face to
another is costly in performance, and precludes the use of any hardware texture
filtering. The next section describes the oine process to address these issues.
Then we follow up with how to use this at runtime and some details related to
displacement mapping. We finish by discussing the tradeoffs of this method as
well as some possible alternatives.
2.2
Packed Ptex
To reduce the number of textures required, we pack all face textures and their
mip chains into a single texture atlas (Figure 2.1). The atlas is divided into
blocks of the same resolution. Within the block, the face textures are packed one
after another in rows. Because the atlas width generally is not a multiple of the
face-texture width, there will be unused texels at the end of each row. There will
be additional empty space at the end of the last row, because it generally will
not be filled to capacity.
32 × 32
64 × 64
128 × 128
Figure 2.1.
This is a portion of a packed Ptex atlas.
There are four faces that have
128
×
128 base (level 0) resolution and one with 64
× 64 base resolution. The block of
64
×
64 contains both the one level 0 for the 64 ×
64 face texture, and the four level 1
mips from the 128
×
128 face textures.
 
 
Search Nedrilad ::




Custom Search