Jump to content
Mzigaib

Randomize time offset on alembic instanced objects/files

Recommended Posts

Mzigaib    18

Is there a way to use instanced alembic cache and time offset them without create bgeo sequence files?

 

The way I am using instance alembics now is having multiple alembic nodes with different time offsets and instance them on points.

 

Is there a way to have only one alembic file loaded and randomize its time offset between the points?

 

Thanks.

  • Like 1

Share this post


Link to post
Share on other sites
crunch    11

You can set the primitive "intrinsic:abcframe" attribute.  Or the "intrinsic:abcfilename" attribute.

 

Provided you have an existing Alembic primitive.

Share this post


Link to post
Share on other sites
Mzigaib    18

That is cool! I'll try that.

 

I am not using copy/stamping I am using instancing which is more suitable for what I am doing.

 

Anyway thanks for the tips!

Share this post


Link to post
Share on other sites
Mzigaib    18

I am trying "setprimintrinsic(geoself(),"abcframe",@primnum,"150", "set");" on a primitive wrangle inside my instance node, the alembic file is in a node outside and I am instancing it on my points using the "instance" attribute.

I am sure that I am doing something wrong, any tips?

Share this post


Link to post
Share on other sites
fathom    73

prim vs point seems to be an issue here.  you're instancing on points, but trying to adjust the frame with a prim intrinsic.  seems like it's doomed to failure.

 

how are you instancing?  i would suggest a copy sop with your alembic prims, then you could stamp with a time offset to pull the stamp value and calculate random offsets.  shouldn't be any heavier than using point instances....

Share this post


Link to post
Share on other sites
Mzigaib    18

Can't do it with copy, to many geometries like thousands of high res trees with animation the only way I could make it possible is with instancing I am just trying to get a right workflow with instancing in a more procedural way possible.

I am trying now to use the "instancepoint()" expression but so far I am not sure that this can work with instanced alembics.

Share this post


Link to post
Share on other sites
Mzigaib    18

If I have bgeos I can use the "instacefile" attribute to change the offset between the sequences in the instances because I can have access to the frames I can't do the same with alembic, if I could do the same with alembics it would spare me the labor to convert all the alembics in to bgeos just to do that.

 

Any tip will be welcome.

Share this post


Link to post
Share on other sites
fathom    73

Can't do it with copy, to many geometries like thousands of high res trees with animation the only way I could make it possible is with instancing I am just trying to get a right workflow with instancing in a more procedural way possible.

I am trying now to use the "instancepoint()" expression but so far I am not sure that this can work with instanced alembics.

 

if they're alembics, they should stay as instances.  when you read them in with an alembic sop, set display to bounding box.  the actual render geo will be a delayed load alembic prim.... it should be pretty light even with a copy stamp.

Edited by fathom

Share this post


Link to post
Share on other sites
Mzigaib    18

I don't believe that I could use copy/stamping even with alembics or packed objects with the amount of the geometry that I want to render that's why I am stick to instancing in this case, but thanks for the tips.

Share this post


Link to post
Share on other sites
fathom    73

30k polys in an animating alembic cache.  100k instances via copy stamp offset by anywhere between 1 and 100 frames:   5.02gb to render.

 

using point fast point instances (instance node).  same 100k points.   no offsets (cuz it's not possible this way):  5.61gb to render.

 

a copy sop with packed geo and caching will generate geometry with internal instancing that's pretty much equivalent to class instancing.

 

a stamp function in an alembic prim sop (timeshift probably would also work) can easily offset your geo.

Share this post


Link to post
Share on other sites
Mzigaib    18

I'll try with copy sops just to be sure but my instances are much higher res, I have multiple tress between 800k to 1mil polys each and probably more than 100K instances counting with bushes and grass.

 

To give you an idea I have to accomplish something like this but with camera traveling a higher distance.

 

https://vimeo.com/147444340

 

Thanks for the tips, I'll let you know what I've got.

Share this post


Link to post
Share on other sites
anim    589

polycount should not be the issue, that's why Houdini has packed alembics and packed disc primitives

so if you load your alembics as packed and display them just as bounding boxes or  as hidden

then you can copy them on your points and vary filename and frame instrinsics as suggested and you should be fine, better than instancing

 

if you want to push it further, you can create a library of leaves, branches etc, then assemble your trees just from those loaded as packed disc or packed alembics and then assemble your forest from such assembled trees

then all your forest will be using the same library which can be extremely lightweight on memory

Edited by anim

Share this post


Link to post
Share on other sites
Mzigaib    18

Thanks for the tips dude but about the material assignment how you handle it? If you load alembics as packed you loose the different primitives to assign materials, how to proceed?

Share this post


Link to post
Share on other sites
anim    589

- if you keep objects in alembics split per material, you will have them as different packed alembic primitives so you can easily assign materials to them

 

- if you however need to assign materials on polygonal subselections of packed primitives you may want to have a look at material stylesheets

https://www.sidefx.com/index.php?option=com_content&task=view&id=3186&Itemid=412

 

- or you can as well unpack, assign primitive level materials and save as bgeo's then load as packed disc primitives copy on your points (or you can as well instance files directly using instancefile attribute), randomize pahs and render. . 

You'll still need to have all shaders in your scene and set Mantra/Declare Materials to Save All SHOPS since bgeos will just contain paths to the shaders

Edited by anim

Share this post


Link to post
Share on other sites
Mzigaib    18

I want to avoid to convert alembics as bgeos I want to use alembics directly because there are a lot of assets to be done and I want to spare the time, labor and disk space.

Wouldn't splinting be the same as use the alembic directly? Without having to load as packed?

As for stylesheets I can use them as long I have them separated right?

Share this post


Link to post
Share on other sites
anim    589

- having alembics that contain separate objects per material will allow to load them as packed and still be able to assign materials to individual objects as they will be separate packed alembics, then you can copy them and enjoy the power of packed primitives

 

- not sure what you mean by separated, but you should be able to use stylesheets to set rules for material assignments within packed primitives without unpacking them, but I'm not sure if it will still be as efficient as having materials assigned before copying

Share this post


Link to post
Share on other sites
Mzigaib    18

Cool! I'll try that, I really though so far that instancing was the best way to handle huge amount of geo.

 

I just don't how to set the the "intrinsic:abcframe" attribute I tried on a wrangle 'setprimintrinsic(geoself(),"abcframe",@primnum,@timeoffset,"set")' but it doesn't seem to be working.

 

Cheers!

Edited by Mzigaib

Share this post


Link to post
Share on other sites
anim    589

copying packed primitives is a form of instancing

if they are packed alembics then you can use wrangle to set their intrinsic abcframe

 

but not if you are using point instancing, what advantage you have with traditional instancing you are not getting with packed?

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

×