Speed of Houdini Engine tools is surprisingly slow

   2516   6   2
User Avatar
Member
6 posts
Joined: Oct. 2022
Offline
Hello! I am in the process of making some Houdini Engine tools for Unreal, and I am surprised at how slow it is.

I made a simple "passthrough" HDA that just takes an input and returns it at the output.
If I just drag and drop some fairly simple asset, like a simple little StaticMesh with a few thousand points, it locks up my Unreal engine for a full minute. Recooking is also very slow and freezes it for a full 30 seconds or more.

Is there anything I can look into, to speed this up? At this rate it would be very hard to make an interactive tool and iterate by tweaking parameters as each slider change would lock up UE and become frustrating very quickly.

I should mention that if I make an HDA which does not take any inputs, but does return a mesh (100% procedurally created in Houdini), HoudiniEngine is really quite fast. It seems like the process of Unreal sending geometry to Houdini is where the slowdown occurs?
User Avatar
Member
118 posts
Joined: Dec. 2013
Offline
Could you post the hda? Just passing geometry through the hda should not lock up UE or take a long time recooking. In the past I have created hda's that process geometry and process in a few seconds.
User Avatar
Member
6 posts
Joined: Oct. 2022
Offline
Hey GlenD, Thanks again for helping me in yet another post

I've dug around a bit and realized the problem is caused by a very large shader assigned to the geometry. It creates thousands of parameters on the geometry, which I assume is what lags the import/export process.

I'm wondering if there's a way to not pass these through, and to only pass material assignment information pass in, which will reference the existing shaders in the scene instead (rather than baking out brand-new duplicates of the shaders when bake is clicked in Unreal).

Attachments:
screenshot_2023-02-08_15-56-01.png (105.1 KB)

User Avatar
Member
118 posts
Joined: Dec. 2013
Offline
Are you getting material data from Unreal or from Houdini and adding it to a shader in Unreal?

If you are getting the shader information from Houdini what is the data you are getting? Could these attributes be set as a separate uv channel attribute and then picked up in the Unreal shader as a TexCoord 2?

During production of Destroy All Humans we used this technique to control the size of the flame, where it was activated and how intense it was coming out of a window. Instead of setting attributes on a shader, we baked the attributes to the uv3 channel and picked it up in the Unreal shader using the TexCoord.

Do you need to actually calculate a shader in HEngine for Unreal or can you just set the data? What data are trying to get? We may be able to find a workaround that could speed up the process. I'm not sure if that is the example you need, I hope that helps.
User Avatar
Member
6 posts
Joined: Oct. 2022
Offline
This is all data that Houdini Engine seems to create automatically without my control.. My HDA is a simple pass-through node. It's a blank node with the input connected directly to the output.

The assets that I am plugging into this HDA in Unreal are simple Unreal Assets - StaticMeshes with some material assigned. It seems like, for whatever reason, every single parameter that is defined in the Unreal material is created as a unique per-primitive attribute when received by Houdini Engine.

Attachments:
screenshot_2023-02-08_10-43-39.png (20.5 KB)

User Avatar
Member
118 posts
Joined: Dec. 2013
Offline
Does this happen with other HDA's you have created or only the ones processing assets inside of Unreal? Is the HDA baking Vertex colors from Houdini or painting the colors in Unreal? We currently have a vertex color baker that processes in about a second and it bakes the vertex color between 20-50 pieces of geometry. It would be interesting to see your approach.
User Avatar
Staff
534 posts
Joined: Sept. 2016
Offline
Hi,

You've likely hit a worst case scenario (150k polygons, and a material with 1200+ exposed parameters... that's a lot of attributes).

Tomorrow's build of the plugin has a new checkbox on inputs, "Export Material Parameters" that when disabled, will prevent the plugin from sending all those material parameters as attributes.

This should drastically improve input creation time (and memory usage on the H side) on your end.

We're also currently working on additional Houdini Engine optimizations (HAPI) with attribute creation, that should also significantly increase data marshalling times (in general, not just for this specific material parameter case).
  • Quick Links