diff --git a/docs/Modding/guides/tools/VTFModding.md b/docs/Modding/guides/tools/VTFModding.md index 040da0de..7615cb63 100644 --- a/docs/Modding/guides/tools/VTFModding.md +++ b/docs/Modding/guides/tools/VTFModding.md @@ -104,7 +104,7 @@ When we use vtf textures, we can only use the albedo and normal. Learn more abou ## VTFEdit -[VTFEdit](https://nemstools.github.io/pages/VTFLib-Download.html) is a tool to edit, view, and create .vtf files. +[VTFEdit](https://nemstools.github.io/pages/VTFLib-Download.html) or it's newer version [VTFEdit Reloaded](https://github.com/Sky-rym/VTFEdit-Reloaded/releases) is a tool to edit, view, and create .vtf files. Launch [VTFEdit](https://nemstools.github.io/pages/VTFLib-Download.html). Top left, click `File`, `Import`, find and Import your custom texture(s). diff --git a/docs/Modding/mapping/MRVN-Radiant/shaders.md b/docs/Modding/mapping/MRVN-Radiant/shaders.md new file mode 100644 index 00000000..63711338 --- /dev/null +++ b/docs/Modding/mapping/MRVN-Radiant/shaders.md @@ -0,0 +1,22 @@ +# Shaders + +## Introduction +A shader is a script that defines the visual properties of a surface. It is used in MRVN to define the properties of the texture to be compiled into the map and rendered by the engine. An example of a shader property is `$compileflag nodraw` to make the texture not be drawn. A shader definition needs to be present, for a texture, to be able to use a material from a `.rpak`. VMT and VTF don't need a shader definition, but it is good practice to have a shader definition. You can find examples of shader files in [MRVN Resource Pack](https://github.com/MRVN-Radiant/MRVN-Resource-Pack). + +--- + +Shader files are stored in the shaders directory, where the textures for the shaders are stored in the texture directory. + +![Folder Path Image](../../../_static/images/mrvn/textures/folder_example.jpg) + +#### Example +A simple shader definition for a texture +``` +textures/world/dev/generic_grey +{ + $shadertype LitBumpGeneric + $surfaceflag litbump +} +``` + +--- \ No newline at end of file diff --git a/docs/Modding/mapping/MRVN-Radiant/textures.md b/docs/Modding/mapping/MRVN-Radiant/textures.md new file mode 100644 index 00000000..ed6de9e9 --- /dev/null +++ b/docs/Modding/mapping/MRVN-Radiant/textures.md @@ -0,0 +1,141 @@ +# Textures + +## Introduction +MRVN Radiant is a brush-based level editor used for creating custom maps for Titanfall 2. In MRVN, most surfaces such as floors, +walls, and ceilings are made up of brushes. These brushes are textured using image files mapped onto their surfaces. + +--- + +## Setting Up Texture Paths + +Proper texture paths are important because both MRVN and Titanfall 2 rely on these paths to locate texture files. + +In MRVN, textures are referenced relative to the `textures/` directory. When you apply a texture to a brush, MRVN looks inside this folder to match the path. +Titanfall 2 expects those same textures to be defined either by `.vmt/.vtf` materials (VMT method) or embedded in `.rpak` files (RPAK method) using the exact same relative path. + +--- + +### Step 1: Folder Structure + +First, create a folder for your custom assets. The simplest structure looks like this: + +``` +/ +├── textures/ +├── model/ +└── shaders/ +``` + +MRVN looks for textures inside the `textures/` folder, so this folder is required. + +A more complete structure may look like: + +``` +/ +├── textures/ +│ ├── world/ # Textures for brush geometry +│ │ ├── dev/ # Developer grid and debug textures +│ │ ├── walls/ # Wall textures +│ │ └── floor/ # Floor textures +│ ├── model/ # Model-specific textures (not commonly used) +│ └── skybox/ # Skybox textures (currently not implemented in MRVN) +├── model/ # 3D models (OBJ or mdl format) used in MRVN +└── shaders/ # Shader definitions for MRVN to compile into Map (Used for rpak) +``` + +It is strongly recommend downloading the [MRVN Resource Pack](https://github.com/MRVN-Radiant/MRVN-Resource-Pack). +The pack includes helpful assets such as spawnpoint models, other entity models and definitions, and utility textures commonly used in Source Engine and Titanfall development. +It also provides a reference for proper folder structure. + +--- + +### Step 2: Add Resource Path in MRVN + +1. Launch MRVN Radiant. +2. Press `P` to open **Preferences**. +3. Navigate to the **Games/Paths** section. + ![Preferences Image](../../../_static/images/mrvn/textures/mrvn_preferences.jpg) +4. Click the folder icon next to "Extra Resource Path". +5. Select the folder you created in Step 1. + +**Important:** Add the **parent folder** (the one that contains the `textures/` folder), not the `textures/` folder itself. + +![Folder Path Image](../../../_static/images/mrvn/textures/folder_example.jpg) + +--- + +After adding your custom folder and the MRVN Resource Pack, your list of resource paths should resemble this: + +![Path Example Image](../../../_static/images/mrvn/textures/mrvn_path_example.jpg) + +--- + +The only textures you should have right now is the ones added in the MRVN Resource pack and your MRVN Radiant should look like this. + +![Path Example Image](../../../_static/images/mrvn/textures/mrvn_resource_pack_show.jpg) + +--- +### Step 3: Add Textures to the `textures/` Folder + +MRVN supports multiple image formats such as `.png`, `.dds`, and other image formats. These image files are used to apply textures to +geometry within the editor. + +However, **Titanfall 2 requires that the in-game material file (either a `.vmt` or a compiled `.rpak` material) matches the texture path +exactly as used in MRVN.** This path must reflect everything after the `textures/` folder. + +#### Example Full File Path: + +``` +G:\MRVN textures\textures\world\dev +``` + +Only this portion is relevant to MRVN and Titanfall 2: + +``` +world\dev +``` + +If your paths do not match, Titanfall 2 will not be able to locate and apply the correct texture during runtime. + +#### Example Usage + +Used in MRVN: +``` +world/dev/generic_grey.png +``` + +Used in Titanfall 2 (VMT method): +``` +world/dev/generic_grey.vmt +``` + +Ensure the filename (excluding file extension) and folder structure are **exactly the same** for both the texture file and the material file. + +--- + +#### Example Folder and MRVN Preview + +Here is an example of a correctly structured texture folder and how it appears inside MRVN: + +![Texture Folder Example](../../../_static/images/mrvn/textures/mrvn_texture_example.jpg) +![In-Editor Texture Example](../../../_static/images/mrvn/textures/mrvn_texture_example_in_mrvn.jpg) + +--- + +### Step 4: Loading Textures in Game + +There are two main methods for loading textures into the game for use in your custom map: the **VMT method** and the **RPAK method**. + +The **VMT method** is quicker and easier to set up, making it ideal for testing or simple projects. However, it offers limited +control over how textures appear in-game, and the visual quality may be lower. + +The **RPAK method** requires more setup, as it involves using [RePak](../../repak/index.md) and creating a JSON map file to compile your textures into an `.rpak` file. While this method is more complex, it provides greater control over texture behavior and appearance. [Here](../../repak/assets/index.md) to learn more about `.rpak` and Repak. To use textures and materials with `.rpak` you need to have a [shader definition](./shaders.md) for each texture used in the map. MRVN will compile the texture info using the shader definition into the map, making the engine be able to find the materials in `.rpak`. + +--- + +## Common Problems + +- Applying a texture in MRVN using one path, but placing the material in a different one for titanfall 2. +- Forgetting to include a `.vmt` or material definition for the texture when packaging the map. +- Using spaces or capital letters inconsistently between image and material paths. +- Not including the correct `pak/`, `materials/`, or `textures/` folders in your mod structure. diff --git a/docs/_static/images/mrvn/textures/folder_example.jpg b/docs/_static/images/mrvn/textures/folder_example.jpg new file mode 100644 index 00000000..4db934b1 Binary files /dev/null and b/docs/_static/images/mrvn/textures/folder_example.jpg differ diff --git a/docs/_static/images/mrvn/textures/mrvn_path_example.jpg b/docs/_static/images/mrvn/textures/mrvn_path_example.jpg new file mode 100644 index 00000000..f0db3fdd Binary files /dev/null and b/docs/_static/images/mrvn/textures/mrvn_path_example.jpg differ diff --git a/docs/_static/images/mrvn/textures/mrvn_preferences.jpg b/docs/_static/images/mrvn/textures/mrvn_preferences.jpg new file mode 100644 index 00000000..8164714b Binary files /dev/null and b/docs/_static/images/mrvn/textures/mrvn_preferences.jpg differ diff --git a/docs/_static/images/mrvn/textures/mrvn_resource_pack_show.jpg b/docs/_static/images/mrvn/textures/mrvn_resource_pack_show.jpg new file mode 100644 index 00000000..7014f629 Binary files /dev/null and b/docs/_static/images/mrvn/textures/mrvn_resource_pack_show.jpg differ diff --git a/docs/_static/images/mrvn/textures/mrvn_texture_example.jpg b/docs/_static/images/mrvn/textures/mrvn_texture_example.jpg new file mode 100644 index 00000000..178370c2 Binary files /dev/null and b/docs/_static/images/mrvn/textures/mrvn_texture_example.jpg differ diff --git a/docs/_static/images/mrvn/textures/mrvn_texture_example_in_mrvn.jpg b/docs/_static/images/mrvn/textures/mrvn_texture_example_in_mrvn.jpg new file mode 100644 index 00000000..d7fea441 Binary files /dev/null and b/docs/_static/images/mrvn/textures/mrvn_texture_example_in_mrvn.jpg differ