Lossless Scaling under Linux to enable frame generation for Factorio

Enhance your gameplay with these tools. This category is also the right place for tools useful for modders.
Mod databases, calculators, cheatsheets, multiplayer, scripts, libs and other useful stuff that is not strictly in-game mods.
User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1631
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Lossless Scaling under Linux to enable frame generation for Factorio

Post by jodokus31 »

I was trying the new port for Lossless Scaling under Linux:
https://github.com/PancakeTAS/lsfg-vk

Caution: It directly uses the Lossless Scaling tool for Windows, which has to be bought from Steam for like $7

The goal is to run Factorio with 120Hz, while each other frame is generated. This should offer a more fluid experience, esp. on LCD monitors, which can get quite blurry on 60Hz.

lsfg-vk only works with the Vulkan Layer and Factorio works with OpenGL, afaik.

Windows users probably can use Lossless Scaling directly

But, The mesa library offers Zink, which transforms OpenGL to Vulkan.
I'm not sure, if that is an AMD GPU only thing

I called it like this:

Code: Select all

__GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink LIBGL_KOPPER_DRI2=1 factorio
Testing Zink standalone seems to work quite flawlessly (I see some warnings...)

Now, packing all that together. I installed "lsfg-vk" as described on its github Wiki.
For the ~/.config/lsfg-vk/conf.toml I filled it like this.

Code: Select all

version = 1
[global]
# override the location of Lossless Scaling
dll = "[..]/Steam/steamapps/common/Lossless Scaling/Lossless.dll"

[[game]] # default vkcube entry
exe = "vkcube"

multiplier = 4
performance_mode = true

[[game]] # default benchmark entry
exe = "benchmark"
#enable = true

multiplier = 4
#performance_mode = true

[[game]] # override Factorio
exe = "Factorio2SA"
multiplier = 2
Now switching my monitor to 120Hz and start it like this:

Code: Select all

LSFG_PROCESS=Factorio2SA __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink LIBGL_KOPPER_DRI2=1 factorio
I use the method via LSFG_PROCESS described on the wiki

And voila, it clearly works. The motion blur when moving is much better. The framerate is also very stable

However, I have some issues, when closing factorio, then it throws an error. And its sometimes problematic to restart factorio as it crashes. It doesn't seem to be connected to Zink itself, but rather lsfg-vk.
I also did not play longer sessions with it, so I don't know, how stable it is.

I thought, I share my experience and maybe some brave players want to try it as well
User avatar
pioruns
Fast Inserter
Fast Inserter
Posts: 186
Joined: Tue Nov 05, 2024 3:38 pm
Contact:

Re: Lossless Scaling under Linux to enable frame generation for Factorio

Post by pioruns »

While I applaud your efforts, the harsh truth I think is that such a tool should be open source. I doubt many people will pay $7 for a proprietary Windows tool obtainable via Steam, to install it alongside another piece of code on Linux system, to have some benefit while playing.
User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1631
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Re: Lossless Scaling under Linux to enable frame generation for Factorio

Post by jodokus31 »

pioruns wrote: Mon Jul 21, 2025 9:41 pm While I applaud your efforts, the harsh truth I think is that such a tool should be open source. I doubt many people will pay $7 for a proprietary Windows tool obtainable via Steam, to install it alongside another piece of code on Linux system, to have some benefit while playing.
Lossless Scaling seems to be quite popular and the Linux port also has a bit of attention. Maybe someone already owns it and wants to try it with the Linux port.

The double framerate is also quite a big deal, IMO, at least for some people. Not that I'm a high framerate junky, I play most other 3D games with 60Hz, but Factorio makes quite a difference in motion clarity, because it's packed with small details, which get blurry on my monitor when moving
User avatar
pioruns
Fast Inserter
Fast Inserter
Posts: 186
Joined: Tue Nov 05, 2024 3:38 pm
Contact:

Re: Lossless Scaling under Linux to enable frame generation for Factorio

Post by pioruns »

I wonder how hard would it be for Factorio devs to implement higher FPS? I'd love that, I have 4K 144Hz monitor, yet running good'ol Factorio at 60 FPS.
KillingTimeItself
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sat Aug 26, 2023 8:43 pm
Contact:

Re: Lossless Scaling under Linux to enable frame generation for Factorio

Post by KillingTimeItself »

on the topic of native implementation, from what i can recall the game is designed to lock FPS to the UPS in most cases, very rarely do they break away. I'm not sure how trivial it would be to divorce the two.

You can have a lower FPS than UPS, but i've never seen the opposite. I'm not sure how implementing something like a 120FPS cap would work, at best you would need to make significant changes to the rendering engine (clean up weird bugs and stuff) at worst it's not possible without a rewrite.
Post Reply

Return to “Tools”