| On this page |
You've created a terrain and now you want to scatter rocks and objects across its surface, apply different textures to the landscape’s natural features, and render it. To further process the terrain it’s necessary to convert it because in Copernicus, heightfields are based on images. The images contain information about height, masks, and colors, and are then transferred to a volumetric grid. Like its SOP-based counterpart, the COP terrain also consists of different layers.
When you create a COP-based terrain and return to the SOP level, you might ask why a conversion process is necessary at all? You can see the terrain in SOPs, but the problem is that only you get the height information from the COP network. Other layers like masks or colors are missing.
To create a terrain that contains the entire range of Copernicus layers, you have specific nodes for SOPs and Solaris.
COP to SOP ¶
To create a terrain object for Houdini’s SOP space, there’s the HeightField to Geometry COP. This node expects at least a
height layer from one the previous nodes. By default, the node also adds a Cd color layer. To avoid this, turn off Conversion ▸ Tint. Another interesting option is that you can modify the terrain’s global Height Scale and Height Offset along the Y axis.
Note
If the Height Scale and Height Offset parameters don’t work, please check if one of the previous nodes has its orange 3D Output flag turned on. To check this quickly, look in the viewport if the Displaying the 3D Output flag caption is displayed. Please see 3D Output flag workflow for more information.
If you've already defined custom colors, connect the appropriate node to the geometry node’s color input. This also applies to the mask input. There’s also a layers input where you can connect custom layers.
It’s very common in Houdini to terminate a network with a Null COP. Nulls always have to top position in node lists. This makes it easier to access the output of a network.
On the SOP level you’ll now see the converted heightfield with colors and all available layers. If your COP networks contains multiple outputs, you can point the COP Network SOP to specific node - typically a Null COP:
-
Turn on Use External COP
-
Let the COP Path parameter point to the Null you want to see in viewport
Layers ¶
You can also connect custom layers or masks to the visualize node’s layer input. If you want to preserve masks for further processing, for example on the SOP level, please make sure that they're of type mono.
it’s also possible to connect more than one layer by combining those with a Cable Pack COP. In such a case you typically have a problem with names. Let’s say you have created two nice masks. The first mask comes from a
HeightField Mask by Feature COP and should appear as
snow. The second mask is the sediment output of a Heightfield Erode COP and here you want to keep the name.
Names ¶
The sediment layer in this example doesn’t require a new name. However, to turn the mask into a snow layer, you have to consider a couple of things.
Start with a Cable Rename COP and connect its input with the output of the feature mask. On the rename node, set Filters to
1 and turn on Filter 1. When you expand the Filter 1 section, you can enter names for the original (From) layer and the target (To) layer.
-
For To, type
snow. -
For From, you have to find out the layer’s actual name. To see the name, open the Geometry Spreadsheet pane and click the
Primitives icon. Under the name column, you can find a
noiseentry. That’s what you have to add to the From parameter. You’ll now seesnowinstead ofnoisein the spreadsheet.
Packing and export ¶
Both layers should be exported separately. For this purpose, add a Cable Pack COP. Connect the rename node’s output with the
input1 pin of the pack operator. This will create an input2 pin that is linked with the erode node’s sediment output. In fact, the order is not relevant and you can also swap the input streams.
On the pack node you can now see two Name fields. Click Set Fields from Inputs to add the layers to the empty fields. You should now see snow and sediment.
To bake the layers to the terrain, connect the pack node’s cable output with the HeightField Visualize COP’s (= heightfieldtogeo1) layers input. The Geometry Spreadsheet’s Primitive section will show the additional layers.
Heightfield to polygons ¶
On the SOP level, you can also convert the terrain into actual polygons when you connect a Convert HeightField SOP to the output of the COP network. If your viewport remains empty, make sure that the Copernicus network contains a HeightField to Geometry COP.
COP to LOP ¶
You can also export a terrain from COP space to Solaris/LOPs. This workflow uses the Preview Material COP.
-
Lay down a Preview Material COP.
-
Connect its
geoandheightinputs with an output that also contains height information. -
Then, connect
basecolorwith an output that contains color information. -
As with SOPs, we recommend terminating the network with a Null COP. You can later point the COP Network SOP to this null.
The preview material turns the terrain into a polygon object and authors a shop_materialpath attribute to its primitives. As the attribute name indicates, shop_materialpath contains a path to a material definition that contains the terrain’s colors. The Solaris SOP import nodes are capable of reading the attribute and applying the material. However, the method for reading the attribute differs from node to node.
Scene Import (All) ¶
On the stage, create a Scene Import All LOP. The advantage with this node is that it directly applies the material that’s stored in
shop_materialpath. What you get is a ready-to-render terrain.
SOP Create LOP ¶
On the stage, create a SOP Create LOP and double-click it to dive inside. There, create an
Object Merge SOP and let Object 1 point to the COP Network SOP with the terrain. What you get on the stage is a flat and colorless plane.
This state indicates that the material that’s stored in shop_materialpath does not only contain colors, but also the entire height information. To bring in the material, open the SOP Create LOP’s Material tab and click Auto-fill Materials. This method creates three parameters with paths and also links the heightfield geometry to the material. You should now see the colored terrain in the viewport.
Note that the SOP Create LOP doesn’t update the material if you change something. In this case you have to relink the material.
SOP Import LOP ¶
On the stage, create a SOP Import LOP. Use the SOP Path parameter to point the importer to the node with terrain - the COP Network SOP or a connected null. As with the SOP Create LOP, you’ll only get a flat plane. The importer, however, doesn’t provide any functions for applying materials.
-
Add a
Material Library LOP and connect its input with the output of the SOP Import LOP. By default, there’s one placeholder for a material definition.
-
For Material VOP, enter the path to the preview material inside the COP network. This, however, is not deep enough and you must go further down until you reach
COP_preview_mat.A typical path is
../../obj/geo1/copnet1/previewmaterial1/attach_shader/coppreviewmaterial1/matnet1/COP_preview_mat/ -
For Geometry Path, enter the path to the terrain mesh, for example
/sopimport1/mesh_0.
HeightField to Mono COP ¶
You can also extract a terrain’s height values and convert it into a grayscale mono layer. The usage is straightforward:
-
Connect a heightfield node with height information to the mono operator’s
heightinput. -
Click Compute Range to get the maximum and minimum height values of the terrain. The button will also fill in the Input Min and Input Max.
The values from the input parameters will then be mapped to Output Min and Output Max range.
Tip
If you want to reverse the process and convert a grayscale map into a heightfield, you can use the Mono to HeightField COP.