-
-
Notifications
You must be signed in to change notification settings - Fork 118
Configuring lsfg‐vk
If you installed lsfg-vk-ui as part of lsfg-vk, you can open the configuration editor either through your favorite application picker, or by running lsfg-vk-ui in the console. Please note that the user interface may look different on your system as it is dependent on the GTK theme.
(imagine a picture of the user interface here; github can't display it properly)
On the left you can select a list of profiles. Each profile has a "Profile name", which is a string containing the command name of the program to launch. You can read more about this property below, but what you need to know is clicking the button next to it will bring up a process picker, where you can select your game and automatically extract the command name.
With the profile set up, you can change the multiplier, flow scale, etc. below and it will update in real time, assuming you had created the profile prior to launching the game.
If you installed Lossless Scaling in a non-default path, change the global option at the top to the Lossless.dll within Lossless Scaling. You can use the file picker on the right to navigate there.
Tip
If the process name isn't descriptive (e.g. "GameThread" or "main"), you can launch the game with the LSFG_PROCESS="new_name" environment variable set. This will override the name and activate a preset via the new given name.
lsfg-vk is configured via ~/.config/lsfg-vk/conf.toml. Open it up in your favorite text editor. The configuration should look something like this:
version = 1
[global]
# override the location of Lossless Scaling
# dll = "/games/Lossless Scaling/Lossless.dll"
# [[game]] # example entry
# exe = "Game.exe"
#
# multiplier = 3
# flow_scale = 0.7
# performance_mode = true
# hdr_mode = false
#
# experimental_present_mode = fifo
[[game]] # default vkcube entry
exe = "vkcube"
multiplier = 4
performance_mode = true
[[game]] # default benchmark entry
exe = "benchmark"
multiplier = 4
performance_mode = false
[[game]] # override Genshin Impact
exe = "Genshin"
multiplier = 3You can override the path to the configuration with the environment variable LSFG_CONFIG.
The configuration is split into sections. You have a [global] section at the top, followed by as many [[game]] sections as you wish (note the double brackets).
The global section is used for setting up the layer as a whole. These are the properties you can set there:
| Property | Recommended Value | Description |
|---|---|---|
dll |
Path to Lossless.dll or empty |
If you didn't install Lossless Scaling into traditional directories, you can override the path to the Lossless.dll file within the game files using this property |
The game section is where stuff gets interesting:
| Property | Recommended Value | Description |
|---|---|---|
multiplier |
(1, )2, 3, 4 | Double, triple or quadruple your FPS. You can go as high as you want. |
flow_scale |
0.25 to 1.0 | Lowers the resolution of the internal image used for motion estimation. This can improve performance, although performance_mode is preferred. |
performance_mode |
true or false
|
Switches the frame generation model to much lighter one. This can massively improve performance (between 2x to 8x as fast, depending on the resolution). Loses a slight bit of quality |
hdr_mode |
1 when using HDR | Switches the shaders to HDR mode (scRGB not supported). Do NOT set this flag when not using HDR |
experimental_present_mode |
vsync/fifo or mailbox or immediate
|
Overrides the present mode without altering synchronization logic. Very experimental. |
In addition to the above properties, each [[game]] section additionaly has the exe property, which might be a little bit confusing to newcomers. The exe property is matched against the end of the running program's path, or the command name. If you run vkcube, then the path will likely be /usr/bin/vkcube and the command name vkcube. You can now decide to set exe to vkcube (exact match with the command name) or something like bin/vkcube (matches the end of the path).
Why is this necessary? When you launch an app through wine/proton, the path will be /usr/bin/something/wine and NOT the actual game. This is why you need the game's command name.
Open up your game in the background. Then open a terminal and paste this command into it. To the right of the colon will be the command name, you should see your game in here.
for pid in /proc/[0-9]*; do
owner=$(stat -c %U "$pid" 2>/dev/null)
if [[ "$owner" == "$USER" ]]; then
if grep -qi 'vulkan' "$pid/maps" 2>/dev/null; then
procname=$(cat "$pid/comm" 2>/dev/null)
if [[ -n "$procname" ]]; then
printf "PID %s: %s\n" "$(basename "$pid")" "$procname"
fi
fi
fi
doneIf this is too complicated for you, set exe to whatever you like and launch the game with LSFG_PROCESS=<the name you gave it> (...). Note that this solution is much less convenient as it requires editing the launch arguments.
Almost every flag can be hot-reloaded, meaning you can edit the file while the game is running and it will apply instantly. As long as you have an entry in the configuration at the time of launching the game, it will work just fine.
Setting multiplier to 1 temporarily disables lsfg-vk.
You should now know everything you need to use lsfg-vk. Check out these two pages if you want to know more:
If you're encountering issues with lsfg-vk in certain games, take a look at these pages:
If you're still getting used to the config system, or prefer the old system for some reason, you can still use it! These are all "legacy" environment variables:
| Variable | Recommended Value | Description |
|---|---|---|
LSFG_LEGACY |
1 | Set this to one to disable the config system and use environment variables instead. |
LSFG_DLL_PATH |
Path to Lossless.dll or unset |
If you didn't install Lossless Scaling into traditional directories, you can override the path to the Lossless.dll file within the game files using this property |
LSFG_MULTIPLIER |
2, 3, 4 | Double, triple or quadruple your FPS. You can go as high as you want. |
LSFG_FLOW_SCALE |
1.0 | Lowers the resolution of the internal image used for motion estimation. This can improve performance, although performance_mode is preferred. |
LSFG_PERFORMANCE_MODE |
true or false
|
Switches the frame generation model to much lighter one. This can massively improve performance (between 2x to 8x as fast, depending on the resolution). Loses a slight bit of quality |
LSFG_HDR_MODE |
1 when using HDR | Switches the shaders to HDR mode (scRGB not supported). Do NOT set this flag when not using HDR |
LSFG_EXPERIMENTAL_PRESENT_MODE |
vsync/fifo or mailbox or immediate
|
Overrides the present mode without altering synchronization logic. Very experimental. |
If you've used the mesa flag to override the present mode, you must now use LSFG_EXPERIMENTAL_PRESENT_MODE=fifo/vsync/immediate/mailbox instead.
Getting started:
Troubleshooting & More:
How lsfg-vk works: