
The animation and notes on this page explain how custom shaders written in the RenderMan Shading Language can be animated using SLIM parameter expressions. |
The Basic Pattern |
||
![]() |
This is the shader written in the RenderMan Shading language.At first I tried to use the bomb shader but found that it wasn't well suited for this project so I wrote a new one that would be more interestingly animated. | |
Controls in Maya |
||
![]() |
I added in these controls that could easily be manipulated in Maya. The green cross could be moved side to side, up and down, and widened. these parameters also change the outer blue boxes. All of the colors are also available for change. cross_test(float Kfb = 1, /* fake brightness */
tflip = 1; /* [0 or 1] uv/st flip */
color BGcolor = color (0,0,0);
//Cross//
float centerVert = .5,
centerHor = .5,
width = .1;
color crossColor = color (.279,1,0);
//Box//
color box1Color = color (0,0,1),
box2Color = color (0,0,1),
box3Color = color (0,0,1),
box4Color = color (0,0,1);
)
color surfcolor = 1;
float tt = 1 - t;
float left = centerVert - (.5 * width),
right = centerVert + (.5 * width),
top = centerHor - (.5 * width),
bottom = centerHor + (.5 * width);
if(tflip == 0)
tt = t;
|
|
Lighting and Composition Test |
||
This is a spot light with shadows and a directional light with shadows turned off. I don't really like the constant shader so I will convert it into a lambert material to interact with the lights. By adding these pieces of code to the float variables: Ka = 0.5, Kd = 0.85, and this to the body: normal Nn = normalize(N); and making the final equation look look like this: Ci = Oi * Cs * surfcolor * Kfb * (Ka * ambient() + Kd * diffuse(Nn)); | ||
Animation |
||
| By key framing the sliders in the shader I was able to get this animation. | ||
Animation1 |
||
This is the shader apply ed to some simple cubes with a simple lighting set up.
|
||
Opacity |
||
![]() |
To add opacity I made all of the things that I wanted to be transparent a white that I thought no one would use (.0001, .0001, .0001) and made that color transparent. The Code added at the end looks like this: if (surfcolor == color .0001) |
|
Final Animation |
||
Small orange glowing spheres where put inside the boxes and raytraced shadows where used to allow the light to pass through the boxes.
|
||
In this exercise I learned how to make animate parameters in Cutter for Maya. With the shader set up the way it is the artist is able to customize the shader for their own purposes. The cross can be moved, and resized the colors can be changed and all of these things can be animated. I had a hard time getting the pattern to repeat, it worked in Cutter and not in maya, I think that the extra repeats would have added another level of detail. Other than that I achieved what I wanted. |
||
Things That Where Learned |
||