Rendering Procedural city...HELP!

   4883   6   1
User Avatar
Member
225 posts
Joined: July 2005
Offline
I'm setting up a procedurally generated street section that generates at one end and deletes itself at the other (think static car, moving BG). Currently I've set it up so that the buildings are a geo sequence copy stamped, referencing $TPT in the Copy SOP. The system works great but my problem is that each building in the sequence is fairly highly detailed and they are also randomly scaled and oriented via stamping and as a result the whole thing slows down to a crawl. I've created a switchable branch that displays the BBoxes for performance's sake but I'm not exactly sure how to use instancing and/or archiving with copy stamped gometry .

Essentially I want to create an archive of each building on disk and reference it at render time via It's bounding box in the copy network. How should I best set this up? I'm using Hfs 8.2 NC for this

Thanks,

Lyn
User Avatar
Member
1631 posts
Joined: July 2005
Offline
Hi Lyn,

To set up the archiving, you have to create as many Geometry objects as there are buildings. To render from disk, go to the Render tab of each Geometry object, set the Geometry parameter to “Bounded file (Render SOP defines bounds)” and set the path to the file in the Geometry File parameter.

You will want to write a script to create the Geometry objects with an Object Merge inside to read the bounding box from the copy-stamp network, set up the render from disk parameters above and also fill in the path to the files.

Good luck!

Cheers!
steven
User Avatar
Member
225 posts
Joined: July 2005
Offline
Thanks Steven,

I thought it would be something like that, hehe, All this procedural mojo can make a guy lazy,
I'll try that and keep you posted

Edit: Not sure I understand the second part. The source geometry in the copy sop right now is a file sequence, should I replace that with individual object merge sops going into a switch, or are you saying something else?
User Avatar
Member
225 posts
Joined: July 2005
Offline
No luck, Could I trouble you with a small example?

I've got the buildings bounds into the copy network but rendering that network only renders the bounding boxes of the buildings I'm merging from. How do I tell mantra to obey the link to archive.

By themselves, the boxes render as correctly as buildings but not within the copy sop
User Avatar
Member
1631 posts
Joined: July 2005
Offline
Hi Lyn,

I'll try to see if I can set up an example later but I'll try to explain it clearer here.

First, your copy-stamp network has placed all the buildings' bounding boxes where you want them. In order to render them, you have to put each bounding box into a Geometry Object.

Say you have ten bounding boxes, named building_0 to building_9, you will have to create ten Geometry Objects and in each of these Objects, you want to object merge the corresponding bounding box.
building_0 Object -> object_merge copy-stamp -> building_0 bounding box
building_1 Object -> object_merge copy-stamp -> building_1 bounding box
…. and so on
After setting up the Geometry Objects, you will set up the Geometry parameter to “Bounded file (Render SOP defines bounds)” under the Render tab and also put in the corresponding building .bgeo in the Geometry File parameter. Make sure the Render Flag is set on the Object Merge SOP.

Hope the above helps!

Cheers!
steven
User Avatar
Member
225 posts
Joined: July 2005
Offline
Ok so I got both instancing and archiving to work courtesy of some custom attributes, also had to change my stamp expression a bit but all is good now and it works like a dream,

thanks steven
User Avatar
Member
225 posts
Joined: July 2005
Offline
I've hit another wall with this.

Now I have primitive groups on my building geometry sequence that are consistently named according to building materials for shading purposes. I want to randomly cycle say five kinds of brick on a group called BRICK on each model and I want to stamp attributes on the Instancer object's points to randomly pick one type of brick. So how can I reference the group BRICK on my instance points, since I'm using a vm_surface attribute on the points. This also means I need multiple shader calls, one for each group on the Instancee geometry.

Is there some way I can do this?
  • Quick Links