Procedural Tree MEL + Pixar's Renderman

  • Procedural Tree

    In order to color a full set of leaves with different color variations we can take advantage of a simple shader in created in RSL to create a slim template that will allow us to create quick variations of multiple geometry a only using one main shader. 
  • Responsible for all aspects except tree trunk model.
  • Final Image.

    Modeled in Autodesk Maya
    Shaded and Rendered with Pixar's Renderman
    Composited in NukeX
  • For this tree grooming tool, I thought it was crucial to introduce a form of direct communication between the artist and the script. I used the "Vertex Paint" tool feature in Autodesk Maya to provide this dialog between artist and script. The main idea is that using vertex paint the artist can paint with the mouse or stylus the vertices on the mesh. In my case I made the convention that black is a candidate to have a branch grow and white is not. So this way the artist can interactively choose where the script is going to attempt to grow some branches.
  • The images show the different variations that can easily be achieved using this script. From a full set of trees to more individualized and art directed distributions, and even an Ivy type distribution.
  • How are the Branches Created?

    In this case i used a simple idea of translating the leaves on the normal of the face. So basically I create a leaf and then I move along the face normal where it was created by a spread amount. There I create the next one.

    How do the branches curve?

    One of the main flaws of moving along the normal is that we get these straight un-natural looking branches. To chance that I used a simple concept of usint the negative parabola of x^2 (x square). We can control the arching of this function dividing x^2 by a factor (or multiplying it by the inverse factor).
    Here is a visual example of what happens with this function:
  • So what we need to do is each time we move along the face normal, we change the y component for:
    y = -archingFactor*x^2.
  • Main texture used to create the double sided leaf shader
  • Capture of the Slim Shader Network created to simulate leaves

    In order to speed the interaction with the tree mesh in the viewpor we've used the ability to load pre-baked rib files as our leaves to be rendered dring rendertime. But as this approach is valid for rendering one image, if we are rendering a sequence, or once we are happy with the distribution of our leaves, we want the posibility to not have to compute the creation of the leaves any more. So in essence what we've done is implemented the function to bake our rib files of the ditributions that we've created and then the ability to reuse these bakes rib files so we only have to compute the distribution of the foliage once. This is where the menu that we saw on the UI shines. I set to compute the rib file with the distribution is baked and then read to render. If it's set to reuse, we read this baked rib file and we render it and if it's set to off then we do nothing.