Stupid RenderMan Tricks - Siggraph 2009 For Siggraph 2009 (New Orleans) one of my shader tricks was chosen as a winning entry of Pixar's annual "Stupid RenderMan Tricks" segment of the RenderMan Users' Group meeting. That night, I presented my trick, along with a group from Weta Digital and a gentleman from MPC (Moving Pictures Company.)The trick was surprisingly well received and turned out to be the highlight of the evening. This trick is actually a combination of two related projects that I produced for Malcolm's "ST Coloration" and "Pattern Animation" project. Point Cache Trick - Breakdown [Pt. 1] Simple Procedural Pattern Generation
Representing more Detail After experimenting with basic shapes and reviewing past student work in this area, I felt the need to represent more complex patterns and images on the ST grid. It would be basically impossible to do this by manually coding the .sl files, but I figured that I can do it by defining point attribute informaiton and extract that information using python. Information will be fed into RenderMan using the same basic instructions used to generate the geometric shapes. With this technique, I can represent any image quite accurately. Because of the procedural nature of this technique, very complex shaders can be defined. Gathering Information In Houdini In houdini, I projected an image onto a grid consisting of 2499 points.
Here is my python code: This is the main operation in python: Through these precise floats, I can represent a wider range of colors for any image. Results
Results using more complicated fractals. Edited my script to add more details by excluding colors that are the same color as the background: Point Cache Trick - Breakdown [Pt. 2] This animation and all shaders produced was driven almost completly by python expressions within houdini. What I initially wanted to do for this project was to animate something that does not follow any particular pattern. Something natural. So I thought of animating my signature: "N.B.J". Throughout this project, I also enhanced the functionality of my point cache script that I wrote for ST Coloration. These are the key features making this animation possible: 1. Render points out to rib frames, from directly within houdini Preparing the Simulation In houdini a curve's point properties is driven by a sphere's proximity towards it and CHOP (Channel Operatior) to manipulate channel data. Through manipulating channel data I can drag or freeze a points' attribute information. In the end, all that i'm getting is point attributes. This is done through accessing the Houdini Object Model using python. In addition, I am rendering this data directly into rib files and shaders, so I have to add functionality to my script to process multiple frames. I access frame information through hou.frame(). For each point I access, I extract the information and move to another frame using hou.setframe(CurrentFrame+1), where variable CurrentFrame is always equal to hou.frame(). Data extracted is being used in 3 main areas: 1. Generating the shaders by frame number, 2. Generating the point location to drive the crayon, 3. Generating the rib archive that defines frame information. 1.Shaders Each shader writes a dot to a specific area of the ST grid. It defines the dot with this formula: if ((s-0.885906040668)*(s-0.885906040668)+(t-0.684563755989)*(t-0.684563755989)<=0.00001) where 0.00001 is the radius value for each circle. In the initial test, this value proved to be obviously too small, and thus it produces a pattern on the crayon strokes. Because of the procedural nature of this technique, these shaders can get really large. The shader that defines the surface for frame 113 is 18,267 lines long. 2.Crayon Location A crayon was modelled and put into a rib archive. I extracted attributes for my "pencilPoint" node (this node contains one point, refer to node map above) and use that to drive the rib archive x,y,z values. 3.Main RIB The main RIB defines 113 frames using 3392 lines of code. Each FrameBegin/FrameEnd block looks like this:
Animating Crayons
Second Render. Point radius is 0.001. Note the colors being added as the path progresses
Implementing Beizer Curve In the past, the main problem was figuring out how to reference a large amount of points (from an external source) to represent complex amount of data. I extended my point cache script to overcome this problem and my initial tests proved successful:
|
|||||||||||||||||||||||||||||||||||||||