The International Simutrans Forum

 

Author Topic: [121-0] SDL looking blurry on standard zoom  (Read 574 times)

0 Members and 1 Guest are viewing this topic.

Offline Flemmbrav

  • Devotee
  • *
  • Posts: 248
  • PAK-DEV P192C
  • Languages: DE, EN
[121-0] SDL looking blurry on standard zoom
« on: August 14, 2020, 02:25:43 PM »
Hey hey,

this has been a thing on my computer for a long time.
I use Windows 10 1909 with Simutrans 121-0 64bit.
The bug also appears in extended 14.11 #7d2b8a8. For that see: https://forum.simutrans.com/index.php/topic,19639.0.html

It's best explained by looking at a similiar image in SDL and GDI:
First, the GDI screenshot.
This is how I want our pakset to look like without any zoom.
Every pixel on the original png file is displayed as a single pixel in the game as well.


Second, this is how SDL looks like on my computer:
The game still displays 192 pixel as 192 pixel wide.
But the pixels itself are blurry.
A pixel in the png file is NOT represented by one pixel in the game, but also affects the surrounding pixels in the game.
This may look good on rendered paksets, but does not look as pleasing as the normal image in a comic pakset.
In plus this makes the simutrans versions look different.


The whole thing does also affect fonts:

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 10542
  • Languages: De,EN,JP
Re: [121-0] SDL looking blurry on standard zoom
« Reply #1 on: August 15, 2020, 12:17:18 PM »
I suppose this is Windows with SDL2 on a large monitor, homecopiled (because we do not distribute x64 builds)? Then SDL2 may have set the flag that Windows should scale this to full screen. I use may own compiled SDL2 (since otherwise static linking fails) and hence no scaling.

You may be able to change it in Simutrans compatibility settings. (Right click, properties, tab compability, high dpi settings, Aktivate overwrite settings, use mode "by application" from drop down.) This is transalted from German windows though ...

If you compile with MSVC, then you go the the project properties, Manifest tool, Input Output, Dpi Aware to High Dpi Aware (https://nlguillemot.wordpress.com/2016/12/11/high-dpi-rendering/)

But I wrote it in the manifest, so if you link on MinGW using the manifest, it should work as well (unless SDL2 make an extra call to ask windows for scaling). However, this fails, when you have two monitors with different scaling and the Simutrans windows was on both (even minimizing may trigger this). Given that even MS word chokes on this (get blurrz), I am not sure how to solve this latter issue.
« Last Edit: August 15, 2020, 12:31:54 PM by prissi »

Offline Flemmbrav

  • Devotee
  • *
  • Posts: 248
  • PAK-DEV P192C
  • Languages: DE, EN
Re: [121-0] SDL looking blurry on standard zoom
« Reply #2 on: August 15, 2020, 04:42:09 PM »
You're right, only my pc is 64bit -  the game itself is directly from here clicking on the SDL link for windows: https://www.simutrans.com/en/download/

Quote
But I wrote it in the manifest, so if you link on MinGW using the manifest, it should work as well (unless SDL2 make an extra call to ask windows for scaling). However, this fails, when you have two monitors with different scaling and the Simutrans windows was on both (even minimizing may trigger this). Given that even MS word chokes on this (get blurrz), I am not sure how to solve this latter issue.
While I do have multiple monitors on my system, all of them scale with 100%. It also appears when I start the game without extra monitors plugged with just my laptop screen being left.

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 10542
  • Languages: De,EN,JP
Re: [121-0] SDL looking blurry on standard zoom
« Reply #3 on: August 16, 2020, 12:49:14 PM »
Strange, these are only 32 bit nightlies and executable generated there. I do not do 64 bit builds. And those files have the manifest. Does it go away when setting the scaling options as described above?

We had also for some time a one off error in SDL. Is it a nightly?

Offline Flemmbrav

  • Devotee
  • *
  • Posts: 248
  • PAK-DEV P192C
  • Languages: DE, EN
Re: [121-0] SDL looking blurry on standard zoom
« Reply #4 on: August 16, 2020, 02:27:41 PM »
Running it on my Intel GPU fixed it.
My system has an Intel GPU and a NVIDIA one. Using the default Nvidia one creates these blurry graphics.
I'll try updating my Nvidia drivers and will report back after.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5689
  • Languages: EN, NO
Re: [121-0] SDL looking blurry on standard zoom
« Reply #5 on: August 16, 2020, 05:43:34 PM »
I know Nvidia has some scaling options beyond what Windows knows about, but I have never seen these affect other things that full screen applications.