Exporting alembic with instances is bigger file size?!

   3555   7   1
User Avatar
Member
10 posts
Joined: May 2022
Offline
Hello!

I'm trying to export an alembic file of an animation. I'm copying a cube onto about 200k points, so obviously instancing should help a lot here. But I'm really confused because when I don't used instancing, the file renders very fast. But if instancing is used then it takes a really long time per frame (probably minutes), and the file size is bigger?!

I have attached a test scene with showing the problem. There are two alembic outputs inside the geo node, and the only difference is that the copy to points node has "Pack and Instance" enabled in the right side tree.

Attachments:
test_alembic_instances.hip (91.0 KB)

User Avatar
Member
46 posts
Joined: Feb. 2017
Offline
Yes, it's not instancing and size bigger because 1 mesh vs many separate meshes.
Alembic ROP - Geometry - Packed transform - Merge with parent transform. Works but I do more tests
Edited by tachbek - May 31, 2022 12:40:21
User Avatar
Member
335 posts
Joined: Nov. 2013
Offline
I can't look at your file right now, but if you mean a cube with only eight vertices it may well be that the overhead of an instance is greater than the small amount needed for the cube. Likewise processing an instance will almost certainly incur more overhead than processing an additional six faces in a mesh. A simple test would be to subdivide the cube more and more and see what point instancing starts to yield a benefit. If it never does then yeah something is probably broken.
User Avatar
Member
46 posts
Joined: Feb. 2017
Offline
Update. I use Lop scene tree for visualization.
  • Alembic ROP - Geometry - Packed transform - Deform Geometry
    The packed primitive’s transform will be baked in to the resulting shape node’s geometry.
    = Simply, separate mesh for each copy

  • Alembic ROP - Geometry - Packed transform - Transform Geometry
    A transform node will be created above the packed geometry.
    = Creating instances + save each transform in own created parent "null object"

  • Alembic ROP - Geometry - Packed transform - Merge with parent transform
    The packed primitive’s transform will be baked in to the parent transform node.
    = Creating instances + save each transform in own parent (instead of creating as in "Transform Geometry"), but if you don't build you own hierarchy it's leads to problems, and in this setup you loose objects transform.

  • Don't pack - all geometry is a single object

Use Transform Geometry and try more complex mesh for testings. Boxes more efficient don't pack at all (if you use not many attributes) because each copy need to create reference and transform (and more). And this is bigger then only save single mesh with many boxes. Or roughly, the instance data requirements are bigger than box (as part of single mesh) without attributes
Edited by tachbek - May 31, 2022 15:28:26

Attachments:
Screenshot from 2022-05-31 20-04-28.png (6.7 KB)
Screenshot from 2022-05-31 20-07-42.png (12.2 KB)
Screenshot from 2022-05-31 20-12-04.png (7.2 KB)
Screenshot from 2022-05-31 20-14-11.png (2.9 KB)

User Avatar
Member
10 posts
Joined: May 2022
Offline
tachbek
Use Transform Geometry and try more complex mesh for testings. Boxes more efficient don't pack at all (if you use not many attributes) because each copy need to create reference and transform (and more). And this is bigger then only save single mesh with many boxes. Or roughly, the instance data requirements are bigger than box (as part of single mesh) without attributes

Okay. Thank you a lot for the testing!!
I think I will have to go for just frame-by-frame geo. Seems to be the only to work properly also in unreal engine which I'm trying to export to.
User Avatar
Member
46 posts
Joined: Feb. 2017
Offline
midorisalt
I think I will have to go for just frame-by-frame geo. Seems to be the only to work properly also in unreal engine which I'm trying to export to.

Good idea to use unreal instances, and bake only point cloud.
Google "Houdini unreal instancing" good starting point.

Also maybe check "Houdini Labs VAT"
User Avatar
Member
10 posts
Joined: May 2022
Offline
tachbek
Also maybe check "Houdini Labs VAT"

This looks super promising.

Edit: It is indeed super awesome. Great performance!!
Edited by midorisalt - June 1, 2022 13:12:25
User Avatar
Staff
329 posts
Joined: July 2005
Offline
midorisalt
I have attached a test scene with showing the problem. There are two alembic outputs inside the geo node, and the only difference is that the copy to points node has "Pack and Instance" enabled in the right side tree.

Instancing is not being used in your example as the Alembic ROP is set to export deforming geometry. You can easily check if instancing is used with Packed Alembic primitives by inspecting the "abcsourcepath" intrinsic.

The structure of Alembic archives is significant. It is good practice to explicitly specify where you want everything to be placed in an Alembic archive. Attached is an updated example that uses instancing and structures the scene so each box has a separate Alembic transform node associated with it.

Alembic archives have a lot of overhead when using instancing. For such small objects like a box, the overhead will significantly outweigh any possible benefit.

Attachments:
test_alembic_instances-2.hip (99.1 KB)

  • Quick Links