Shaders
These shaders use the RenderMan noise function to vary the color and displacement of surfaces. These shaders are very flexible, with controls for scaling noise, color
The first shader, colornoise, applies surface color.
The second shader, displacenoise, displaces the surface.
Parameters used in colornoise.sl and displacenoise.sl
Parameter |
Data Type |
Usage |
Example |
---|---|---|---|
noisetype |
float |
The type of noise function used
|
noisetype = 3 |
offsetX, offsetY, offsetZ |
float |
The offset in the noise lattice |
offsetX = 0 |
scaleX, scaleY, scaleZ |
float |
The scale in the noise lattice |
scaleX = 1 |
scaleRed, scaleBlue, scaleGreen |
float |
The scale for color channels. (Note: for displacenoise.sl, the sum of scaleRed, scaleGreen and scaleBlue should equal three). |
scaleRed = 1, scaleBlue = 1, scaleGreen = 1 |
Additional parameters used in colornoise.sl
Parameter |
Data Type |
Usage |
Example |
---|---|---|---|
shadingType
|
integer 0 to 5
|
The shading method code
|
shadingType = 0
|
Ks, Kd, Ka |
float |
The usual meanings |
Ks = 1 |
roughness |
float |
Roughness value for plastic shading method |
roughness = 0.1 |
attenuation |
float |
For glow and halo methods |
attenuation = 2 |
specularcolor |
color |
For plastic shading method |
specularcolor = (1, 1, 1) |
Additional parameters used in displacenoise.sl
Parameter |
Data Type |
Usage |
Example |
---|---|---|---|
Km |
float |
Maximum displacement |
Km = 1 |
View the colornoise shader source
View the displacenoise shader source
Download the noise shader package for Presenter 3D