houdini   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 Houdini's SHOP parameter expressions.


 

Using and Animating Renderman Shaders within Houdini:

 

My Shader

 

My Animated Shaders

 

 

How I created my Shader:

 

First I set up my sliders so that certain optiosn such as the size of the circles and the color can be edited within houdini:


cirlcepattern(float Kd = 1,
OutsideCircleThickness = .1,
SPosition = .5,
TPosition = .5;

color Color1 = color(0.0,0.0,0.1);
color Color2 = color(0.0,0.0,0.2);
color Color3 = color(0.0,0.0,0.3);
color Color4 = color(0.0,0.0,0.4);
color Color5 = color(0.0,0.0,0.5);
color Color6 = color(0.0,0.0,0.6);
color Color7 = color(0.0,0.0,0.7);
color Color8 = color(0.0,0.0,0.8);
color Color9 = color(0.0,0.0,0.9);
color Color10 = color(0.0,0.0,0.95);
color Color11 = color(0.0,0.0,1);

color Background = color (.6);
)

I then set up the paramaters for the actual circles, using a float to give the letter d the shortcut to the forumula.


float d= sqrt(((s - SPosition)*(s - SPosition))+((t - TPosition)*(t - TPosition)));

if ( d <=OutsideCircleThickness+1)
surfcolor = Color11;

if ( d <=OutsideCircleThickness+.9)
surfcolor =Color10;
if ( d <=OutsideCircleThickness+.8)
surfcolor = Color9;
if ( d <=OutsideCircleThickness+.7)
surfcolor = Color8;
if ( d <=OutsideCircleThickness+.6)
surfcolor = Color7;

if ( d <=OutsideCircleThickness+.5)
surfcolor = Color6;
if ( d <=OutsideCircleThickness+.4)
surfcolor = Color5;
if ( d <=OutsideCircleThickness+.3)
surfcolor = Color4;

if ( d <=OutsideCircleThickness+.2)
surfcolor = Color3;

if ( d <=OutsideCircleThickness+.1)
surfcolor = Color2;

if ( d <=OutsideCircleThickness)
surfcolor = Color1;

 

 

------------------------------------------------------------------------------------------------------------------------------------------------------------


Loading Custom Renderman Shaders into Houdini:

 

Now that I have created my custom shader, i need to get it into houdini so i can use it. Within Cutter, there is an option under the parameters, under the "user tab". Houdini uses .OTL files to store all of the shaders that you have made, so whenever you compile your shader, its information will be placed inside of the OTL file. Save the path of the OTL file to be inside of your shader directory for renderman, and compile your shader. The first time you compile it you will get a pop-up. Just hit ok and let it finish.

 

Location of the . OTL Output

 

 

 

 

 

Now open Houdini. In order to get these shaders to work, you must load them into your current project. Click File --->Install Operator Type Library. Search for the OTL file you just created and load. Now go to your SHOP network and type in the name of the shader you created. (In order to view renderman shaders within houdini, go to Professor Kessons tutorial here)

 

 

 

 

 

(I still havent been able to figure out how to get Houdini to show me a preivew renderman shaders, so for now, keep rendering until it looks right)

 

 

Now apply this shader as you would any other in houdini.

 

------------------------------------------------------------------------------------------------------------------------------------------------------------

Shader Animation


To animate my shaders, i used simple houdini expressions to get the colors to change and the size of the circles to change. In houdini, all you need to do is click on the parameter box for any of your attributes and type in your expression. In order to get my colors to change within a certain range, i used this formula.

 

abs(sin($F*3)*.2

 

 

So basically i am animating the pattern to change colors by multipling a sine wave by the number of frames in the animation by the frequency of the wave (how many times the animation will go thru) times the amplitude or height of the wave (which in this case is the highest number that i want my color parameter to hit)

 

Here is the Finished Patterns

 

 

 










I will display the same shader done in Houdini's VEX within the next few days. (I just ran out of time).