Jump to content
tortoise

Redshift Instancing Issues (RBD-Sim Piece Detailing)

Recommended Posts

Hello,

I recently went through Steven Knipping's tutorial on Rigid Bodies (Volume 2). And now I have a nice scene with a building blowing up. The simulation runs off low-res geometry and then Knipping uses instancing to replace these parts with high-res geometry that has detailing in the break-areas. The low-res geometry has about 500K points as packed disk primitives so it runs pretty fast in the editor. Also, it gets ported to Redshift in a reasonable amount of time (~10 seconds). However, when I switch to the high-res geometry, as you might guess, the 10 seconds turn into around 4 minutes, with a crash rate of about 30% due to memory. When I unpacked it I think it was 40M points, which I can understand are slow to write/read in the Houdini-Redshift bridge, but is there no way to make Redshift use the instancing and packed disk primitives?

My theory kind of is that RS unpacks all of that and that's why it takes forever, because when I unpack it beforehand, it works somewhat faster - at least for the low-res. The high-res just crashes.

I probably don't understand how Redshift works, and have wrong expectations. It would be nice if someone could give me an explanation. Attached you'll find an archive with the scene with one frame (Frame 18) of the simulation included as well as the folder for the saved instances of low- and high-res geometry. 

Thanks a lot for your help,

Martin

(Here's the pic of the low-res geometry, the high-res is basically every piece bricked down into ~80 times more polygons.)

image.png.e8443c7fefba54e126b67363ec97b4ab.png

Martin_RBDdestr_RSproblem_archive.zip

Edited by tortoise
Rename Topic to fit.

Share this post


Link to post
Share on other sites

The unpacking is probably the problem, that is why you may want to re-configure your scene to use Redshift proxy files instead. Then you can leverage the @instancefile attribute. When all your geometry is on the disk, and not in the scene, Redshift does not have to go through the Houdini single-core API to fetch and extract things. This gives better performance on export.

I put together an overview on how to setup this kind of system in my latest video here.

  • Thanks 1

Share this post


Link to post
Share on other sites

After looking over your file I think you can just bypass your instance nodes. Instead of setting your string attribute s@instance_hi set s@instancefile and point it to the .rs proxy files you generate with the technique I mention in the video.

  • Thanks 1

Share this post


Link to post
Share on other sites

Oh wow, that's the perfect video for my issue! Thanks so much. :D

I haven't gotten to it yet, but it looks like it has to work.

I raise my hat to you, Atom!

Share this post


Link to post
Share on other sites

Alright, so I tried out your approach and it seems to almost work. The thing that's missing now is the transformation of the original pieces. It looks like this now: Screenshot_55.thumb.png.b7b5c1a37bd2a08973a2fe07d48f4d8a.png

Now I wonder if redshift stores the transformation values/matrices for the instances in a different manner as houdini? 

That's the code I used from Steven Knipping's original setup to transform the Pivot and Transform from the original points to the instances.

image.thumb.png.e7f8d4824fd8dd6ff34f26fd2d4271ae.png

Any more ideas? :unsure:

 

Edited by tortoise

Share this post


Link to post
Share on other sites

When you created all the .rs files, were the source pieces at world origin? I think they need to be at world origin so when they are copied to points at a later time they will be in the correct location.

I think the .rs export writes the current location of the vertices in world space. I don't think it embeds a transform.

 

Edited by Atom

Share this post


Link to post
Share on other sites

Baby steps. I tinkered with the instances a lot and fingured out that the instancing if applied to the packed sim data projects an instance to every unpacked point. I fixed that by copying a point to every instance (with keeping the orient on the copy-to-node) and transferring the needed attributes. 

My next issue that you identified very precisely Atom was that the saved instances are saved at the center. So I had to transform the instances' center to the origin (when saving out the proxies) for the instances to appear where they were intended.

And my last and not yet solved issue is that the rotation is not applied entirely to the instances. It's weird, but I feel like I'm getting there.

I can post some pics and the hip tomorrow.

At this point I think I'm just looking for a way to get the intrinsic rotation of the sim's pieces to the points that I clone the instances onto. Any suggestions I'd be very happy about.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×