Render Passes in Behavior

December 6th, 2005 by Patrick Boucher - Viewed 9239 times -

I’m currently winding down on this Behavior project that has been making me loose sleep. I’m at the stage where I need to create my data for my multiple render passes….

Warning: If you’ve never used Behavior before or don’t care for crowd sim, skip this one. If you care for a stupid Behavior trick… Read on…

Behavior has a rendering pipeline that involves spewing a bunch of files into a directory and rendering them out with a nifty geometry shader and Mental Ray. Thing is, you have to run a simulation for every render pass you have. This means, you don’t have a choice but to cache your actor’s motion data in a first pass and then simulate all your other passes using the cache to output your .mi2 files.

When I did all this I wound up with characters that wouldn’t render at exactly the same spot from pass to pass even if I had used a caching mechanism. We’re talking pixels here but it was enough to show…

Ever notice all those .mrd files Behavior creates along with your .mi2 files? They contain your actor positions for every frame of your simulation. To get my passes properly aligned I just copied all the .mrd files from the output directory of one simulation into the output directory of another and voila!

I’m wondering if this is just a cosmic fluke that should be chaulked up to planetary alignment or if it’s a legal Behavior move but… It just saved my butt!

Carry on!

3 Responses to “Render Passes in Behavior”

  1. Yotto Koga says:

    Hey Patrick,

    Yup, that”s a legal Behavior move.

    Just a slight correction on the multiple passes, though. You can actually run one simulation and dump out MI files for each pass. When you do the “render setup” step in XSI, do one for each pass and put the resulting render setup data in a seperate folder. In the sim, create a mental ray object for each pass and initialize them in the standard way (same way as when dealing with one). Make sure each mental ray object spews out its resulting MI files in a different folder. Run the simulation once, and you should see MI files for each pass. Make sense?


  2. Makes total sense! Avoids having to run separate simulations.

    As an exercise I tried creating my own motion caching function (which was way slow because in Piccolo) and I”d have the same problem. I figured it was probably floating point values being rounded off to some number of decimals in the caching. Does it make sense or am I off track?

    Thanks for the info and I”ll try it right away!

  3. sagenz says:

    I just had to laugh. when you click on behavior in the main sidebar all the google ads turn up as dog behaviour ads :) sorry about the distracting comment