banner
Rating
Voted0

Monolith's Guide to Replacing Virtual Textures in Stalker 2

0
Mod version:1.0
Game version:all
The mod has been successfully tested for the absence of viruses
16049.39K362.81K

Report mod

  • image
modalImage

About This Mod

I have not yet seen the guidance on this issue, so I have decided to put it out. It should work for mesh, materials, etc. Most other UE5 manuals do not consider virtual texture flow, and Stalker 2 does.

Required Tools

FModel: https://fmodel.app/

Unreal Engine 5.1: https://www.unrealengine.com/en-US

Installation

Install Unreal Engine 5.1, not 5.3, not 5.2, not 4.8, not openxray 🙁.

Install and configure Fmodel (not covered in this guide).

How do I know if I need to do all this?

Not sure you're trying to replace the virtual texture? Check the uasset of your texture in FModel and find it in the uasset properties:

«VirtualTextureStreaming": true

If you don't have a texture like this, these steps still apply to normal textures. Simply skip enabling and converting virtual textures.

If your texture has this option, you need to enable virtual texturing!!!

Customize our project

Create a new project with the Games > Blank template and the following settings

Blueprint

Target Platform: Desktop

Quality Preset: Maximum

Starter content: [ ] (unflagged)

Ray tracing: [ ] (unflagged)

Name your project Stalker2

If someone knows how to get around this, please tell them only because my packages got the right mount point.

Customize our settings

Click the Platforms button and go to Packaging Settings

Enable Use Pak File [X]

Enable Io Store [X]

Enable Generate Chunks [X]

Search for "cook"

Enable Cook All in Project Content Directory [x]

Virtual Texture

Click on Edit and go to Project Settings

Find "virtual"

Scroll down and enable the following

Enable virtual texture support [x]

And then if the textures you're replacing include these features, turn them on:

Enable Enable virtual texture lightmaps [x]

Enable anistropic filtering of virtual textures [x]

Enable virtual textures for Opacity Mask [x].

UE5 will prompt you to reboot. Do it and wait 6 years.

Add ready-made textures

Add your textures to match the texture directory structure in FModel.

Now it's time to edit the properties of each of your textures:

Check the properties of your texture in FModel for these fields:

[?] CompressionSetting

[?] PixelFormat

[?] sRGB

[?] VirtualTextureStreaming

Diffuse texture

The PixelFormat format is DXT1, there are no compression settings, so it is the "default" texture.

Normal texture - PixelFormat - DXT5 and CompressionSetting - TC_Normal, so this is the "Normal" texture

RHO (roughness, height, opacity) or other cards: - PixelFormat - DXT1, CompressionSetting - TC_Masks, so it is a texture "Masks".

Convert to virtual textures

After you have configured all textures with compression options, it is time to make our virtual textures

Select all textures that have VirtualTextureStreaming: true

Right-click > Convert to Virtual Texture

In the pop-up window, decrease the filter until all textures are selected.

Click Save All

Create Asset Shortcut

Return to the Content folder, right-click, and create a new data asset

Choose Primary Asset Label

Name it Label_YOURMODNAME

Set the following options:

Priority: 1 or higher

Chunk ID: 1000 or higher, it should be unique to your fashion, so don't choose 1420 because it's already busy.

Cooking rule: Always cook

Mark assets in my directory: [x] (CHECKED)

CLICK SAVE ALL

Pack

Click Platforms > Windows > Shipping

Click Platforms > Windows > Package Project

Select the directory for the package you created, I create a Build directory with subdirectories for unique assemblies

This will take a long time

Yeah, still packing

Have you finished yet?

NOPE LOL NICE TRY is still packaging

FINALLY!!!!

Take Your .pak

In the directory you have selected, take the 3 files with the Chunk ID you have previously selected.

Rename them to, for example, z_YourMod_P

*make sure they end in _P*.

Place all 3 files in the ~mods/ directory

Open FModel and make sure your structure matches the game and your asset is replaced. If not, pay or verify your project name

Debug

Asset is not replaced in FModel

Try re-creating the asset tag with a different Chunk ID.

Then go to Platforms > Windows > Cook Content and then Platforms > Windows > Package Project.

Check!!!

Open the game and close it again for the 30th time tonight.


Credits: sunn

Similar Mods/Addons

Game Version *

all (Sample_UE5.1_Project-262-0-1-1732522965.7z)