Maya Pattern Animation
Shader Test
My ultimate goal with this project was to make a shader that mimics the architecture of circuitry. I did this by manipulating the ’s’ and ‘t’ values in Cutter to “shape” my template. I made sure to include a variable for the number of repeats in the shader’s parameters for easy transition to Slim. When I took it into Maya, I rigged the shader’s repeat variable to a Nurbs circle controller using a TCL/MEL script.
[mel "getAttr nurbsCircle1.translateX"]
Circuit Geometry:
Although I wouldn’t call my code nessessarily clean, I used a basic if/else statement to script the bands of circuitry. However, I feel like I could have pushed myself more on the structure of the shader. Perhaps if I had mad the shader more intricate than simplistic the tiling would be less noticable. I mainly count this shader as a success because I got a better idea of the workings of ’s’ and ‘t’ values. My knowledge of how the tiling procedure works will enable me to write far more complex shaders in the future.
Shader Sample:
surface GlowCirc( float Ka = 1,
Kd = 1,
repeat = 10;
color color1 = color(.6, .6, .85),
color2 = color(.4, .4, .4);)
{
color ambientcolor, diffusecolor, surfcolor;
/* STEP 1 - make a copy of the surface normal one unit in length */
normal n = normalize(N);
normal nf = faceforward(n, I);
/* STEP 2 - set the apparent surface opacity */
Oi = Os;
/* STEP 3 - calculate the lighting components */
ambientcolor = Ka * ambient();
diffusecolor = Kd * diffuse(nf);
/* STEP 4 - calculate the apparent surface color */
float ss = mod(s*repeat,1);
float tt = mod(t*repeat,1);
if((ss<.25||(tt<.55&&tt>.46))&&ss>.2&&tt<.55)
surfcolor = color1;
else if(((tt>.125&&tt<.2)&&ss>.2)&&ss<.66)
surfcolor = color1;
else if((ss<.66&&ss>.55)&&tt>.55)
surfcolor = color1;
else if((tt>.75&&tt<.82)&&ss<.55&&ss>.015)
surfcolor = color1;
else if((ss<.66&&ss>.55)&&tt<.2)
surfcolor = color1;
else if((ss<.10&&ss>.015)&&tt<.82&&tt>.46)
surfcolor = color1;
else if(ss<.015&&(tt<.55&&tt>.46))
surfcolor = color1;
else if((ss<.25&&ss>.2)&&tt>.75)
surfcolor = color1;
else
surfcolor = color2;
Ci = Os * Cs* surfcolor*( ambientcolor + diffusecolor );
}
Non-Invasive Scaling:
In this clip, the scaling of the circuit shader is present, but not distracting from the objects, themselves.
Blatant Scaling:
With this animation, the scaling of the shader is faster and obvious. Object animation is viewed as secondary in this scene.
Expanded Shader:
When creating this shader, I came up with many ideas of how I could expand it. My first thought was that I could make the circuit architecture glow as if it were electrified. Secondly, I could add an additional, more-intense glow to a few ’s’ and ‘t’ values to make a point. Finally, I could make that point of light traverse my circuitry, imitating data transfer. Yes, yes. Very similar to something out of Tron.
Faked Glow (no change in shader):
**Faked in After Effects**
This is merely a faked sample of part of what I want my shader to eventually do. I want to have a glow threshold value which can be manipulated outside of the shader, itself.