1.10. SURFACES & VEGETATION

Whilst we’re using a procedural method for surface texturing and vegetation, we still need to define where the different surfaces should appear using our layer masks. This section describes how to apply the layer masks and perform basic set up of the Procedural Landscape Ecosystem.

Step 1:

Resize the Birch and Pine forest masks you created previously to the correct dimensions for the landscape. The first thing to do here is confirm the Overall Resolution of the landscape:

  • Select the ‘Manage’ tool on the ‘Landscape’ modes panel.
  • Click the ‘Selection Tool’ under ‘Landscape Editor’ and select ‘Change Component Size’.
  • The Overall Resolution in our model shows the dimensions are: 6986 wide by 6224 high. We’ll resize our masks to these dimensions.
Step 2:

Resize the layer masks in Photoshop and save in Grayscale 8-bit format:

  • Open Photoshop and then open the two mask .png files.
  • Select the Pine mask and then on the main menu, select ‘Image’ then ‘Image Size…’
  • Click the chain link to turn off ‘Constrain Aspect Ration, then input the width and height values in the appropriate fields.
  • Click ‘OK’ to resize the mask.
  • Check the mask is in ‘Grayscale 8-bit’ format. (In Photoshop: ‘Image’ > ‘Mode’ > ‘Grayscale’. Make sure ‘8-Bits/Channel’ is checked.)
  • Save the new mask.
  • Repeat for the Birch Mask.
Step 3:

Import the Pine and Birch forest masks to the landscape layers in UE4:

  • On the ‘Landscape’ mode panel, select ‘Paint’.
  • Select the ‘Pine_forest_a’ layer from the ‘Layers’ list under ‘Target Layers’.
  • <right-click> on the ‘Pine_forest_a’ layer and select ‘Import from File’.
  • In the broswer window that appears, select the .png mask for the pine forest.
  • Click ‘Open’.
Step 4:

Import the layer mask for the birch forest:

  • <Right-click> the ‘Birch_forest_a’ layer on the ‘Paint’ tab of the ‘Landscape’ mode.
  • Select ‘Import from File’.
  • Select the .png mask for the birch forest.
  • Click ‘Open’.
Step 4:

Turn on Procedural Foliage:

Now we’ve defined where the different surfaces should appear, we need to set up the vegetation. Since procedural foliage is experimental in UE4, the first thing we need to do is activate it in the Unreal Editor:

  • ‘Edit’ > ‘Editor Preferences…’
  • Click ‘Experimental’ in the ‘General’ section.
  • Check ‘Procedural Foliage’ to enable it.
Step 5:

Apply Procedural Landscape Ecosystem’s foliage Spawners to the landscape:

  • Navigate to the ‘Ecosystem’ folder in the ‘Procedural_Ecosystem’ add-on.
  • Select all 3 Spawners and drag them into the Unreal Editor Viewport.
Step 5:

Move the Spawners to the centre of the landscape:

  • Select all 3 Spawners (we can move them all together).
  • TerraForm automatically centres your landscape to 0,0,0 when it imports a DTM, so all you need to do is move the Spawners to 0,0,0 to centre them. The easiest way to do this is to click the ‘Reset to Default’ button next to the ‘Location’ values.
Step 6:

Determine the scale for the Spawners in Global Mapper:

  • Launch Global Mapper and drag the DTM file into the main window.
  • Click the ‘Open Control Center’ button on the menu and select the DTM file in the list of loaded files.
  • Click ‘Metadata’ at the bottom of the ‘Overlay Control Center’ window.
  • A new ‘Metadata’ window will appear with the info we need.
  • To find the width, subtract the ‘Upper Left X’ value from the ‘Lower Right X’ value. In our case: 303449.00 – 296520.00 = 6,929m.
  • To find the height, subtract the ‘Lower Left Y’ value from the ‘Upper Right Y’ value. In our case: 4909593.00 – 4903421.00 = 6,172m.
  • Scrolling down a little in the Metadata, we also find the ‘Min Elevation’ and ‘Max Elevation’ values from which our height range is 944.955m – 383.707m = 561.248.
Step 6:

Determine the scale for the Spawners in Global Mapper:

  • Keep all 3 spawners selected.
  • The default size of the spawners is 2m x 2m x 2m (width x length x height).
  • To fit our landscape we need them to be 6,929m x 6,172m x 562m (rounding up the height).
  • Our scale sizes therefore need to be X=3464.50, Y=3086.0, Z=281.0.
  • Enter these values into the ‘Scale’ parameter boxes.
Step 7:

Run the Spawners to generate the vegetation:

  • Keep all 3 Spawners selected.
  • Scroll down the ‘Details’ panel to the ‘Procedural Foliage’ section and de-select ‘Allow Static Mesh’.
  • Click ‘Resimulate’ to run the Spawners.
  • It may take some time to run the vegetation Spawners, depending on your system’s specification.