The plug-in allows to instance generated or existing geometry easily.
The point about this is to make use of Houdini's procedural workflow in game development. One artist creates an configurable asset which has a ton of settings and then the level artists can quickly create variations of the asset in Unity by tweaking the exposed settings without having to go back to the 3D software, alter it by hand and export it again. Houdini Fx, UE4, Unity, Moscow, Russia. 1,193 likes 11 talking about this. Houdini for GameDev. Procedural creation an environment for games and integration this in Unity and Unreal Engine.
- Houdini Engine for Unity is a Unity plug-in that allows deep integration of Houdini technology into Unity through the use of Houdini Engine. This plug-in brings Houdini's powerful and flexible procedural workflow into Unity through Houdini Digital Assets. Artists can interactively adjust the asset's parameters inside Unity, and use Unity.
- Houdini Engine for Unity 3D and Unreal Engine 4 Create Houdini Digital Assets in a Production proven way for Games How to use Houdini to create Procedural models to save you time during you game productions How to Set up HDA's in Unity and Unreal so you procedurally generate Collision Meshes, Materials, UVs, and more!
Three types of instancing are supported:
This presentation was previously shown during Unity's Artist Digital Developer Day 2020In this session we will be looking at how Houdini Engine can help ga.
If wanting to instance generated geometry (by the HDA), then it is recommended to use Packed Primitives. Instead if wanting to use instances of already existing Unity geoemetry (prefabs), then it is recommended to use Point Cloud Instancing.
The following shows a cube in Unity being instanced:
Packed primitives are essentially primitives that live inside of SOPs and contain one or more primitives with their own transforms. Packed primitives can contain other packed primitives allowing to have a full transform hierarchy completely inside of SOPs. The benefit of using packed primitives is that only one copy of the geometry is stored in memory for all the instances.
In Unity, a packed primitive output (GameObject) is instantiated such that its mesh data is shared, rather than copied, for each instance. Also, GPU Instancing is automatically enabled on the generated Materials to allow for batched rendering.
A simple way to use this method is to use a Copy To Points SOP with the Pack and Instance option enabled. You also have the option to use Pack Geometry Before Merging on Inputs.
Instancers can also be created using the instance Object node. While this is a valid instancing method, it is recommended to use Packed Primitives for instancing generated output.
The above shows input field for an object instancer. If multiple objects are specified, they will be treated as a single object and instanced.
Attibute Instancers
Objects within an HDA can be instanced via the special instance point attribute in the instancer Object node.
The simplest way to instance existing Unity prefabs or assets (e.g. FBX models) through an HDA is by generating only points in a geometry (i.e. no primitives), and using the special unity_instance attribute. This point or detail attribute should be string-type, and contain the path in Unity project of the asset to instance.
Path should be relative to the project Assets folder (e.g. 'Assets/Prefabs/Hero.prefab'). Note that it will be faster to load prefab assets from the Resources/ folder, than from the Assets/ folder. Assets placed in Resources/ folder can be specified via a relative path from Assets/, Resources/, or simply its file name without extension.
Example of supported paths for assets placed in Resources/ folder:
- Assets/Resources/cube.prefab
- Resources/cube.prefab
- cube
Additionally, a MeshCollider can be set for each instance by using the collision_geo string attribute. This attribute value should point to a Unity mesh asset in the Assets/ directory. If there is an existing collider on the instance object, it will be replaced.
It is recommended to use orient attribute for specifying the orientation of the instance. It might be necessary to remove the N attribute for proper orientation as well.
You can expose the Object Path Input Parameter allowing to override the geometry being instanced via Inputs.
For attribute instancers, if more than 1 GameObject is added to the input list, they will be randomly used for instancing. This provides automatic variety for instances.
The default convention for the names of the gameobjects for instances is: geoname_Instanceindex. This would produce something like 'Cube_Instance2' for the second instance of geo node named 'Cube'. To override this behaviour, a string attribute named instance_prefix can be used to set the prefix part of the name. In the example, this would replace the geo node name 'Cube' with the value in the instance_prefix attribute. The attribute must be Detail or Point owned.
Single instance prefix using Detail attributes
Houdini Indie
When using a Detail attribute to set the instance prefix, all instances will have the same prefix.
Multiple instance prefixes using Point attributes
Using Point attribute, each instance name prefix can be set individually.
A Houdini Asset is created when loading a HDA file into an Unity project. This is done by either dragging & dropping a HDA into the Unity Hierarchy or Scene view, or via the menu command HoudiniEngine > Load Houdini Digital Asset.
When a HDA is loaded in Unity, the plug-in will load the HDA into the default Houdini Engine session, automatically cook it, and create a GameObject hierarchy containing relevant HDA meta information and the cooked output.
Files generated by the asset for persistent storage as required by Unity (i.e. Materials, Textures, Meshes) are stored in the Assets/HoudiniEngineAssetCache/Working folder. Each asset's data is contained in a subfolder with the same name as the asset, possibly with an integer at the end to produce a unique folder name. Note that when an asset is deleted in the Scene, its working folder will also be removed, unless the asset was saved in a Scene. As there is currently no way in Unity to check if an asset is used in other Scenes, it is left up to the user to decided whether to delete the asset's working folder after removing it from a saved Scene.
Note that the asset will be imported using relative path to the Unity project Assets folder.
Note that using the built-in duplicate or copy/paste mechanisms in Unity on the asset will not work properly. Instead use the Duplicate Asset button to duplicate the asset manually. See below.
The following shows the generated GameObject hierarchy for the EvergreenGenerator.otl asset.
It is important to understand what each of the items are in this hierarchy. This hierarchy scheme is used for all representations of an asset in the Unity scene. There is a clear separation between plug-in data and the final outputs, allowing for flexible workflows where the plug-in is not needed or available.
Root GameObject - The root GameObject (EvergreenGenerator) is the parent for all generated GameObjects, and is used primarily to group the generated children under one transform. It contains the HEU_HoudiniAssetRoot component which is a lightweight script used to display the custom Inspector UI, as well as to activate any custom tools in the Scene view such as for the Curve Editor.
Asset Metadata (HDA_Data) - The HDA_Data child GameObject contains the single script component HEU_HoudiniAsset. This component is the main script for all plug-in interaction, and contains all the metadata and state information about the asset. In most cases, the user does not (and should not) modify this GameObject or its values in any way, though viewing its data could be helpful in understanding the structure of the asset, and troubleshooting issues with cooking and output. One key design feature of this component is that it is tagged as EditorOnly. This is a special Unity tag that automatically removes this GameObject and its stored data when building the project. This means that HEU_HoudiniAsset GameObjects are stripped from builds, and not available at runtime. Since the plug-in does not function at runtime, this tag will ensure the plug-in metadata is removed from builds and therefore reduces memory overhead. This also eliminates the need for baking. Further information about this script will be provided in the future.
Output GameObjects - All other GameObjects in the hierarchy are considered part of the output generated by cooking the asset. These usually contain the common Unity components such as a Mesh Renderer, Mesh Filter, Mesh Collider, and Materials. It is guaranteed by design that there will be no plug-in-specific components on these final output GameObjects. In fact, by simply copying & pasting these GameObjects and moving them out of the hierarchy, these will not have any dependency or linkage to the plug-in, and therefore can exist without the plug-in.
This shows the Inspector UI for the Houdini asset after it has been loaded and cooked. Note that this is a dynamic UI that displays items based on the type of asset, its display and editable nodes, and Parameters.
Generate
The Generate section contains functionality for loading and modifying the asset.
Rebuild Asset - Forces the asset to be reloaded in the Houdini Engine session, as well as the Unity scene. This would be the same action as manually deleting the asset and loading it. The latest parameter values are saved and reapplied on the asset after loading. Input node objects are reconnected as long as they are still available in the Unity scene. Material overrides will be reset though. Must use this to rebuild the asset if its HDA file was changed and saved in Houdini. Also useful if asset is in error state. Note that this will destroy and re-create the HDA_Data GameObject, all of the output GameObjects, and all input overrides, but will retain the root HEU_HoudiniAssetRoot GameObject, callback events, as well as any scripts assigned to it.
Recook Asset - Uploads only changed parameters, then forces the asset to be cooked in Houdini. Outputs (meshes, materials, etc.) are then re-generated. If the HDA file had been changed and resaved in Houdini, it is recommended to use Rebuild Asset instead.
Note that by default, when parameters change via the UI, the asset will automatically upload only the parameters that had changed and recook. Then only changed outputs are regenerated. This is done to speed up the cooking process. This can be turned off in the HDA Options section via the Auto-Cook On Parameter Change checkbox. If that is disabled, then the Recook Asset button allows the user to invoke the cooking process manually, which will upload the changed parameter values and recook everything. Turning off auto-cook can help in situations when changing a lot of parameters and not wanting to wait for cooking to finish.
Keep Only Output - Removes all Houdini Engine data which includes the HEU_HoudiniAssetRoot and HEU_HoudiniAsset scripts. It also destroys the loaded asset in the Houdini Engine session. It is similar to the other Bake functions, except that this produces no duplicate GameObjects. It is useful in cases where only one output of an asset is needed in a scene and the HDA no longer necessary.
Duplicate Asset - This is the only recommended way to duplicate or copy/paste an instantiated asset. This makes sure to instantiate a copy of the asset and its state correctly in the Houdini session, as well as all the inputs, overrides, etc.
Reset Parameters - This resets the parameters to their default saved values in the HDA. Resets all curve modifications and input node changes as well.
Bake
The Bake section contains functionality for generating copies of the output, as well as updating them. Updating previously baked outputs is a new feature in Version 2.
Bake GameObject - Creates a copy of the output in the Scene. The output will not contain any plug-in-specific data or components. Note that if the output has several GameObjects, there will be a root (empty) GameObject in order to retain the grouping. Otherwise if the output is a single GameObject, then the hierarchy will be flattened and only a single GameObject with no parent will be produced.
Bake Prefab - Creates a Prefab of the output in the Project. The Prefab is stored in Assets/HoudiniEngineAssetCache/Baked folder, under a new subfolder with the same name as the asset. If the subfolder name already exists, a unique name will be used containing an integer at the end. The subfolder will also contain Materials and Meshes produced and written to file storage, under their respective subfolders.
Bake Update - Updates previously baked out GameObjects and Prefabs. It should also work on any GameObject, even if it wasn't baked out before. It essentially copies the output GameObjects' components onto the target GameObjects. This is useful when wanting to simply update the output but retain all other data (i.e. a wheel that is already attached and positioned to a car). This accepts a dynamic list of target GameObjects and requires at least 1 item in the list. The list can contain any mix of standalone GameObjects and Prefabs. Note that if there are multiple GameObjects as part of the output, they will be matched by each GameObject's name. Therefore it is highly recommended not to change the output GameObject names if planning to use Bake Update on them.
Events
This section allows callbacks to be attached to each of the Generate and Bake functions after they have been invoked. This is useful for executing custom code and setup after generating, cooking, or baking. For example, after baking a new platform from an HDA, a custom script can setup the platform for the navigation system. See HoudiniEngineUnity/Scripts/Tests/HEU_AssetEventReceiverTest.cs for examples of callback functions.
HDA Options
Houdini For Unity
Contains options for controlling the asset cook behaviour.
Auto-Cook On Parameter Change - Automatically cook if any parameter has changed. Turn this off and cook manually via Recook Asset if cooking takes too long.
Push Transform To Houdini - Update the asset in the Houdini Engine session with the transform values in Unity. For example, if the user moves the asset root, this position change is reflected in Houdini.
Transform Change Triggers Cooks - If the transform in Unity changes, then recook the asset automatically. This is useful if the transform is used in the node network for calculating final output.
Cooking Triggers Downstream Cooks - When the asset is cooked, will trigger a cook on other assets for which the given asset is an input.
Generate UVs - Whether to generate UVs after cooking in Unity. This overrides the first UV set from Houdini.
Generate Tangents - Whether to generate tangents after cooking in Unity.
Generate Normals - Whether to generate normals after cooking in Unity.
7 zip for mac os. Generate Mesh Using Points - Whether to use Points as (shared) vertices instead of splitting vertices (default behavior). While this reduces vertex count, note that only Point attributes will be used. Therefore make sure that normals, tangents, colors, UVs, etc are owned by Points.
Use LOD Groups - Whether to generate LOD Group with level of detail meshes for the output (see Level of Detail). Disabling this will merge all geometry groups. Only supported on Unity 2017.1 and newer.
Ignore NonDisplay Nodes - If true, then only the final display geometry will be generated, and all others ignored.
Split Geos By Groups - Split the output geometry into separate game objects by group. Each group will then produce a gameobject with mesh and other components. Note that this feature is deprecated, and no longer supported. It is recommended to be only used for simple cases.
Save HDA Preset - Save the asset's parameter preset to a file. This file will contain the current parameter preset, as well as the parameter presets of all curves in the asset. This file can be loaded by the Load HDA Preset button. It can be used to clone the asset's parameter values across scenes and projects, as well as managed by source control.
Load HDA Preset - Load a previously saved parameter preset file into this asset, then cook it with those values. The preset file must have been saved out by an asset that was instantiated by the same HDA as this asset.
Reset Material Overrides - Reset all material overrides on this asset. See Material Overrides.
Asset Parameters
Contains all the exposed parameters on the asset. This is a dynamically created section that displays each parameters based on its type. Most parameters are currently supported, except Ramps which will be fully supported in the future.