IFW Lightwave Textures 
Tutorial Three - Rainbow Color Maps 
This page is intended to be viewed in 1024 x 768 in 24bit color
Home Order       Mail Previous Next Back
Introduction
One of most important concepts with the IFW Textures is the idea and application of color maps. A color map is defined as being colour1 to colour4, alpha1 to alpha4 and blend1 to blend4. These 12 parameters define and control the application of color for any given pattern. Now, with a single shader a color map can easily be generated with up to four colors. But, what if a rainbow color map was required with seven colors?
               
Part 1 - The First Four Colors
Now, for a rainbow the colors are :
Red  255 0  0
Orange  255  128  0
Yellow  255  255  0
Green  0  255  0
Cyan  0  255  255
Blue  0  0   255
Violet  255  0  255

If the layout editor create a scene looking directly at basic object like a cube or simple flat plane ( make sure that which ever object you create it is approximately 1 meter in size). Go to the surfaces dialog and under the Advanced tab add IFWLinear to the plane. Next, click on Options for the IFWLinear shader. Using the table above set the first four colors to Red, Orange, Yellow and Green, respectively. Next we want to size the shader so set the size to 1.0, 1.0, 1.0 and adjust its position by setting the center to -0.5, 0.0, 0.0. Also set the Wave Type to Saw and the Bump to 0.0. Finally we want the rainbow pattern to have equal spacings for the colors so set the blend points to B1=0%, B2=14%, B3=28% and B4=42%. Leaving everything else at their default values you will end up with a plane looking like the one shown below in Figure 1.
The Initial four Rainbow Colors
Tutorial One Picture One
Figure 1
               
Part 2 - The Final Rainbow Colors
To add the final three colors bring up the surfaces dialog box again and add a second instance of IFWLinear to the object. Set all of the parameters the same as the first IFWLinear except for the blends points and the colors.

Now for a bit of explanation. What we want to try and achieve is to blend the last color of the first IFWLinear texture, i.e. green, with the first color of the second IFWLinear texture, which is Cyan. Now, the way we will achieve this is to create a alpha blend and use layering to allow the first IFWLinear texture's colors to show through. Hopefully, this will make sense once you see the settings. First of all, set the four colors as Cyan, Cyan, Blue and Violet. Notice that the Cyan is added twice. This is so the first color can be made clear using the alpha channel. Next set the blend points as B1=42%, B2=56%, B3=70% and B4=84%. The last thing that is required is to control the alpha channel and layering so that the last color of the first IFWLinear texture blends nicely into the first color of the second IFWLinear. This is done by setting the first alpha point to 100% and checking the Layer enabling check box. The important point is that the underlying color, the first rainbow colors, are unaffected until the texture function reaches the 42% blend point. Here, the second IFWLinear is blended in going from clear cyan to opaque cyan. This creates a nice blend from the underlying color, green to new color cyan which is exactly what we want to achieve.
The Complete Rainbow
Tutorial One Picture Two
Figure 2