Lesson 11: Texture Mapping
The goal of applying shaders is to give objects color
and texture. Lesson 10 showed you how to create color with shaders. In
this lesson, you learn how to add texture effects to your shaders to give
you more photorealistic renderings. This lesson addresses several mapping
techniques such as color, bump, displacement, and
stencil.
After adding color ramps to the apple and banana,
you add a label. Next, you apply a marble texture to the table and a bump
map to the fruit bowl's glass shader. By quick rendering the scene periodically,
you can evaluate the results at various stages.
Initial setup
You start by opening the fruitbowl file from Lesson
10. You can use either the file you saved or a provided CourseWare project
file.
Open the file
- From the File menu, select Open.
- Double-click the file named myfruitbowl2 from the CourseWare
project folder in the File Lister. The shaders created for this wire file
were saved and are accessible in the Multi-lister. OR...
- If you did not complete Lesson 10, or you do not have the necessary
file, select the L11_Fruit2 file in the CourseWare directory. It
contains the necessary wire file and shaders.
Creating a projection map
In this section, a planar projection map is used on
the apple. A planar projection places the texture on a separate Surface
Placement object instead of the object itself. The placement object
can be transformed in 3D space until the texture is properly "projected."
When you use projection map, you can ignore the seam
that was created when the apple was built, and apply the texture evenly
over the whole surface.
Open the Multi-lister and the Shader editor
- Select Multi-lister
Shaders from the Windows menu.The Multi-lister lists
all the shaders created in
Lesson 10.
- Double-click on the Apple shader icon to open the Shader editor.
Open the Color Map window
- In the Common Shader Parameters section of the editor, click
the Map... button next to Color.

The Texture Selection window is displayed.

Note: Choosing a texture map for the apple
automatically overrides the previous definition.
Choose a solid projection map
- In the Texture Selection window, click the arrow next to Solid
to display the different Solid textures.

- Click the Projection button to select a Solid Projection texture.
This creates a new icon named Projection #2 in the Multi-lister.

Once defined, this projection map is used as the
color map for the apple. The Shader editor now contains the parameters
and options associated with the projection texture.

The Projection type defaults to PLANAR,
which is the right setting for this exercise.
Pick the apple shader from the Multi-lister
The next step is to link the projection to the apple.
Click the Apple shader icon in the Multi-lister to make it active.
Select Shading
List Objects An object list appears, displaying surfaces
associated with the Apple shader.
Click revolveA to pick the apple object in the view windows.
Close the List Object window.
Tip: Since this is a simple scene, you can
easily pick the apple using
Pick
Object
from the Tool Palette. If, however, the scene was complex and it was difficult
to find the object belonging to the shader, using
List Objects would be a useful alternative.
Link the shader to the picked object.
In the Multi-Lister, click the Projection#2 icon to make it
active.
Open the 3D Placement section of the editor to view the parameters.

Click the LINK button next to
Link with Object to link the projection texture with the apple.
This ensures that the texture stays linked to the apple,
even if the apple moves in the scene. Although the option now reads UNLINK,
you have linked the two items together.
Creating a Ramp texture
Now that the project map is linked to the apple, you
can create the actual color map. To do this, you use a Ramp texture
as the source texture for the projection.
Select a Ramp as the source texture
- In the Projection Texture Parameters section at the top of the
editor, click the Map... button next to Source Texture to
open the Texture Procedures window.

- Open the Surface texture section and click the Ramp button.

- This opens the editor for the Ramp texture and creates another
icon called Ramp#2 in the Multi-lister.


Change the Ramp type and Interpolation
- Select CIRCULAR as the Ramp Type to apply the color in
a circular manner, and change the Interpolation to BUMP IN
to get a smooth transition between the ramp colors.

Note how this change affects the linked maps and
shaders in the Multi-lister.
Change the colors of the Ramp
You only need two colors for this particular texture.
Click on the X next to the blue color to delete it. This leaves only
red and black.

Slide the red to the top of the ramp by grabbing the red circular handle
and sliding it to the top.

To edit the black, click the circular handle, then click in the black
color sample beside Ramp Color to open the Color editor.

Change the black color to a greenish yellow by changing the HSV values:
60 for Hue (H), 0.675 for Saturation
(S), and 0.725 for Value (V).

Close the Color editor before proceeding.
Add a bruising effect to the apple using noise
You can make the apple appear more realistic by adding
surface discoloration.
In the Ramp Texture Parameters section of the editor, change
the Noise value
to 0.1.
Open the HSV Color Noise section of the Ramp editor.
Change Noise Val to 0.1 to add a slight, realistic bruising
to the apple.


Positioning the Projection map
Next, you position the Projection map.
Select the Projection#2 texture
- Close the Ramp editor, but leave the Multi-lister open.
- Click once on the Projection#2 texture icon in the Multi-lister
to make it active.
Turn on the Texture Placement Object
- Click the small box icon in the lower right corner of the texture icon
that represents the Texture Placement Object. This shows a 3D representation
of the solid texture in the modeling windows, which helps place textures.

Note: This object is invisible by default
unless it is either turned on as you have just done, or made visible in
the SBD or ASBD window.
Pick the Texture placement object
Select Pick
Nothing from the Tool Palette and then select
Pick
Component-
to check the settings. Make sure that All is set to On,
and click Go to continue.
Click on the Texture Placement Object without selecting any other geometry.
The Texture Placement object is a cube 1 unit in all directions, placed
at the center of the apple.

Xform the placement object
With the Top window active,
select Xform
Scale
from the Tool Palette and click-drag to make the placement object as big
as the apple.
Select Xform
Move to move the placement object so that its gridded face
covers the whole apple in the Top view.
Tip: Because this is a projection map,
you can align the placement object entirely in the Top view.
Select Pick
Nothing to de-select the placement object.
QuickRender the Perspective view
Click on the Perspective window to make it active.
Dolly and tumble the view to see more of the fruitbowl.
From the Render menu, select
Quick render-
,
and in the option box change the Shading Frequency to 10
for a higher quality render. Make sure that Textures and Turbo
Assist are toggled on, then click Go.

Click in the QuickRender window to close it.
Make the Texture Placement object invisible
In the Multi-lister, click the Texture Placement Object box in the
Projection#2 icon to make it invisible.
Note: Because the apple and the placement
object are linked, the two will move together if the apple is later Xformed.
Surface Mapping
Next, you modify the Banana shader by adding a color
ramp to make the banana ends black. In this example, however, you place
the texture with surface mapping. This means that the texture is "stretched"
around the banana surface, instead of being "projected" onto
it.
Tip: In this case, the texture is not
mapped into the XYZ world space, but rather on the UV space of the banana's
surface. The relationship between UV space and XYZ space is shown below.
Edit the banana's shader
- In the Multi-lister, double-click the Banana shader to open
the Shader editor.
- Click the Map... button next to the Color sample to open the
Texture Selection window.
- Click the Ramp icon to create a ramp texture. The Multi-lister
window now displays a Ramp#3 icon and the Shader editor contains
the parameters associated with the Ramp.
- Change the Ramp Type to U RAMP, and the Interpolation
to SMOOTH.
- Click the circular handle that defines the position of the black color,
then click on the color sample next to
Ramp Color to open the Color editor.
- Change the HSV values as follows: Hue to 0, Sat to 0,
and Val to 0. Leave the Color editor open.
- In the Ramp editor, click the circular handle for blue and set the
same values in the Color editor to change it to black.
- Click the circular handle for red, and change its values to 47
for Hue, 0.725 for Sat, and 1 for Val.

Add Noise to the Ramp
Add some surface discoloration to the banana so that
it looks more realistic.
- Change the Noise parameter of the Ramp texture to 0.05.
The shader icon shows the result in the Multi-lister.

- Close the Color editor and the Ramp editor.
QuickRender the banana
- From the Render menu, select Quick render. Notice
how the Ramp texture has been mapped along the length, or U direction,
of the banana.
Tip: If you wanted the surface texture
to map along the width or V direction, you could change the Ramp Type
to
V RAMP.
Stencil Map the banana
The Stencil texture is used to overlay a label pix
and mask file onto the banana. The ability to overlay multiple textures
on the same object gives you tremendous flexibility in defining the appearance
of objects.
Open the Ramp editor and the Effects options
- Double-click the Ramp#3 icon in the Multi-lister to open the
Ramp editor. Scroll down and click to open the Effects section of
the editor.

Create an overlay map
- Click the Map... button next to Overlay to open the Texture
Selection window.
- Click the Stencil icon in the Surface texture section of the
window. The Multi-lister displays a Stencil#2 icon.
Load the banana label and mask
Click the Map... button next to Image and choose the
File texture from the Surface section of the Texture Selection window.
The File texture editor is displayed.
Click the Browse button next to Image to open the File
Browser. In the File Lister, select label.pix from the CourseWare/pix
directory.
Click the Stencil#2 icon in the
Multi-lister to re-display the Stencil texture parameters in the editor.
Click the Map... button next to Mask and choose the File
texture from the Surface section of the Texture Procedures window. The
File texture editor is displayed.
Click the Browse button next to Image. In the File Lister,
select label.mask from the CourseWare/pix directory.
Position the Label on the surface
- Double-click the Stencil#2 icon in the
Multi-Lister and open the Surface Placement section of the editor.
- Change the Rotate value to 270 and close the editor section.
This rotates the label properly on the banana's surface.
- Open the Label Mapping section of the editor and change the following
values to position the label and mask on the banana:
Ucoverage: 0.2, Vcoverage: 0.3, Utranslate: 0.4,
Vtranslate: 0.35
- Open the Blur section of the Stencil editor and change the Blurmult
value
to 0.1.
Tip: The default Blurmult value
of 1.0 creates a blurred image when rendered. You should always
lower this value so that the textures are not too fuzzy.
Select the banana and view the texture placement
- Select Shading
Pick
objects in the Multi-lister to pick the banana from the modeling window.
- Click the wire icon at the bottom right of the Stencil#2 icon.

Change the patch precision of the banana surface
Although the texture is applied to the wire file in
a shaded wire mode, the wire is not dense enough for you to see the label.
To fix this, you can increase the patch precision on the surface.
With the banana still picked,
select Object Edit
Patch Precision from the Tool Palette.
Type 20 at the keyboard and press Enter. Now you can see the
label.
In the next steps, you learn how to reposition the
label.
Edit the stencil's placement interactively
- In the Multi-lister, click the placement icon at the bottom of the
Stencil#2 icon to open the Stencil placement window.
Transform the stencil with the placement window
- In the placement window, select
Xform
Translate
and click-drag the stencil about one-half inch to the left.
- Check the Perspective view to see that the label is sitting on the
top of the banana.
- Select Xform
Coverage from the placement window menu.
- Click-drag with the right mouse button to scale the height of the label.
If necessary, use another
Xform
Translate
function to move the label toward the banana's center.

QuickRender the banana
To see what the banana looks like, from the Render menu, select
Quick render-
.
Click the Active button in the Render section of the
option window, then click the Go button.

Note: Only the banana has been quick
rendered. Although the label may seem blurry now, it will appear clearly
in a final rendering.
Click in the QuickRender window to close it.
Return to normal wireframe display
Click the close box of the Stencil placement window.
Click the wire icon at the bottom right of the Stencil#2 icon
to return to a wireframe display.
With the banana still selected, select Object Edit
Patch precision from the Tool Palette.
Type 2 at the keyboard and press Enter. This returns the wire
display to normal. Close the Ramp editor.
Select Pick
Nothing from the Tool Palette to unpick the banana.
Displacement Map the orange
Next, you apply a displacement map to create a bumpy
surface for the orange. The orange currently uses a smooth orange-colored
shader. The displacement map forms a bumpy pattern on its surface without
affecting its color.
Tip: Displacement maps actually move the
surface of the object. You can see the displacement by looking at an object
from the side with the applied maps.
Open the Orange Shader editor
- Double-click the Orange shader icon in the Multi-lister to open
the Shader editor.
- Open the Special Effects section of the Shader editor.
- Click the Map button next to Displacement to open the
Texture Procedures window.
- At the bottom of the Texture Procedures window, click the Browse
button to open the File Browser. A Mountain texture
has been provided to use as the displacement map for the orange.
Pick an existing texture from the file lister
- In the File Lister, double-click the bumpyorange texture icon
from the CourseWare/texture directory. The new texture icon is displayed
in the
Multi-lister mapped onto the Orange shader.

Tip: If you are wondering why mountains
are on the orange, remember that you can experiment with scale. In this
case, the bumpy texture for the orange is best created as a scaled-down
version of a mountainous surface. By modifying the default settings, you
can make a very convincing surface for the orange. In the Alias environment,
there are often many ways to achieve similar effects. Experimentation is
the key to getting the exact results you want.
Edit some of the Mountain parameters
In the bumpyorange Shader editor, change the Amplitude value
to 0.350. This makes the displacement more noticeable.
Open the Blur section and change the Blurmult value
to 0.2 to reduce the blur effect.

QuickRender the Orange
Select Shading
Pick Objects from the Multi-lister to pick the orange in
the modeling windows.
From the Render menu, select Quick render.
Note: You needed to pick the object first
because earlier you set QuickRender to render only active objects.

The displacement map on the orange not only gives
the appearance of little indentations in the orange's skin, but actually
displaces the surface.
Bump Map the bowl
Although bump mapping changes the appearance of an
object's surface, it modifies the surface normals of an object without
actually modifying the surface. Bump-mapping affects how light reflects
from a surface, creating the illusion of bumps by making surface areas
lighter or darker, depending on the direction surface normals are pointing
in. The easiest way to see this difference would be to render a displacement
mapped object and a bump mapped object side by side. You would notice that
the surface edges of the bump map are not bumpy while the displacement
map has bumps at the edges. In certain situations, the illusion created
by a bump map is all that is required. Since bump mapped surfaces render
quickly, you should use them instead of displacement maps wherever possible.
Pick the Bowl shader and the bowl
- Click the Bowl shader icon in the Multi-lister to make it active.
- Select Shading
Pick Objects to pick the bowl.
Change the shader's RayTrace parameters
- In the bowl's Shader editor, open the RayTrace section and change
the following values, which will be used for RayTracing:
Refract Index:1.2, Reflect Limit:4.0, Refract Limit:10.0,
Shadow Limit:2.0
Add a bump map to the Shader
Open the Special Effects section of the Shader editor, and click
the Map button next to the Bump parameter to open the Texture
Procedures window.
Retrieve an existing texture from the File Lister
Click the Browse button at the bottom of the Texture Procedures
window to open the File Lister.
Double-click the bumpybowl icon to load this file. The Multi-lister
now includes the new texture.
Edit some of the Bump Map parameters
In the bumpybowl editor, open the Linear Wave Parameters section
and change the Wave_Amplitude to 0.25. This will increase
the strength of the bump when it is rendered later.

Open the Blur section of the editor and change the BlurMult
value to 0.1. By reducing the blurring, the bump map keeps its
definition.
QuickRender the bowl
From the Render menu, select
Quick render. The resulting render is displayed as a pale
green and shows no bump at all.
Note: You cannot QuickRender bump maps
on transparent surfaces. You'll render this surface properly in Lesson
13.
Solid Texture Map the table
In this section, you give the table a solid Marble
texture to the table. Solid textures differ from surface textures because
they define a 3D texture space in which an object is located. In effect,
objects are "carved" out of the material of the solid texture.
In the following, you create a shader that works almost as if the table
were chiseled out of a piece of marble. To achieve a similar effect with
surface textures, you would have to distort the texture perfectly around
corners following the object's surface. Since this is very difficult to
do with a surface map, you use a solid texture.
Pick the Table shader
- In the Multi-lister, select the Table shader. In the Shader
editor, make sure the Shading Model is set to PHONG to give
the table a shiny appearance.
Load a color map into the shader
- Click the Map button next to Color in the Common Shader
Parameters section of the editor.
- Click the Browse button in the Texture Procedures window to
open the File Browser. A pre-defined solid texture is provided.
- In the CourseWare/texture directory in the File Lister, select
the marbletable file. It is displayed in the Multi-lister.
Edit some of the Texture parameters
In the Marble Texture Parameters section of the editor, look
at the Vein_color and Vein_width settings, and the Amplitude
settings in the Noise Parameters section. Experiment with these
parameters to create your own marble design.
Open the Blur section of the editor and change the BlurMult
value to 0.2.
Open and pick the Texture Placement object
Click the Texture Placement box icon at the lower right of the marbletable
icon to make the icon visible in the modeling window. The Texture Placement
icon is displayed as a green cube placed at the origin. You
need to change the placement of this icon to give the table a more convincing
marble look.
Select Pick
Nothing and then Pick
Component from the Tool Palette.
Click on the icon you just made visible, being careful not to select
any other geometry.
Xform the Texture placement object
Select Xform
Scale from the Tool Palette, type 3 and press Enter.
Select Xform
Rotate, type 45 45 45 and press Enter. This
creates an interesting relationship between the placement object and the
table top. Now the veins of the marble texture should flow along the table.

QuickRender the Table
- Tumble and Dolly the Perspective window to see more of the table top.
Select Pick
Object and click on the table to pick it.
- From the Render menu, select
Quick render. Notice how the marble texture wraps around
the sides of the table continuously and closed, as if the table were carved
from a solid piece of marble.

- Click in the QuickRender window to close it.
- From the Render menu, select
Quick render-
.
- Click the All button in the Render section of the option
window, then click the Go button to render the entire scene.

- Click in the QuickRender window to close it.
Save the file
From the File menu, select Save as.
In the CourseWare project in the File Lister, rename the file myfruitbowl3
and click the Save Wire button. You'll use this file in Lesson 12
to light the scene.
Conclusion
You have applied and edited various texture maps to
the objects in the fruit bowl scene. Procedural textures give you a near-infinite
number of possibilities for working with and creating texture mapped shaders.
Be sure to open some of the shaders stored on the
3DCD included with your Alias software. These can give you examples to
help you better understand what the different parameters are capable of.
Next, you'll explore how to add lighting to the scene
before rendering it photo-realistically.
aliasdocs@aw.sgi.com
Copyright © 1997, Alias|Wavefront, a Silicon Graphics Company.
All rights reserved.