# Quick Tutorial

{% hint style="warning" %}
Runtime Virtual Texturing is used for this tutorial, see [**here**](https://dev.epicgames.com/documentation/en-us/unreal-engine/virtual-texturing-settings-and-properties-in-unreal-engine#projectsettings) on how to enable it within your project settings.
{% endhint %}

## Example Level

{% hint style="info" %}
For this tutorial we will use the provided level **Islands\_Demo\_RVT.**
{% endhint %}

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FoirB2zJRhN1qtyDVlXK2%2Fimage.png?alt=media&#x26;token=f45343aa-8c81-42cd-b347-37f972729714" alt=""><figcaption></figcaption></figure>

Begin by opening the scene, selecting the landscape, and removing the existing Material. It's advisable to save the level as a new file to retain a reference for future comparisons.

## Setup Blank Material

Begin by creating a new blank Material from the Material Tab.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2Fs4yNHDbVomfIylx20fnU%2Fimage.png?alt=media&#x26;token=2e9994ee-ebe2-4f48-94c2-999c0f1693ea" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
To duplicate a Landscape Material, select an existing Material and click `Create a New Landscape Material`
{% endhint %}

Choose a name for the `Landscape Material` and save it.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FKQqR10jT3YJI0AWLDSRB%2Fimage.png?alt=media&#x26;token=ed53fbe7-176f-415b-bfa6-654d494501b4" alt=""><figcaption></figcaption></figure>

Once the `Material Tab` displays your new material without layers, proceed to assign this Material to the current landscape.

### Enable Runtime Virtual Texturing

For this Material, we will use `Runtime Virtual Texturing`, which is already added to the scene and landscape. However, we will need to enable it within the Material itself, as it is off by default.

Navigate to the `Runtime Virtual Texture` options under the `Material Tab` and enable the `Use Runtime Virtual Texture` toggle. By default, it uses the plugin's `Runtime Virtual Texture Sample`, but you can swap this out for your own project's sample.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2F7e0KYLHQUYffj1ngiBoD%2Fimage.png?alt=media&#x26;token=17a917f1-62d4-4be3-bab7-67792ad69eae" alt=""><figcaption></figcaption></figure>

Before we start adding layers to the Material, we will want to switch over to the `Layers Tab` .

## Creating Layers

### Base Grass Layer

In the `Layers Tab`, go to the sub-toolbar in Layer Reference and create a new blank layer.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FygPvAuGCFDpCARFTMdFk%2Fimage.png?alt=media&#x26;token=fab94bbc-4b1f-4207-ab6c-e1c38c49ef92" alt=""><figcaption></figcaption></figure>

For this layer, save it as `LL_Grass_Base`.

In this tutorial, we'll use the textures included with the plugin, but you're welcome to use your own.

Navigate to `ExampleContent/Textures/Grass`, select `T_GrassBase_basecolor`, and assign it to the `Diffuse` input on the new layer.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FYdlwqujH9cUQm0hOXdor%2Fimage.png?alt=media&#x26;token=ea909635-cc29-4b70-bf1d-f11281ee568f" alt=""><figcaption></figcaption></figure>

Repeat this step for the `_normal` texture by assigning it to the `Normal` slot in the layer.&#x20;

#### Channel Packed Texture Setup

The `_RHA` texture is a channel-packed texture containing `Roughness` (R), `Height` (G), and `Ambient Occlusion` (B) in the respective RGB color channels.

To enable channel packing on the layer:

1. Navigate to the `Detail Parameters`.
2. Find the option related to your channel-packed texture, such as `Roughness`.
3. Click the `Use Channel Packing` toggle.

You will notice that the `Roughness` input has been replaced with a `Channel Packed Texture` input.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FANfFsqsUyi1nEyzY0oqL%2Fimage.png?alt=media&#x26;token=9ed594bb-f379-4756-8317-211363c27b94" alt=""><figcaption></figcaption></figure>

Assign the `_RHA` texture to this new `Channel Packed Texture` input. By default, it has set `Roughness` to the `Red` color mask channel, which is the correct channel we want.

Repeat this step for the `Height` and `Ambient Occlusion` parameters. You should have something like this:

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2F0WV390idHz4iUJNDs1su%2Fimage.png?alt=media&#x26;token=2665e699-df80-414a-8c15-91332676d755" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Ensure that the selected color channel mask accurately corresponds to the channel-packed texture.

Explanation and Examples of Channel Packing: <http://wiki.polycount.com/wiki/ChannelPacking>
{% endhint %}

To remove the `Specular` Input, go to the `Inputs` section at the top of the `Layer Settings` and toggle off the `Use Specular` input. Doing this will hide the `Specular` texture input and disable the specular texture input within the layer itself, reducing shader instructions.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FMjaXUkHxjy9hJcN4a9Jw%2Fimage.png?alt=media&#x26;token=069bc323-1936-4c54-b5ae-e08952e1e140" alt=""><figcaption></figcaption></figure>

Save the layer from the `Layer Reference` sub-toolbar.&#x20;

Return to the `Material` tab and click the `Add Layer` button. Assign the new layer as `LL_Grass_Base`. From the drop-down menu that initially displays `Standard Weight Blend`, select `Standard Alpha Blend`, as this is the optimal blending method for the base layer of an LMT Material.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FPgYUiqS3Jf13A89DUBIB%2Fimage.png?alt=media&#x26;token=b19aa339-0fba-41da-be0e-544f3d822ef1" alt=""><figcaption></figcaption></figure>

Click the `Save and Compile` button from the `Master Material` sub-toolbar.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2Fmqm3469N20ek5RpNHMIm%2Fimage.png?alt=media&#x26;token=acc4c4a7-3579-415b-a4a5-d4300e5cafbe" alt=""><figcaption></figcaption></figure>

### Fixing Black Landscape

Upon compilation, you may observe that the landscape appears black. This is typical, as no layer weights have been assigned to the landscape.

To resolve this issue, go to the `Paint` tab in the standard `Landscape` editor mode, remove any existing `Paint Layers`, and click the `Create Layers From Assigned Materials` button

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2Fv4SsTTOJUHRRrXHwxY16%2Fimage.png?alt=media&#x26;token=349c39c6-90b4-4a58-8c6f-b251173bc7dd" alt=""><figcaption></figcaption></figure>

After removing any existing layers and selecting the `Create Layers From Assigned Materials` button, you should see a `Grass_Base` layer and a `Wetness_Paint` layer. Next, select the `Create Layer Info` button and choose the `Non Weight-Blended Layer` option.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2F5QI1Hr1onMtK4Y9Sb1zd%2Fimage.png?alt=media&#x26;token=9d3b6101-2d76-421d-86ed-9790d7a54ab5" alt=""><figcaption></figcaption></figure>

Save this in your preferred location.

Right click on the `Grass_Base` paint layer and select the `Fill Layer` option.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FAwtAPoWGORYrMh2wx6FR%2Fimage.png?alt=media&#x26;token=dffe995a-566a-4bd5-ba6e-e5297104ed13" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If your landscape still appears black, please verify that `Runtime Virtual Texturing` is enabled in your project settings.
{% endhint %}

The landscape should now be covered with the `Grass_Base` layer that was recently created and assigned.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FOZxQhSIEsh28EoMZGbtX%2Fimage.png?alt=media&#x26;token=970a668a-28ab-488d-9f34-2cb190ef7044" alt=""><figcaption></figcaption></figure>

### Editing Layers

Return to the `Layers` tab, and click on the `Additional Layer Actions` dropdown button. Under `Edit Layer In Material`, select the `LL_Grass_Base` layer that we previously created.

{% hint style="info" %}
This is an easy way to switch between layers that are assigned to the Master Landscape Material.
{% endhint %}

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FJgqcMApDeeEB38A60qBR%2Fimage.png?alt=media&#x26;token=d48d5f92-ec5b-42ca-9122-ae9439054568" alt=""><figcaption></figcaption></figure>

#### UV Tiling and Advanced Tiling

Lets start by getting the layer to look the way we want with the UV tiling.&#x20;

Navigate to the `Detail Parameters -> UV` options and set the `UV Tiling` parameter to a value that suits your needs. I chose a value of 0.25. Remember to save to see the updates on the landscape.

{% hint style="info" %}
The Manny Skeletal Mesh serves as an ideal reference for determining scale.
{% endhint %}

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FhB7oAceU8OgldRh477yK%2Fimage.png?alt=media&#x26;token=b70d12ed-0fd6-41a9-a73b-d5601b7cf97c" alt=""><figcaption></figcaption></figure>

To address the noticeable repetitions in the texture with standard tiling, proceed to the `Advanced Tiling` option located within the `UV` parameters.

Two advanced tiling options are available: `Blotch Tiling` and `Swizzle Tiling`

* **Blotch Tiling**: This technique employs a three-layered, world-aligned mask texture to darken specific areas, effectively disrupting texture tiling
* **Swizzle Tiling**: This approach utilizes a dual-sample system, rotating one sample by 90 degrees and optionally scaling it, then applying it according to a specified mask.

In this example, I will select `Swizzle Tiling`, retaining the default parameters.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FaTFKMHpH8MdyjzwxN03r%2Fimage.png?alt=media&#x26;token=02faa69c-14f6-4e1f-9bee-95b047ab9efd" alt=""><figcaption></figcaption></figure>

This looks much better and less repetitive. However, there's one more step we can take to further reduce repetition

#### Global Distance Swap

The `Global Distance Swap` feature is enabled by default and can be found in the `Layer Settings` section at the top of the Details Panel. While you have the option to disable it, this tutorial will demonstrate its utilization.

Navigate to the `Global Parameters` options. You will notice that there are similar parameters here as in the `Detail Parameters` but with some additions.

Set the `UV Tiling` parameter to approximately 0.025. Then, navigate to the `Advanced Tiling` section and enable the `Advanced Tiling: Use Blotch` option.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FZmLrtTru89tUO3j94S0n%2Fimage.png?alt=media&#x26;token=ef0bb4c9-725f-4f62-8207-98fad8627ce1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please review and adjust the provided settings as needed before moving forward.
{% endhint %}

### Overlay Sand Layer

With the current `LL_Grass_Base` layer referenced click the `Save As` button in the sub-toolbar which will create a copy of this layer as a new layer. Save this layer as `LL_Sand_Dry` .&#x20;

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FaKDyVHkl2beQLVDTigEh%2Fimage.png?alt=media&#x26;token=bb5832e4-7cde-4874-b5ab-92a3dec236a6" alt=""><figcaption></figcaption></figure>

Return to the `Material Tab`, add this layer to the layers list, set the blending mode to `Overlay Blend`, and then save/compile the Material. It should resemble the following:

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FqiDChSKNCG9jU6uvWHGf%2Fimage.png?alt=media&#x26;token=654c77dd-ed59-4258-8d68-f52c2ef4e6ab" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Overlay layers, akin to Photoshop layers, are computed in a sequential manner. This approach facilitates advanced techniques such as world height blending and automatic cliff generation.
{% endhint %}

You will need to repeat the steps [**here**](#base-grass-layer) to set the new textures to the dry sand located: `ExampleContent/Textures/Sand/T_DrySand` .

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FaL1uugmkgbrWtgxCDPn6%2Fimage.png?alt=media&#x26;token=8aefe531-3b43-4186-95ed-18dd97261c69" alt=""><figcaption></figcaption></figure>

You will then have to repeat the steps [**here**](#fixing-black-landscape). but without removing the existing paint layers and do not fill the paint layer.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FfPjf789iHE7uwMcyIG7d%2Fimage.png?alt=media&#x26;token=957e6f22-9ca0-4a8e-b261-f057d0f0ebe7" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
In the future, if you have pre-existing layers, you can complete this step at the end while creating a new Material.
{% endhint %}

Return to the `Landscape Material Tool` and continue editing the `LL_Sand_Dry` layer.

Navigate to the `Overlay->World Height` parameter category and enable `Use World Height Blend`.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FtPI9CoKa6bEoaGzRdQkP%2Fimage.png?alt=media&#x26;token=95dfc800-b662-4fe4-9f3e-9f7264754a54" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
World Height Blend is a technique that can be used to automatically paint down snow or sand based on the World Height Z location.
{% endhint %}

Enable `World Height: Flip Direction` and set the `World Height: Offset` to something like `-3600`.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2Flj2hFfk43r3RTiJFnsUc%2Fimage.png?alt=media&#x26;token=f5644523-9d09-4c56-a9a1-499bf4ba5850" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
An easy way to figure out what height you need is using an actor in world and taking the Z location from that.
{% endhint %}

By modifying the parameters in this category I came to these results:

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2F3yjzI8E4ILzWAnxVYFZs%2Fimage.png?alt=media&#x26;token=6e34f70e-fab8-4d6c-b59a-44676339939f" alt=""><figcaption></figcaption></figure>

### Overlay Cliff Layer

Begin by repeating the steps [**here**](#overlay-sand-layer). Name the layer `LL_Cliff` and use the `Cliff` textures located in `ExampleContent/Textures/Cliff`. Do not enable `World Height` for this layer.

Within the `Material Tab` make sure the layer blending is set to `Cliff Blend`.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2Ff57UJqLPPfENUDaprOlg%2Fimage.png?alt=media&#x26;token=ad72b668-f411-4478-8901-76a21e247014" alt=""><figcaption></figcaption></figure>

Once the layer is assigned and the Material is compiled, you should already have cliffs displaying.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FN8HEKT1yjifD4StfgCDD%2Fimage.png?alt=media&#x26;token=e46b3af5-a2e6-4e33-aef3-ac68a1d00fc2" alt=""><figcaption></figcaption></figure>

You will find a new parameter category called `Overlay Cliff`. From here you can alter things such as the cliff slope angle and the amount of falloff the cliff has.

These are the parameters I used to get the desired results:

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FhoBblpTB0MXfqqxFTMYS%2Fimage.png?alt=media&#x26;token=528b334c-dcb7-4902-8e51-bb8e8ac0d327" alt=""><figcaption></figcaption></figure>

#### World Aligned / Triplanar UV's

When dealing with cliffs, we want to ensure that there is no smudging on sharp, vertical faces.

For example:

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FgJ5PhkeNrOvdKjKBd5rn%2Fimage.png?alt=media&#x26;token=94cfd122-5807-47eb-9f25-a027d15e8e5d" alt=""><figcaption></figcaption></figure>

To address this, we can use `Triplanar Mapping` or `World Aligned Textures`.

Under your `Detail Parameters->UV` and `Global Parameters->UV` there will be an additional category called `Triplanar` .

Enable `Use Triplanar Mapping` and set the texture size accordingly. I set my `Detail` to `1024` and my `Global` to `4096`.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FPCzqUvWdwQdgnEYCHT4j%2Fimage.png?alt=media&#x26;token=fe1c9062-df8c-4354-af48-a24e60c4f2eb" alt=""><figcaption></figcaption></figure>

This may not fully resolve the issue, but it should suffice for most situations.

{% hint style="info" %}
This plugin works well with adjusting parameters to achieve desired results. For example, try enabling `Use Advanced Triplanar Mapping` and modifying the parameters beneath that to see if it works better for you.
{% endhint %}

You should now have a basic understanding of how to create a `Landscape Material` using the `Landscape Material Tool`.

We recommend viewing the example Materials provided and studying how they are set up, as they go more in-depth with the features provided with this plugin.

You can also explore the rest of the documentation for more details on different features in the Landscape Material Tool 2.0 Update.
