# Iris

[**Iris**](https://github.com/Witcher-Tools/iris) is a utility that provides a set of tools to simplify working with maps in RedKit. It is designed for importing texture maps, procedural vegetation generation (currently in development), and slicing and renaming tiles into a format compatible with RedKit (also in development).

### **Texture Import**

The utility allows you to import texture maps created in third-party editors, such as Gaea, into RedKit.

The prepared map must meet the following requirements:

* The resolution must match the resolution of your map in RedKit.
* The map must be grayscale, with pixel values ranging from 0 to 255.

You can define which texture corresponds to specific pixel value ranges on the map. For each range, you can configure the following settings:

* **Vertical Texture** (the texture number in the list, starting from 1 in TerrainEditTool).
* **Horizontal Texture** (the texture number in the list, starting from 1 in TerrainEditTool).
* **Slope Threshold**.
* **UV Scale**.

#### **Steps for Importing a Texture Map**

* **Step 1: Select the Texture Map**\
  First, choose the prepared texture map. After selection, the utility will display a preview of the map.
* **Step 2: Select the Folder with Tiles**\
  Select the folder containing the terrain tiles (**terrain\_tiles**), located in the directory of your level.
* **Step 3: Add Textures**\
  To assign textures, click the "Add Texture" button. This will add a new range to the value scale. You can then click on this range to edit its texture and see how it will be applied.
* **Step 4: Import Textures**\
  After completing the setup, the "Import" button will become active. Click it to import the textures.
* **Step 5: Sync LOD in RedKit**\
  After importing the map and textures, open or reload your level in RedKit. Navigate to the TerrainEditTool and go to the Materials tab. Click the "Texture usage" button, select the topmost texture, and replace it with the same texture. This step is necessary to synchronize the LODs in the tile files, as the utility writes only the zero LOD. Once this is done, reload the level again.&#x20;

{% hint style="danger" %}
When adding a range, the utility will reorder all existing ranges on the scale. If you need to add another range with its own texture, you can split the selected range into two using the "Insert" button.
{% endhint %}

### **Texture scale**

The scale displays texture ranges. When a range is selected on the scale, it is highlighted in green on the map preview, allowing you to see the area of application. Additionally, when a specific range is activated, you can edit the texture that will be applied to that range.

**Hotkeys for scale:**

* **Up/Down Arrows**: Switch the selected texture on the scale.
* **Insert**: Splits the selected range, adding a new texture.
* **Delete**: Removes the selected texture.
* **Mouse Wheel Up/Down**: Adjusts the texture range.
* **Ctrl + Mouse Wheel Up/Down**: Zooms the scale for detailed adjustments.
* **Middle Mouse Button + Drag**: Moves the scale up or down when zoomed in.

### **Backup**

The utility automatically creates a backup of your tiles, but only during **the first import**. These backups are not overwritten in subsequent imports. Backups are saved in a folder created in the same directory as the application's executable file.

### **Presets**

Presets allow you to save scale ranges to a separate JSON file located in the **presets** folder within the program's launch directory. Saved presets can be loaded to continue working with them later.

### Import example

{% embed url="<https://youtu.be/XavciK4x6B8>" %}

<figure><img src="/files/rEPI8ARrKhueTxhWVdn3" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/nDiw2p5EXwETIRKZlrzU" alt=""><figcaption></figcaption></figure>

<div><figure><img src="/files/f8luDQ0tZHZVH2K3qoBP" alt=""><figcaption></figcaption></figure> <figure><img src="/files/WuRBN3CnKZ1zyHLyH1Uw" alt=""><figcaption></figcaption></figure> <figure><img src="/files/2pOumypFxNpCpIM00oBj" alt=""><figcaption></figcaption></figure> <figure><img src="/files/BRndjP8OrcKOFROM98Ve" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/CerNQ0bXRyWReVsAroWL" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://w3redkit-community-doc.gitbook.io/witcher-3-redkit-docs/witcher-3-redkit-docs-en/tools/third-party-utilities/iris.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
