drawing by Will Perkins (2005)

 

Houdini & Renderman: Together At Last (...or soon in enough)

I have decided to write this page to fulfill a request that Professor Malcolm Kesson made to me earlier during the quarter as he saw that I was trying to do my work in Houdini indead of Maya. All the information here I have borrowed form different source which I'll try to give credit as a go along.

Why no just use Renderman Artist Tools with Maya instead?

Well, what if you prefer to work with Houdini's workflow or what if you want to render with the best particle creator, Houdini, with the best renderer out there, Pixar's Photo Realistic Renderman.

I ran into the Renderman-Houdini dilemma when I was modeling my gumball for the Level-of-Detail project. At one moment I decided to model in Houdini because I have issues with Maya, plus I am rookie when it comes to modeling anyway. I had theorize a way, which worked, for making instance spikes which would be generated very easily and all would be slightly different as I'll explain in my level of detail page. Originally, I was just going to do what I had to do in Houdini to get my model done and once it was finished I was going to export it into maya as an *.obj and then worked the other steps of the Level-of-Detail/RibBox assigment as we were tought, but when I exported it into maya, I couldn't. I still need to find what went wrong since exporting Houdini models as *.obj is the way for us to be able to use Houdini models in Maya, at least if they are polygonal. Apparently, to do so with NURBs you have to export them as *.dxl or something like that. So, I thought, let me see if I can export my model as a *.rib and then manipulate it to work as an archieve for Maya. And it workd, at least partially.

Houdini Rib Export to Maya

To export Houdini models as *.ribs is as easy as exporting them as *.bgeos.

First, go to the last node within your SOP level. Basically put your display tag on the node you want to export (the node you'd select to render with Mantra for example).

Then, right-click and hold, on the center of the node and select Save Geometry.

Consequently, a Save dialogue box will open. In it, press the triagle button and choose your format. Select, *.rib.

Then, all you have to do is select your saving location. You can do so by either pressing the plus button or typing it and then clicking on Accept.

Now, here's where I did some experimentation. To get into Maya, I converted the geometry into a Rib Archieve, like we did for the Level-of-Detail Assigment.

I bassically added AttributeBegin and AttributeEnd for World Begin and World End.

Then, I saved this rib file in my archieve folder. I went to Maya and did the RIB box. The model appeared render like it should and it responded to the Level-of-Detail and everything. But this happened,

weird cartonlike facetation thingie. This happens everytime I used this method. Everytime I render houdini models using anything except Houdini.

In Houdini, though with PRMAN, I get this

Note: Information on Chapter 11 of the Houdini Tutorial 5.5 provided by SideFX provides more information that I might get into for solving this issue.

Also, this tutorial proposes another way of exporting *.ribs from Houdini by utilizing the Output node.

So, how do I render in Houdini with PRMAN. Easy.

Rendering in Houdini with Photorealistic Renderman or Any Renderman Complaint Renderer

First things is first: Environmental Variables

For happy times, set PRMAN variables in Windows. This will save a lot of trouble in the future. As you know by now, a variable contains a value. It for example can contain the value of a path to a directory in your system. Environmental Variables provide variables that are accesible by all the programs in the Windows enviroment. PATH is one of this. PATH contains a list of your most important programs's directory location. By adding, PRMAN for your path, for example, you can simply run PRMAN from anywhere in your Command Line without having to specify its past. In Houdini, it enables you to render by just typing too prman. Some programs, like Houdini, for example, have functions set to looks for specific programs, like PRMAN, by searching the PATH variable. So, simply, add the following to your variables:

C:\Program Files\Pixar\RenderManProServer-11.5.3\bin - says where prman.exe is.

C:\Program Files\Side Effects Software\Houdini 7.0.231\bin - says where Houdini is.

Note: Only, a Administrator can alter this variables. Montgomerry should have this already set. Also, not that this might be different depending on what software versions you have. You should add to this variable any other Renderman compatible renders you might have.

You should follow Grav's instructions on how to setup Enviromental Variables and more in Windows.

It is really simply and standard. Grav's Rendering Tips Section of his own Renderman Portfolio Page

Once more, select the node that you want to render and put a display tag on it.

Go to your Outputs in your Network windows to select your render as if you were going to render with Mantra and add a Renderman node instead of a Mantra node.

Now, we need to set up the node.

First, check that you the correct camera to be rendered is set and looking at your geometry/composition.

If you are going to render with the latest PRMan, change the Renderman Version to Pixar's Renderman 11.0.

As you can see, you can even set it up for 3Delight or any other Renderman renderer. For other renders, you need to do something else which I will show you soon. For now, let's try PRMAN.

Now, if PRMAN is set up correctly into your PATH Environmental Variable. You should not need to touch your Render Command. If is not setup correctly, and your image won't render, then you will have to specify the absolute path to where your render is. So, instead of prman you would have something like

C:\ Program Files \ Pixar \ (the renderman folder) \ bin \ prman.

As you can see too, you can now alter the Super Sample and too, you may select to use the interactive mplay window, or to render a sequence of images in Output to picture just as you would with Mantra and to get Tiff files go to Image Device and select Tiff File.

Let's say you want to render with something other than PRMAN, like 3D Delight. Well, instead as selecting Pixar's Renderman 11.0 as your RenderMan version select 3D Delight. Remember to change your Renderman Command to 3D Delight's (renderdll). You can either type it in or

and look for 3D Delight. Oh, but it is not there, so I'd just type in renderdll which is the file that executes 3D Delight Render. I'm showing you this window, because if you were going to let say use Entropy 3.0, you get options within that selection.

Now, just render and there you go. But, of course, I haven't talked to you about using Renderman Shaders and Lights.

Using Renderman Shaders in Houdini

First, let's try by using Renderman Plastic. To do so is as easy as applying a VEX shader.

Go to your SHOP level and add a Renderman Shader.

That should add a RMan plastic shader that now you can add, but ...

You get an error. This is where the professor and I got stuck. Your Environmental Variable Path should be set up correctly by now, so that's not the problem. The problem is b) the Houdini Renderman display device, which is a separate plug-in, is not installed. So, luckily I found a solution to this problem in the following website: http://www.odforce.net/wiki/index.php/PrManSetup.

This states that a plug-in is required to be installed. If you have Administrators right, then you may do the following steps.

In Houdini, go to Windows-> Shell. This opens the DOS Command Line and it takes you to

C:\Porgram Files\Side Effects Software\Houdini (and it's version).

Now run proto_install by typing it in the command line.

So, type in 18 for RManDisplay.inst...in my case, it is already installed. For some reason, version 6.0 (where I was taking the snapshots from does not have it available).

It will then ask you to select the directory where you would like to install it. I selected 1).

Then it ask you this, I said yes.

Then it will ask you if you want to test it, say yes. My for some reason got linked to 3D Delight, but it works the same way.

There you go, just like SLIM, but much nicer. On your left, a huge preview for your shader that updates as you edit its values on the right.

But, it gets better, and I think this is where Houdini is better than Maya.

Now, let's apply it to geometry.

Go back to your SOPs and add a SHOP to the node selecting the geometry to which the shader will be applied. Once again, like you've always done in the past with Vex.

Once your SHOP is adequetly attached to your geometry or last node. Remember to make sure that you have the faces selected within your SHOP. Once again, just like you always did before with other shaders.

Now, look for your ri-shader to link it to your node.

We do this like with any shader, click the plus sign near the Surface field.

This Choose Operator window will pop up, selected, and click Accept.

Now, make sure that node is selected with the display tag.

And, here is the surprise...

You can see it in the viewport!! Just like any other shader. In Maya, I believe, when you attach any Renderman Shader, in order to preview it, it has to be in the SLIM window, not in your viewport. You'd have to render a frame to see it how it looks, in Houdini, you can at least preview, and see an update without always having to wait for a render. What about lights?

I still need to test that. It seems that you have to enter a lights node to get into it at SOP level and apply a shader SHOP to it. The thing is that lights are applied at OBJ level where Shader Operators cannot be added. There must be a way to link lights to its Renderman shader. I yet to test that. Somewhere I have a link here to add.

Renderman Lights - COMING SOON

For more information: http://accad.osu.edu/~smay/DigitalLighting/Houdini/houdini.html

Applying Custom Renderman Shaders in Houdini: the part you were looking for.

So far we've only used Renderman Shaders that are already available to you in Houdini. This is the good part. For this, I turned to Professor Malcolm Kesson's web page. .Start by going here. If you note, the professor has set Cutter so that it is very easy for you to make Custom Shaders on-the-fly.

The thing is that Houdini needs *.ds for your shaders to be recognized. A *.ds is a Houdini version of an *.sli (http://www.odforce.net/tips/cvs/setup_shaders.html). To create a Dialogue Script from your custom shader, you have to run rmands to your Pixar Compiled shader version of your shader (*.slo). Now, if you follow the instructions in fundza you can have Cutter do the *.ds created for you and ready to go.

Your First Time

1. Make your set_houdini_paths.bat (H:/rman/shaders -----> H:/vsfx319/shaders; if you are taking Programing Models and Shaders).

more info on what is setx - http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/setx-o.asp

2. Make a SHOP directory (remember it has to match the one specified in your set_houdini_paths.bat).

3. In Cutter's Preferences --> RMan tab --> Options taba; NOTE: output .ds to SHOP directory. (It will make your ease your shader creating process).

4. Now make your shader and compile it. If all is going well, you should have a *.ds file in your new SHOP menu. NOTE: If this does not happen, for example, you don't have your SHOP directory at H:\, then go to Preferences --> Language tab --> VFL tab --> SHOP Dir.

Then you have to change where Houdini's rmands and other important files are. It should be something like C:\Program Files\Side Effects Software\Houdini 7.0.231\bin. Now, hit Save VFL.

If Cutter for some reason, it happend to me, does not produce your .ds then you can call up rmands yourself and create a *.ds for your *.slo.

Note: The reason I wasn't producing *.slo is because you need Pixar's compiler. 3Delight produces *.sdl's and *.sli's, I guess *.sdl is 3Delight's version of *.slo? When running rmands manually I found out that it needs an *.slo to work. So, when I set Cutter with Pixar, it generated the *.slo and everything else happened automatically.

(see htpp://www.odforce.net/downloads/ tips/plim_HoudiniRMAN_Tut_v1.3.doc). In this document, you will notice that you can use your shader in Houdini without the Dialogue Script Interface (Slim Editor equivalent) by writing in a line, but having an interface is more effiecient.

Here you can see what is generated by Cutter. Notice the folder and SHOPsurface file. Notice the *.ds file created inside the surface folder.

As you can see, the SHOPsurface that was created in your new SHOP directory keeps a record of all the custom shaders you have imported into Houdini.

5. Double click the set_houdini_paths.bat file. Launch Houdini.

Note: You need to download setx in order for the bat file to do its job. Once you do, it will install setx.exe in C:\Program Files\Resource Locations. Bad idea, install it or copy the setx.exe into your C:\Windows\System32 folder so that when you run the bat it will know where to find setx.

Setx - This command-line tool offers a batch method for setting environmental variables in the user or system environment and requires no programming or scripting. In addition to taking an environmental variable and its associated value from the command line, it can also get the values of registrykeys and write them to text files.

Are you thinking what I am thinking?

Yep, you don't really need setx if you know how to set up Environmental Variables in window. We can make themm permenant by adding them to the System Variables.

There it is, your custom shader.

But, just when you think you are done you run into yet another problem. You can't preview the shader. It just plain, nothing. Nothing in the viewport and if you try to render it out, the shader looks weird. For example, instead of getting a Green Cross for my custom Green Cross shader, I get a single line on one of the corners. So, why is it that I have no problems with the RMan shaders provided to you by Houdini? First, I thought, well maybe there are some settings within the *.slo files. So, I right-clicked on the Houdini plastic Renderman shader and I was taken instead to an *.otl. *.otl?? That's when I remembered this

http://sfdm.ca.scad.edu/vsfx/faculty/malcolm/Ca301/wip/wip_winter2005/vsfx319.1/hubert_weldon/houdini/create_otl.htm.

So for me, it was simply

rmands -L C:/vsfx319/shaders/green_shaders.otl C:/vsfx319/shaders/green_cross.slo

That creates an *.otl version of your compiled shader and puts it into your shaders directory.

So, what is an *.otl? Operator Type Library.

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

Houdini allows you to create Custom Operators very easily. These operators (we call them HDA's - Houdini Digital Assets) are stored in a special file called an OTL (Operator Type Library) on disk (usually with the .otl extension). Houdini sessions read these OTLs and the operators become available to the user - they appear in the operator menus.

These operator definitions (called HDA's around these parts) are stored within a file called an OTL (Operator Type Library). You can store many HDA's inside of one OTL if you wish. Houdini looks down the HOUDINI_PATH environment variable and looks for files named OPlibraries, which contain a list of otls. Houdini then loads all the otls named in this file and adds them to the operator menus.

---- http://www.odforce.net/wiki/index.php/CustomOperators

So, install the file in Houdini just like it is mention on Grav's page.

Dead End - not anymore!

..........This is how it should look like................................... ......grr.....Result...........

 

So, I tried the *.otl. The *.otl didn't solve the problem. Therefore, you don't need an *.otl version of your Custome Shader to make it work. The Pixar Compiled version (*.slo) with its respective *.ds file. Therefore, with just compiling your Custom Shader in Cutter and having it set like we did above should be enough to have Houdini use your shader. But, for some unknown reason it won't read adequetly our shaders. There seems to be something about the way we are writing this shaders. How do I come to this conclusion? Where, I took the liberty of testing other shaders. And yes, I tried messing around with UV projectors ans what not. First, I tested different Custom Shaders made by classmates with different codes and what not and nothing. Then, I said, why not, and I took a look at a Pixar shader and imported it in Cutter and looked at its code. I noticed that the syntax is kinda different, I don't know I am knew at this. Consequently, I render this shader out and Houdini had no problem working with it. I continued exploring my theory by downloading a random shader online. I came across these ones (http://www.smartcg.com/tech/cg/courses/RMan/notes/Class02/Class02.html). I copied this RSL code and it worked with Houdini. I think it has something to do with the syntax and the way Houdini is reading things because Maya is not having this problem right? I applied around with this codes and I still have not yet come to any conclusions.

But, at least now you know how to render with PRMAN in Houdini and our big breaktrough: the Renderman display thing which allows us now to use Renderman shaders and lights in Houdini.

 

Other References

http://www.dctsystems.co.uk/Houdini/index.html

http://www.odforce.net/wiki/index.php/PrManSetup

Houdini Tutorial 5.5 - Chapter 11 has a lot on Renderman Rendering; new Houdini variables and even the Houdini rib syntax. I still need to read more carefully this section.

Houdini RMAN Tutorial v1.3

 

Future Plans

- Basically I was going to list the things needed for Houdini to work with Renderman in Montgomerry Hall. Basically, the System Administrators shoud have the Renderman Display driver setup for Houdini via proto_install and the Enviromental Variables (we don't even need the set_houdini_path.bat anymore if all the variables are set already).

- I was going to add a quick list for what to do for adding future Custom Shaders after you had already done the First Time setup. Just a quicker way.

- Ever wonder how you apply Level-of-Detail with Renderman-Houdini. Well, I rean into this which I want to explore too:

HaRM (I think there is someting about applying IN/OUT RIB information into your file; I have a fuzzy recollection of this in the Houdini Tutorial 5.5)

SOON TO BE UPDATED DURING FREE TIME!