custom attributes with point instances

   9067   12   5
User Avatar
Member
17 posts
Joined: April 2011
Offline
Hi,

I'm using point instances with trees. Each tree is a cached sequence of bgeo files. For each instance, I would like to be able to latch on to the $PT value, or better yet a custom attribute, to offset the wind animation between the individual instances.

Everything I've tried applies the same offset to all instances. Is it possible to pass any other data on to the point instances rather than the basic transform/normals/velocity values (the “standard” set)?

I know there are ways to do this with Copy sops, etc, but it's crucial for this to work with point instancing since I will have possibly 10,000 instances.

Thanks!
Windows 7 64-bit, GeForce GTX 260, 12 GB RAM
User Avatar
Member
700 posts
Joined: March 2009
Offline
You can find more info here:

http://www.sidefx.com/index.php?option=com_content&task=view&id=1050&Itemid=216 [sidefx.com]

cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
17 posts
Joined: April 2011
Offline
Ah yes, thanks, I saw that post. However, it doesn't work for me for these reasons:

- I can get instancepoint() to register for transform properties but not arbitrary ones, like my wind frame offset value.

- that article states that the scope of instancepoint() is only for objects. Since the actual node that is driving the animation is the file SOP inside of the object container, it can't use instancepoint(). I tried mapping the frame number in the file slot to an arbitrary parameter on the object (see last bullet), but that didn't work either…

Any other ideas?
Windows 7 64-bit, GeForce GTX 260, 12 GB RAM
User Avatar
Member
700 posts
Joined: March 2009
Offline
Yeah, I can't tell about houdini 12, as I don't have acess to it yet…

If you want to custom point attributes, just use the point() expression and replace the point number with the instancepoint() function.

You can the edit the obj node's parameter interface and promote internal parameters to Obj level to use the instancepoint function.

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
17 posts
Joined: April 2011
Offline
Thanks for the lead. However, I'm not getting that to work either.

Do you mind taking a quick look at a simple HIP file I've attached? It is a point instance obj with a custom attribute added. It is instancing a font obj in which I promoted the text parameter from the inner sop.

I can use pointinstance() on the font obj's TY parameter and it works as expected when you render. But The text label should be reading the customAttribute (which is just the point number or $PT).

Any ideas? Can anyone get these point instances to report the attribute value to the labels?

Attachments:
instantpointtest.zip (19.5 KB)

Windows 7 64-bit, GeForce GTX 260, 12 GB RAM
User Avatar
Member
700 posts
Joined: March 2009
Offline
hey, Slickowicz

Sorry for misleading you, I was thinking of an exercise with point instance that I did 100 years ago and instead of varying every single instance, what I did then was to split the total number of instance points into smaller groups (say 5) and generating an equal number individual geometries to be instanced (one instance per group of points) then varying these instances.
Once they are copied around the general feeling is that you get all different elements as you vary the material parameters per point instance, but in fact you're dealing with a limited number of variation.

I guess the point of having instances is to reduce memory footprint and if we have all individual elements to be instanced we end up with the same problem, right? Because Mantra still has to load a ton of geometry.

One option to help you with viewport is to still do everything using copy stamping, but then you create a really light geometry to be displayed in the viewport while a full resolution geo has the render flag.

Again, sorry for the wrong info, I'll be more careful next time!
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
17 posts
Joined: April 2011
Offline
Rafaels,

No need to apologize, you gave me some really useful info

I think, like you were saying, that what I'm trying to do isn't possible with true point instances. I think this general approach is very close, though… I wonder if I can channel the PT variable down instead of a custom attribute, that's what I would need. I'll continue exploring!
Windows 7 64-bit, GeForce GTX 260, 12 GB RAM
User Avatar
Member
700 posts
Joined: March 2009
Offline
Sure thing, and give us a shout if you need a hand
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
300 posts
Joined: Jan. 2010
Offline
What you wan't to do is this:

http://www.sidefx.com/docs/houdini11.0/copy/delayedload [sidefx.com]

Use delayed load procedural to load the geometry for the instance. Then you override the parameter that specifies what files to use.
Drive, monkey, drive!
User Avatar
Member
700 posts
Joined: March 2009
Offline
Yes, Erik, that's a great option, but we would still have to limit the number of variations, right? Rather than having every single instance to be a completely different one.
Can you pass parameters to the geometry that's being loaded, other than material or OBJ level transforms?

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
300 posts
Joined: Jan. 2010
Offline
rafaels
Yes, Erik, that's a great option, but we would still have to limit the number of variations, right? Rather than having every single instance to be a completely different one.
Can you pass parameters to the geometry that's being loaded, other than material or OBJ level transforms?

Cheers

You can override a string variable. You just have to make that contain whatever bgeo you would like rendered for the specific frame.
Drive, monkey, drive!
User Avatar
Member
49 posts
Joined: Jan. 2007
Offline
Use delayed load procedural to load the geometry for the instance. Then you override the parameter that specifies what files to use.

I'm trying to do this - basically I have a series of bgeo on disk. I would like every point that is instanced to read a different frame from that series. So I made a delayed load shader and assigned it to my instance. Now, on the material tab of the instance I've tried to create local material parameters from the menu - in hopes that I could override the string used to look up the file name per instance. However, I get this error : “Warning: /shop/vm_geo_file1 is not a material”, when trying to ‘Create All Local Material Parameters’.

I'm confused on how to add a string override for the file parameter of the delayed load shader as you suggest.
User Avatar
Member
49 posts
Joined: Jan. 2007
Offline
Okay, so I managed to do what I was after from my previous post. Attached is a file that accomplishes reading a different disk bgeo for each of my instance points.

This should let you playback different frames of pre-cached animation for different points. The real work is initializing the custom ‘cache_frame’ attribute in the attached example to control what point gets what frame. You'll need to cook out /obj/write_geo for this example to work.

More or less it boiled down to not worrying about setting up material overrides and more about just using instancepoint() in the delayed load procedural to look up a point attribute. I guess I was over complicating it.

An improvement would be to figure out how to get the correct bounding box inserted dynamically into delayed load procedural for the given frame. Currently the example hard-codes it. Suggestions welcome.

Attachments:
animated-delayed-load.hipnc (122.4 KB)

  • Quick Links