Here’s where
the fun begins. To create the effect of the light traveling along the length of the neon tube,
you’ll attach a
ramp to the incandescence channel of a Blinn shader.
1. Open the Hypershade to find the shader
named
neonGlassBlinn. This is a simple
shader that
has already been set up to create
the look of the neon glass. Select the shader, and MMB
drag it on top of the vacancyNeonGeo in the Perspective view.
2. In the Hypershade, select the neonGlassBlinn shader, and open
its settings in the Attribute Editor. Click the checkered box to the right of the Incandescence chan- nel to open
the Create
Texture Node panel.
3. Select the 2D Textures category
on the left side of the panel, and click Ramp
to create a ramp
node (see Figure 1.5).
Hold the mouse
pointer over the Perspective view, and press the 6 hotkey to switch to textured view. Make
sure that the Renderer panel in the viewport window is set to High Quality Rendering; otherwise, you won’t see the ramp texture update properly as it’s applied
to the geometry.
In Perspective view, the rainbow pattern of the ramp appears on
the neon tube, but it is a repeating pattern that
looks
more
festive than
demonic. To fix this, you can adjust
the UVs of the vacancyNeonGeo node.
 |
Figure 1.5 Use the Create
Render node
panel
to attach
a ramp texture
to the Incandescence
channel
of the neon-
GlassBlinn material.
|
4. Select the vacancyNeonGeo node, and choose Window c UV Texture Editor.
If you zoom out (waaaaay out), you’ll see that the UVs are a long vertical
strip. In the UV Texture Editor’s
menu
panel, expand the Textures menu, and select vacancyNeonGeo|blinn2SG|ramp1 so that the ramp appears in the UV Texture Editor.
As you can see, the rainbow colors
of the ramp
appear in the upper quadrant of the UV Texture Editor. What
you don’t
see is that outside of this area,
the ramp texture repeats
over and over to infinity,
which
is what
the colors on the neon tube continually repeat;
the UVs for the tube continue well outside
of that upper quadrant (see Figure 1.6).
 |
Figure 1.6 The UV Texture Editor shows that the UV
texture
coordinates
of the neon
sign geometry
go well
beyond
the
upper quadrant
of the texture space. The result is
that
the
ramp
texture
repeats along
the
length of
the
glass tube.
|
5. Right-click the UVs, and select UV from the marking menu.
Select some of the UV coordinates in the editor
(the selected coordinates will be highlighted in green). Hold the Ctrl key, right-click again above the selected UVs, and choose To Shell from the marking menu.
This selects all of the connected UVs of the glass tube geometry.
6. From within
the UV Texture Editor, choose Polygons
c Normalize. This forces the UVs to fit within
the upper-right quadrant of the UV texture space. Now
the ramp is no longer
repeating. The UV coordinates will look fairly dense in the
UV Texture Editor, but in Perspective
view, you’ll see that
the ramp
goes from red to green to blue across the length
of the sign.
7. Select the ramp1 node on the Textures tab of Hypershade, and open
its settings in the Attribute Editor.
8. Click the x at the top of the ramp
to delete the blue color at the top of the ramp. Set the middle
color
to black; then set Interpolation to None.
9. Set the bottom color
to a devilish shade
of red.
10. Try dragging the circle for the black
color
up and down; you’ll see the light move
along the neon tube (see Figure 1.7). Name the ramp node
neonLight.
 |
Figure 1.7 Move the
black color of
the
ramp
up and down;
the
color
updates
on the tube
geometry
in Perspective
view.
|
To make the sign easier to read, you can apply a separate dark shader
to the parts of the tube that
connect
the letters.
This replicates the way actual
neon signs are constructed in the real world, adding an extra touch of realism.
11. Right-click the vacancyNeonGeo geometry in Perspective
view, and choose Face. Carefully select the individual faces connecting the V and the A. Once they are selected,
switch
to the Rendering menu
set, and choose Lighting/ Shading
c Assign Favorite Material c Lambert. This creates a new Lambert shader and applies
it to the selected faces. Do the same for the other
parts
of the sign. Assign the same Lambert shader to these selected faces (you can use
Lighting/Shading c Assign Existing Material to do this easily). Figure 1.8 shows the result.
 |
| Figure 1.8 |
12.
Select sparkEmitter in the Outliner. In the Set Driven
Key panel,
click Load
Driven. lightControlHandle should
still be loaded
as the driver.
13. Use the Set Driven
Key panel to keyframe the emitter so that
when lightControl- Handle is all the way to the left, the Rate attribute of the emitter is 0, and when lightControlHandle is all the way to the right,
the emitter’s Rate attribute is 100. You can use the same technique that
you used in steps 9 and 10 to do this.
14. This is probably a
good point at which to save your scene file.