m a y a    p a t t e r n    a n i m a t i o n


The animation and notes on this page explain how custom shaders written in the RenderMan Shading Language can be animated using SLIM parameter expressions.





Original Pattern. The stripes can be adjusted in terms of frequency and color. The black dot and the circle aorund
that dot can also be changed in color. The circle behind the dot uses the same as one of the stripes thus
giving it a feel as if it was sewn into the pattern.

			

Text file of the shader

maya_pattern(float Kfb = 1, inv_circle_size = .03, black_circle_size = .01, repeats = 7, left_right = .5, up_down = .5; color stripe = color(0,0,1), background_color = color(1,0,0), dot = color(0,0,0)) { color surfcolor = .4; normal n = normalize(N); normal nf = faceforward(n, I);






Using the Renderman Shading Language, the pattern was transformed into a shader that Maya could recognize
and sliders built in to control the number of stripes, the color of each stripe, and the color and position
the black circle in the middle and the 'invisible' circle around it.

Due to the diagnonal features of this pattern, I found that it fit best on a cone. I originally wanted the dot
to move around the shader, but after seeing the skewed results I felt it looked really bad. So I positioned
it a the tip of the cone and set the colors to a 3 color ramp and cycled it through.
I used the lerp and spline function in Slim to get my results.

			
Example of a spline ramp.
[spline3 $pct {0 {0 0 0}} {0 {0.37498 0.19608 0.49998}} {1 {0.49998 0.49998 0.49998}} {1 {1 1 1}}]

Example of a lerp function. lerp(.02,.01,$pct)





Using patterns in animation can cause undue frequency aliasing. While I did not really cope with this problem, I did have some issues with
the aliasing on the pattern itself. Aside from using camera depth of field, I was unable to solve that problem with my limited knowledge
of Renderman. The repitions of my stripes were made the way I wanted them to be, although the result is less than steller.

During this animation, the colors of the pattern were based on several things. I changed the colors of the stripes to go from a different values
as they neared the camera. Having no idea how to actually do this, I simply hard coded the colors to shift from one to the other at the
start and end of the animation.

The stripes do animate slightly in frequency and by simplying changing the number of stipes from start to finish, I get a small rotating 'feel'
to the objects. I purposely did not rotate the cones at all in order to visually demonstrate that. The results, were again less than spectacular.
While the process of learning and using this shader is great, the results I was able to come up with were not very interesting or visually appealing.


			




Timelapse of decaying peaches (still decaying at the moment). Apologies for the jumpiness.