Skip to content

How to Use

Edward Teach edited this page Apr 13, 2024 · 2 revisions

After successfully installing TerraPrime in your Unreal Engine 5 project, you're ready to leverage its full capabilities to elevate your landscapes. Follow this detailed guide to master the usage of TerraPrime's AutoMaterial features.

Accessing TerraPrime Content

  1. Opening Your Project: Start by launching Unreal Engine and opening your project.
  2. Viewing Plugin Content: In the Content Browser, you might not initially see the Plugins folder. To reveal it:
    • Click on 'Settings' (the gear icon) located at the bottom of the Content Browser.
    • Select 'Show Plugin Content' to make the TerraPrime content visible.
  3. Navigating to TerraPrime Materials: Go to ./Plugins/TerraPrime Content/AutoMaterial. This directory houses all the essential materials and assets provided by TerraPrime for landscape auto-generation.

Creating a Material Instance from M_TerraPrime

  1. Locating M_TerraPrime: Within the AutoMaterial folder, find the M_TerraPrime material. This master material comes equipped with multiple terrain layers (e.g., Dirt, Grass, Cliff) and features like distance variation, macro variation, and support for Nanite displacement.
  2. Creating a Material Instance:
    • Right-click on M_TerraPrime and choose "Create Material Instance".
    • Unreal Engine will prompt you to name the new material instance. Select a name that reflects its intended use or the terrain type it will represent.

Handling the Material Instance

  1. Organizing Material Instances: After renaming, the material instance will remain in the same directory. If you wish to avoid automatic updates from plugin changes or plan extensive customizations:
    • Duplicate the material instance by right-clicking and selecting "Duplicate".
    • Rename the duplicate accordingly.
    • Move it to your project’s content folder for better organization.

Applying the Material Instance to Your Landscape

  1. Assigning the Material: The TerraPrime material instance can be applied during the creation of a new landscape or updated on an existing one. Use the landscape editor or the details panel of your landscape asset to assign your material instance to the landscape's material property.
  2. Visualizing the Change: This assignment applies the visual characteristics defined in the material instance to your landscape, rendering the various terrain types based on the landscape's height and slope data.

Customizing the Material Instance

  1. Opening Material Properties: Double-click your material instance in the Content Browser to access its properties.
  2. Tweaking Settings: Adjust settings such as layer weights, texture scales, and color variations to tailor the look for each terrain type. Changes will reflect in real-time in the viewport.

Advanced Setup

Runtime Virtual Texturing (RVT)

  • RVT can significantly enhance the detail and performance of large landscapes. Set up RVT by navigating to the landscape settings and enabling virtual texture support for both base color and height.

Nanite Integration

  • To utilize Nanite's full potential with TerraPrime materials, ensure that your project’s DefaultEngine.ini includes the required settings for Nanite tessellation as previously described in the installation guide. Use these features to create highly detailed terrains without compromising performance.

Layer Customization

  • Explore the possibility of adding custom layers to your material instances. This allows for greater flexibility in designing unique landscapes, accommodating everything from lush grasslands to arid deserts.

C++ Classes and Blueprint Nodes

TerraPrime includes C++ classes and Blueprint nodes that provide advanced control over Nanite tessellation features, enabling real-time adjustments and monitoring of tessellation status.

UTerraNanite

  • SetNaniteTessellationEnabled(bool bEnabled): Enables or disables Nanite tessellation.
  • IsNaniteTessellationEnabled(): Returns whether Nanite tessellation is currently enabled.
  • ToggleNaniteTessellation(): Toggles the current state of Nanite tessellation.

These functions are accessible in Blueprints and can be used to dynamically adjust tessellation according to gameplay needs or performance considerations.

UPluginInfo

  • GetVersion(): Retrieves the current version of the TerraPrime plugin. Useful for display in UIs or logging to ensure compatibility and debugging.

By incorporating these C++ classes and Blueprint nodes into your project, you can leverage advanced programming techniques to enhance the dynamism and responsiveness of your TerraPrime landscapes.

By following these enhanced guidelines, you'll be well-equipped to utilize TerraPrime to its fullest, creating dynamic, textured landscapes that bring your Unreal Engine projects to life. Stay tuned for updates and further advanced features as TerraPrime continues to evolve.