Instancing objects with materials that have heavy textures

   1984   6   2
User Avatar
Member
8 posts
Joined: Feb. 2020
Offline
Hey there,

I'm trying to build an outdoor scene where I would scatter tens of thousands (maybe hundreds of thousands?) of grass objects over my landscape. Here's where I ran into trouble:

I'm using the instance node set to fast point instancing and am setting `shop_materialpath`, that points to a single material with heavy textures, as a point attribute. When I scatter 100 points inside of the instance node it shoots up to 28 gigs of RAM when I render it in Mantra. When I do 200 it shoots up to 45 gigs. I'm assuming it loads a copy of the material for every instance into RAM and I don't need that. I simply want to have the same material on each instance.

Just the mesh without the material applied works like a charm. I can easily instance 100k bushels of grass without Mantra breaking a sweat.

I looked a little bit into Delayed Load Procedurals and IFDs, but I only have an Indie License, so that's apparently out of the question for me.

So the question is, how do I go about instancing a lot of objects with textured materials?

Cheers,
Philipp
User Avatar
Member
405 posts
Joined: April 2017
Offline
Is the RAM usage any different if you simply apply the material to the grass clump at the object level, then instance that, instead of using s@shop_materialpath?

Also, consider pre-converting your textures to .RAT and see if that helps?
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
8 posts
Joined: Feb. 2020
Offline
Thanks for replying toadstorm!

There's no difference at all if I apply the material at the object level vs. shop_materialpath. They were already converted to .RAT by the Megascans plugin apparently.

Edit:

Just found out, that if I disable the displacement map it goes down to a couple of GB of RAM and when I additionally disable the opacity map it goes down even more. Can anybody explain why that is? Especially the displacement scenario?

I think clumps of grass are fine without displacement, but what if I had to instance a bunch of objects with their displacement maps attached?
Edited by pheuberger - June 28, 2020 12:13:56
User Avatar
Member
405 posts
Joined: April 2017
Offline
I was just about to ask about displacement before I saw your edit!

You can try enabling displacement sharing on the object… the Mantra property is vm_sharedisplace. Without this, every instance will be diced separately which will understandably eat all your RAM.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
8 posts
Joined: Feb. 2020
Offline
I see! That means he will keep a high poly instance of every object in memory?
How do I use `vm_sharedisplace`? I didn't find anything on the object and the Mantra node.
User Avatar
Member
405 posts
Joined: April 2017
Offline
On the Instance object itself, edit the spare parameters for the node and look for Mantra properties on the left. Search for the one called “vm_sharedisplace” and add it, then enable it in the Parameters window.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
8 posts
Joined: Feb. 2020
Offline
Oh wow, I had no idea you could set render params like that.

It works like a charm and stays well below 10 gig of RAM now. Thanks a ton!
  • Quick Links