Shaders
colorramp - A six-color ramp shader
This shader applies a color ramp to objects. Six color and opacity
settings are available.
In this sample image, the discs demonstrate the five mapping modes. The top three discs show the x, y and z mapping modes for colorramp. These modes operate in world space. The bottom discs show s and t mapping modes. These modes wrap and scale to the surface space of the object.
If your browser has the Apple QuickTime Plug-In and MPEG extension, you can see the effect of animating the colorOffset parameter from 0.0 in the first frame to 1.0 in the last frame of this loop:
Parameter |
Data Type |
Usage |
Example |
---|---|---|---|
colorScale |
float |
The scale of the six-color cycle |
colorScale = 1 |
colorOffset |
float |
The offset of the six-color cycle |
colorOffset = 1 |
mapType |
integer 0 to 4 |
The mapping mode
|
mapType = 3 |
shadingType |
integer 0 to 5 |
The shading method code
|
shadingType = 0 |
color1 |
RGB color |
The first color |
color1 = color(0, 0, 1) |
color2 |
RGB color |
The second color |
color2 = color(0, 1, 1) |
color3 |
RGB color |
The third color |
color3 = color(0, 1, 0) |
color4 |
RGB color |
The fourth color |
color4 = color(1, 1, 0) |
color5 |
RGB color |
The fifth color |
color5 = color(1, 0, 0) |
color6 |
RGB color |
The sixth color |
color6 = color(1, 0, 1) |
opacity1 |
RGB color |
The opacity of the first color |
opacity1 = color(1, 1, 1) |
opacity2 |
RGB color |
The opacity of the second color |
opacity2 = color(1, 1, 1) |
opacity3 |
RGB color |
The opacity of the third color |
opacity3 = color(1, 1, 1) |
opacity4 |
RGB color |
The opacity of the fourth color |
opacity4 = color(1, 1, 1) |
opacity5 |
RGB color |
The opacity of the fifth color |
opacity5 = color(1, 1, 1) |
opacity6 |
RGB color |
The opacity of the sixth color |
opacity6 = color(1, 1, 1) |
Ks |
float |
The specular value for plastic shading mode |
Ks = 1.0 |
Kd |
float |
The diffuse value for plastic and matte shading modes |
Kd = 0.5 |
Ka |
float |
The ambient value for plastic and matte shading modes |
Ka = 0.5 |
roughness |
float |
The roughness value for plastic shading mode |
roughness = 0.5 |
attenuation |
float |
The attenuation value for glow and halo shading modes |
attenuation = 2 |
specularcolor |
RGB color |
Specular color for plastic shading mode |
specularcolor = color(1, 1, 1) |
View the colorramp.sl shader source
Download the colorramp package for Presenter 3D