| There is a good bit of detail within each and every strand of spanish moss. While they may seem to look rather simple by themselves when you put hundreds of strands within one clump the picture goes from simple to wonderfully complex. The problem with this complexity is the fact, at far away, the spanish moss blends together. This is terribly inefficient at render time to have a few hundred strands of 10k poly models. So we can employ a technique known as a Level of Detail switch. We have any number of models of varying complexity and at certain points, based on the amount of pixels they take up in area, switch them out for a higher resolution model. In this example of Level of Detail(henceforth referred to as LoD) we will only use two models, one of just curves and the other a 9886 faced model. The beauty of Renderman is its ability to render out curves. |
|
The Models
|
| I started by modeling the NURBS curve, as shown above, and then after some trial and error got a model that effectively represented the curves as well as the reference. |
|
Renderman
|
AttributeBegin Detail[-.5 .5 -2 0 -.5 .5]
#Color [1 0 0] DetailRange[1 1 100000 220000] ReadArchive "rib_archive/lowres.rib"
#Color [0 1 0] DetailRange[100000 220000 27000000000 27000000000] ReadArchive "rib_archive/hires.rib" AttributeEnd |
| With the power of Renderman we are able to use a few lines of code to create a simple switch between two rib archives. The first two numbers after the DetailRange statement are the fade in values, the third number is the begin fadeout, and the last is the fully transparent point in pixels. For the high resolution model we set the last two numbers to be some arbitrarily large numbers so that they never fade out. This entire file can be saved and then referenced within maya at render time. The numbers themselves are the area in pixels that the bounding box of the model takes up. The bounding box is explicitly defined with the Detail command. Our final renders were at 1920x1080 which comes out to 2073600. If you notice the last two numbers for the high resolution model are greater that the amount of pixels, this is because the renderer looks outside of just what the camera sees and has to account for it. |
|
Back into Maya
|
RiRotate(rand(0,360),0,1,0); RiReadArchive("rib_archive/LoD2.rib"); |
| With the renderman plug-in installed we can not only render scenes with Prman but we can also use proxy models to visualize where objects are without having to deal with large detail models while we fix motion. Pictured is the setup of the dynamics that will help sell believability at render time. I employed 4 fields: gravity, air, drag and turbulence to achieve the movement I wanted. The air field has expressions attached to it to allow for "gusting" wind. Each polygon had an added attribute, specific to Renderman, called Pre-Shape Node. It allows for mel commands(as well as Renderman to Maya mel) to be carried out before the renderer gets to the shape node. I applied a rib command Rotate as well as a mel command rand to get a random rotation added to the moss that is then referenced at render time. |
|
| The first video is the final render with the low and high res models different colors so you can see when they blend together, this is all done with the few lines of code above. The second video is the beauty pass of the moss. |
|