Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Tài liệu 3D Game Programming All in One- P16 docx
Nội dung xem thử
Mô tả chi tiết
Then choose Image, Rotate, Free Rotate to get the Free
Rotate dialog box (see Figure 11.9).
Click the Right button in the Direction frame, and click the
Free button in the Degrees frame. Finally, type 1.00 in the text
box next to the Free button, and click OK. This will rotate the
selected area 1 full degree to the right (see Figure 11.10).
You should have your rotated area with the selection marquee still surrounding it. Don't touch anything yet—leave
the selection as it is.
Now after having explained the Crop
tool, I'll show you another way to
crop the image that is sometimes
more convenient than using the
Crop tool. With the rotated area still
selected, choose Image, Crop to
Selection and the image will be cropped for you!
You will then end up with an image as shown in
Figure 11.11 suitable for use as a texture.
Now compare Figure 11.11 with Figure 11.7
and you will see the difference.
Original Artwork
The other approach to creating textures is to
use original artwork. Some people believe this
is not a real option for them, because they
think they can't draw or paint to save their
lives. I tend to feel that everyone can learn the
techniques required. My intent here, however,
is not to teach you how to draw, so if you want
to learn more, I encourage you to look into taking some lessons.
If you are satisfied with your artistic skills, then
you have another rich avenue for texture generation available to you. The techniques used to convert a photograph to a texture can also
be used to convert your hand-made images to textures.
Another approach for creating original artwork is to create your images directly in a tool
like Paint Shop Pro. You can draw freehand using the mouse or a pen tablet.
Sources 357
Figure 11.8 Rectangular
Selection tool icon.
Figure 11.9 The Free Rotate dialog box.
Figure 11.10 The rotated woodgrain.
Figure 11.11 The cropped woodgrain
image.
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
With tools like Paint Shop Pro you have a wide variety of means for creating textures,
including a specific Texture Effects tool in the Effects menu, as shown in Chapter 8. Figure
11.12 shows examples of textures created using the built-in features of Paint Shop Pro. I
encourage you to explore this tool in depth. It can really be a timesaver. And you can use
it to create some knockout textures.
Scaling Issues
When creating your textures, you will need to pay
attention to the issue of scale. The sizes of the things
within an image that is used to make a texture have a
particular relationship to other real-world objects. We
are subconsciously aware of many of these relationships from our exposure to the world in general and
will notice when the textures are out of proportion to
the items they adorn. If it's bad enough the effect can
sometimes be similar to the sound of fingernails being
dragged across a chalkboard!
Figure 11.13 shows two stylized houses.
The bricks in house A are far too large,
while the bricks in house B are more
appropriately sized, yet may still be a bit
too large. Yes, there are some uses for
stone blocks having proportions such as
those in house A, but they are rarely
used in bungalow-sized or two-story
homes, as depicted in the figure.
The scale issue can pop up anywhere, as you
can see in Figure 11.14. The texture image in
the corrugated metal bridge surface is probably
about 10 times larger than is appropriate.
Sometimes you might need to redo the texture
to match—other times you can adjust how the
texture is applied to the polygons using the
modeling tools. My rule of thumb is that if the
texture image size is 64 pixels by 64 pixels or
smaller and needs to be made larger, you
should make a new texture at the larger size.
The same goes the other way: If the image size
358 Chapter 11 ■ Structural Material Textures
Figure 11.14 Scaling error.
Figure 11.13 Scaling bricks.
Figure 11.12 Example textures.
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
is larger than 64 pixels by 64 pixels and needs to be made smaller, then make a new texture at the smaller size.
Tiling
Many structures have large surfaces with repeating patterns. The best way to approach
making textures for these surfaces is to create one smaller texture that is replicated many
times across the surface, rather than simply making one large texture.
The replication will usually take place in two dimensions. It is important to make sure that
the edges of the texture align properly when they meet. Figure 11.15 shows this to good
effect. You can see the obvious horizontal as well as the more subtle artifacts in house A
where the tiled brick textures don't quite line up. In house B, where care was taken to
ensure that the texture edges matched up correctly, those artifacts aren't visible.
However, in house B in Figure 11.15 there
is another obvious artifact of tiling, this
time caused by asymmetric lighting
effects in the texture shading. You can see
each repeated texture tile—its position is
marked by the presence of the darker
shaded bricks in a repeated pattern. This
effect can be quite subtle and difficult to
detect in an image viewed in isolation.
Figure 11.16 shows the texture used in house B of Figure
11.15. Looking at it in isolation, you would be hard
pressed to notice the subtly darker shaded bricks.
The simplest way to fix up a texture for use as a tiled texture is to copy the left edge, about 5 or 10 pixels wide,
mirror the copy horizontally, and then paste the copy on
the right side of the image. Do the same for the bottom
edge. Of course, you can go from top to bottom or right
to left as well. The important step is the mirroring.
After placing the mirrored edges, spend a little time
blending their inner edges with the interior portions of
the image.
Figure 11.17 shows a stone block texture that is a candidate for use in a tiling situation.
Figure 11.18 shows the texture tiled in a set of four. Again,
you can see the artifacts caused by the mismatched edges.
Tiling 359
Figure 11.15 Tiled brick texture.
Figure 11.17 A stone texture.
Figure 11.16 The brick texture
with asymmetric shading.
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.