l e v e l - o f - d e t a i l


The animations on this page demonstrate the support offered by RenderMan for level-of-detail (LOD). Three models of a gumball seed were made in Maya/Houdini. Using LOD the renderer chooses the appropriate model to use based on the area of screen space occupied by the model.







			
Left: Low Res (Curves)
Middle: Mid Res (2,780 Polygons)

Right: High Res (9,960 Polygons)


Video Example of High Res (if top doesn't work)
johnathan_nixon_moss

 

 

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

 

Level Of Detail Using Renderman and Houdini
           
As with anything, there are many different ways to use level of detail with Houdini and Renderman.  This just happens to be the way that worked correctly for me.  Feel free to experiment, for I am sure that are other, probably better, ways to achieve this technique.

 

Bounds

 

            The first thing that you want to check is that the bounds of your model are correct.  In this case, I have 3 Spanish moss models, one High, Medium, and Low (the low detail model is strictly curves). You can check the bounds by middle mouse clicking the last SOP node that you have created in the geometry level of your model.  Make sure that all three bounds equal mathematically to the specified parameters. (if you need to adjust them, just add a transform sop and adjust accordingly. I normally add another transform sop after my changes to "freeze" the transformations back to being 0 0 0 "

 

Bounds on the Moss

(in my case, I wanted to make sure that my model had the proper Y value of 2, so my bounds for Y were 1.00745 and –0.992615 for this

particular model (basically 1 and –1 which is the range of  2).  Just make sure that all models are close to what your bounds should be.)

 

 

 

Dealing with Curves
           

            In the case of the Spanish moss, one of the models needed to be exported as curves into Renderman.  The other two models, being Polygons, could be exported with no problems.  In Houdini, exporting curves to work in your rib file can be a bit different.  First.  Merge your curves together using a Merge SOP.  I then converted them to polygon curves using a Convert SOP.


            So your curves are converted, but you need to be able to control the size of these curves in order for them to look correct into renderman.  This is where the Attribute and Attribute create SOPs come into play.   First, connect your AttributeCreate SOP to your network.  This allows you to set parameters for changing the size of the curve.

 

Here is what i typed in:

Name: width
Class: Primitive
Type: Float
Size: 1
Value (where you set the new values for the curves)

 

            Next connect an Attribute SOP to your network.  Select the Renderman tab and recall your AttributeCreate name (in my case, its named Width) into the first box.  In the second box, type in constantwidth and change the float to a constant float.  Now your curves can be exported into Houdini (with width) like your normal polygons can.

 

(you can get a better description on curves as well as other tips on using Houdini with renderman here at: http://www.odforce.net/downloads/tips/plim_HoudiniRMAN_Tut_v1.3.pdf)

 

Generating Script Files (.rib)


            Now that all three of your models are correctly formatted and ready to be exported, we can export them as .rib files so that they can be executed in Renderman. (There are MANY different ways to export your models into .rib files, but this way seems to be the easiest out of all the ones that I have tried.)  Before you start, make sure that there are no lights and no shading information within your geometry.  We just want the geometry for now.  Go to the last SOP in your objects geometry, right mouse click it and go to Save Geometry as.  Save it as a .rib file.  Now repeat this with all of your models.

 

Save Geometry Option

 

Checking your Models in Renderman


            Now that you have exported your models from Houdini, it is time that we test them within Renderman.  Open up your editor and load your .rib files.  You should be able to run them from within themselves, so execute each one to make sure they work.  I have an example of my 3 files opened and tested below. (be careful with the high res file, its mostly going to be very large.)


My example of my High, Medium and Low res opened in my editor with my low res model rendered using renderman

 

 

Getting Level of Detail Working Within Renderman

 

            Before we can test out the level of detail in Houdini, we need to get it working within Renderman first.  What Level of Detail is doing is switching out models depending on the camera’s distance from them.   What we will be doing is referencing the pre-baked ribs that we rendered out in Houdini and using Renderman to control the Level of Detail.  My initial renderman script looked something like this.

 

AttributeBegin

Detail [-.5 .5 0 2 -.5 .5]
Color 1 0 0
DetailRange [ 1 1 800 4000]
ReadArchive "H:/vsfx319/archives/low.rib"

Color 0 1 0
DetailRange [800 4000 5000 14000 ]
ReadArchive "H:/vsfx319/archives/midres.rib"

Color 0 0 1
DetailRange [5000 14000 400000 400000]
ReadArchive "H:/vsfx319/archives/highres.rib"

AttributeEnd

 

So you can see that depending on the range of the camera, the renderer will swap in the correct model to be rendered.  Here, I have the models color coded so that you can tell which model is being used by the color that is rendered out.  Save this file as lod.rib.  We will now get this script working in Houdini.

 

Example of my script file in my editor.

 

Level of Detail in Houdini.
           
Now that we have our Level of Detail script ready, we will get it working withn Houdini.  Instead of showing us the actual models in Houdini, we are going to use boxes as placeholders for the moss.  The moss will be controlled by these boxes that we create.

 

Open up a new file within Houdini, Tab in a Geometry node in your object leve and create a Box SOP within your geometry.  Make the boxes dimentions within the same parameters as your moss is. (my moss was 2 tall, so I made my box 1 x 2 x 1, making sure that my bounds were 1 and –1 so that the box and the moss are located within the same areas in space. 

 

 

Now we will apply a shader to this box.  The reason we can do this now is because whatever attributes and information the box has will be applied to the moss when it is rendered.  I just chose a renderman plastic shader for testing reasons, (Go into your SHOP network and tab in a Renderman Plastic. Go back into your geometry network, load a Shader SOP, go to the shader tab and load the RI Plastic.

 

Now that you have your bounds correct and your shader is applied, go back to the Object level of your file and select your Geomerty node.  In the parameters window of your Geometry node, click the Render tab.  This is where you will set your box to render as your moss model.  On the Geometry option, click “Render to File” and then set your Geometry file to your lod.rib.  Now we can render this out and get level of detail working.

 

 

Using the Renderman Renderer in Houdini


            The last step is to get Houdini to use Renderman as its renderer so you can test your Level of Detail.  Go to your Output Network, (ROP) and tab in a Renderman node.  I normally delete the default mantra nodes so I don’t confuse myself.  Select your Image Device to “it” so that you can use the catalog to view your renders.  Now you should be able to render out your scene. 

 

 

Now you can try and set up multiple boxes by duplicating your Geometry in object level to get the true effects of your Level of Detail.  My test example is below with several boxes.

 

Within Houdini:

 

 

Rendered Out:

 

And thats It!

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



Showing Level of Detail Using Color. (Double Click to Play)

Blue: High Detail

Green: Low Detail

Red: Curves



Running Seamlessly