Houdini Engine for Unreal
|
Houdini Engine for Unreal supports both the Input and Output of Landscapes. Version 2 also has the added ability to output landscapes to the World Composition system.
Landscapes can be imported to Houdini by using a Landscape Inputs, or a World Outliner Inputs.
The landscape's height and layer data will be available in Houdini as a heightfield (or as a point cloud or mesh if you selected the corresponding option in a world input).
If the landscape is exported as a heightfield, all the landscape layers will be available as masks on the heightfield node.
The input's landscape's tags are imported as primitive attributes, prefixed with unreal_tag_, followed by the tag's name. Theses attributes will be used to recreate the imported tags when outputting the heightfield back to Unreal.
Landscapes can be generated by your HDA if it display node contains Heightfield data.
Heightfield nodes will automatically be picked up and converted to a Landscape by the plug-in. The height buffer will be used to control the landscape geometry, and all the additional buffers generated by heightfield nodes (mask, mesa, cliffs...) will be available on the landscape as Layers.
By default, Landscape Actors will be created for each Heightfield, but you can use the unreal_landscape_tile_actor_type (unreal_landscape_streaming_proxy in v1) primitive / detail int attribute with its value set to 1, in order to tell the plugin that it should create LandscapeStreamingProxies and Shared LandscapeActor instead.
If your Heightfield has a mask called visibility, then the plug-in will use it for the landscape's visibility layer, used to create landscape holes.
Unreal requires all landscape layer to be saved to a file, by default the generated layers for a landscape will be saved in the HoudiniEngine/Temp folder in the content browser. When saving your level, make sure that these landscape layer asset are saved as well.
In version 2, you have the ability to specify/assign an existing landscape layer info object by using the unreal_landscape_layer_info string attribute, with the value set to an existing layer info asset's reference.
If the heightfield has unreal_tag_X primitive attributes, these attributes' values will be used for the resulting landscape Actor's Tags.
If the heightfield has unreal_uproperty_X detail attributes, it will be applied to Tile Actors as well Shared Landscape actors. If the height field has point or primitive unreal_uproperty_X attributes, it will only be applied to the respective landscape tile actor. Point/primitive attributes has to be on the heightfield primitive in Houdini. UProperty attributes on non-heightfield primitives will be ignored.
As Unreal uses 16-bits integers for Landscapes, and Houdini uses 32-bits floats to represent the height values, the data needs to be converted, resulting in a small precision loss when creating Landscape from a Heightfield.
By default, Landscape components generated by Houdini Engine will use 3/4 of the available 16 bits range for conversion. This allows you to still sculpt the landscape past its min/max values afterwards in Unreal.
If you would rather use maximum precision for the data conversion, simply activate the Marshalling Landscapes Use Full Resolution setting in the Geometry Marshalling section of the Settings.
As an example, a 4km high landscape will have a precision (on the Z axis) of 8.13 cm by default, or 6.10 cm if that option is activated.
The plugin can also be configured to use the default unreal conversion values in the plugin settings, by enabling the **Use default Unreal Scaling" option under *Geometry Marshalling*. This will likely result in a precision loss during the conversion, and may clip the heightfield values if they are too high, but will create landscape that have a "standard" scale factor on the Z axis.
When converting heightfield data to landscapes, you have the ability to specify the min and max values used for the conversion by adding the unreal_landscape_layer_min and unreal_landscape_layer_max float attributes. This will work on the height data, but also on any masks that will be converted to a landscape layer. This is especially usefull when outputing tiled landscapes, in order to ensure that all tiles are converted in the same manner.
Heightfield masks are converted from houdini's 32-bits float to Unreal 8-bits unsigned int. Values are converted from Houdini's [min, max] to [0, 255] in UE. If the unreal_unit_landscape_layer primitive/detail integer attribute is set to 1 for a mask, then the plugin will convert the mask to a landscape layer by using the [0 1] range instead of the mask's [min max] values.
By default, heightfield masks will be converted to weight-blended landscape layers. If you want some of the heightfield masks to be exported to Unreal as non weight-blended layers, you must add a Primitive String attribute to your heightfield, named unreal_landscape_layer_nonweightblended. Set this attribute values to the names of the masks separated by spaces (ie: "mask water debris"). Alternatively, each heightfield mask can have a Primitive Int attribute named unreal_landscape_layer_noweightblend which can be used to explicitly set the No Weight Blend property to unchecked (0) or checked (1). Note that unreal_landscape_layer_noweightblend takes precedence over unreal_landscape_layer_nonweightblended.
Unreal Engine requires very specific sizes for its landscapes, as they are broken up in sections and components for LOD / optimisation purposes. The recommanded sizes are:
If your heightfield data doesn't match one of these recommended size, Houdini Engine will automatically resample the data so that the generated landscapes fit the size requirements. This may possibly causes issues due to the unwanted conversion, and will easily happen when splitting Heightfields to tiles. Additionally, using non-standard size will result in an excessive amount of components used resulting in severe performance degradation. It is highly recommended that you ensure the generated tiles's volume size match the sizes recommended by Epic in their Landscape Technical Guide.
Upon cook, the generated landscape's transform will be automatically set up so that its dimension, altitude, scale and position in Unreal are the same as in Houdini.
Landscapes can be transformed from both within Houdini as well as within the Unreal Editor itself. Landscape actors are transformed relative to their parent actors.
Splitting heightfields into tiles in Houdini can be done using the Heightfield Tile Split SOP node. By default, each Landscape tile will be imported into UE as a standalone LandscapeActor. It is highly recommended to import tiled landscapes as streaming proxies by setting the unreal_landscape_tile_actor_type attribute on the heightfield primitives (in Houdini) to 1. Refer to Output Attributes for more information.
As Landscapes cannot be made component of another Actor, the generated landscape will not be listed in the component list of your Houdini Asset, but will be listed as a child of your Houdini Asset in the World Outliner. It will also appear in the details panel of the asset, under the Houdini Generated Meshes section, along with its landscape material and hole material.
This section will give you the option to override the landscape's main and hole materials.
You can automatically assign an existing material to one of these by using the unreal_material and unreal_hole_material attributes. In version 2, it is also possible to override the physical material via the unreal_physical_material attribute.
You can also automatically generate material instances for the landscape material and hole material by using the unreal_material_instance and unreal_material_hole_instance attributes. For more details on this, see Material Instances.
Even if it is not listed in the Houdini Asset's components, generated Landscape Actors or Streaming proxies will still remained "linked" to it. Recooking the asset will "overwrite" the generated landscapes, and deleting the asset will also delete its landscape as well.
To separate the generated landscape from its Houdini asset, you just need to "bake" it by using the corresponding button in the details panel.
World Composition support has been added to Version 2, and is supported when baking landscapes generated from tiled heightfields.
When baking tiled landscapes in a world with world composition enabled, the plugin will automatically create or update the levels needed for the tiles. Please note that when cooking the HDA, the generated landscape tiles will remain attached to the HDA Actor to provide visual feedback and fast iteration.
The following attributes can be used on the HF to control World Composition baking:
When generating landscape streaming proxies, the unreal_landscape_shared_actor_name primitive, int attribute can be used to specify the name of the common, shared landscape actor that controls all the streaming proxies.
When mixing heightfield tiles and instancers/meshes in the same hda, the unreal_level_path attribute can be used to control the sub-levels that will be used for baking the landscapes, but also for the instancers and meshes as well. In order to do that properly, you'll likely need to split the instancers, for example, using the tile number of the tile they were scattered on. To do so:
If an Landscape with edit layers is used as an HDA input, the landscape will import its (final) heightfield and paint layers as usual as well as import the heightfields of the individual edit layers using the layer names, prefixed by landscapelayer_.
The incoming landscape layers can then be selectively used to generate a new a (additive) landscape layer.
Heightfield data can alternatively be drawn to editable landscape layers on existing landscapes.
Heightfield / landscape output can operate two modes, which is controlled with the unreal_landscape_output_mode attribute.
Value | Name | Description |
---|---|---|
0 (default) | Generate Landscape | Generate a new landscape, based on geometry attributes. |
1 | Modify Layer | Modify an edit layer on an existing landscape. |
Both Generate Landscape and Modify Layer mode supports outputting of landscape edit layers. Whenever the unreal_landscape_editlayer_name attribute is present, in Generate Landscape mode, the Enable Edit Layers property will be enabled on the generated landscape. When operating in Modify Layer mode and the target landscape does not have the Enable Edit Layers property enabled when in Modify Layer mode, the heightfield output will be ignored.
The target landscape (actor) is set by name using the unreal_landscape_editlayer_target (string prim) attribute. If the landscape name is set to Input0 (default), the first input landscape will be used, Input1 the second, and so on (this supports input landscapes as World Outliner inputs or Landscape input).
The name of the destination Edit Layer is set with the unreal_landscape_editlayer_name (string prim) attribute (default value is HE_Layer). If the target landscape edit layer does not exist, a new edit layer will be added (at the top).
The layer can also be programmatically placed after (above) another layer by specifying another layer name with the unreal_landscape_editlayer_after (string prim) attribute.
When outputting edit layers each layer has to be identified as either a 'Base' layer (0) or an 'Additive' (1) layer by way of the unreal_landscape_editlayer_type attribute.
Value | Name | Description |
---|---|---|
0 (default) | Base Layer | Fits values across data range for optimal resolution. |
1 | Additive Layer | Centers values around zero. |
Generally only the base edit layer should be of type 0 and all the on top of it should be set to additive.
The 'subtractive' settings on paint layers (in Unreal) can be set to unchecked (0) or checked (1) by the unreal_landscape_editlayer_subtractive (int prim) attribute.
By default, in Modify Mode, the landscape layer output will only draw (replace) values in region occupied by the output layer. Any height or paint layer data that falls outside this region will be left untouched. The height/paint layers on the target edit layer can be fully cleared (before drawing starts) by setting the unreal_landscape_editlayer_clear (int prim) attribute to 1. When outputting a tiled landscape, it is recommended to leave this value at 0 (default).