VOGONS

Common searches


First post, by Dwedit

User metadata
Rank Newbie
Rank
Newbie

I've just released a tool that allows you to resize the windows of 2D Games which use GDI (edit: now Direct3D9 and DirectDraw as well). It will upscale the game using SuperXBR.
Project page: https://github.com/Dwedit/GameStretcher
Releases page: https://github.com/Dwedit/GameStretcher/releases

Instructions:
Run Launcher, and any other EXEs in the same directory will appear in a list, or click Browse to find the EXE yourself.
You can also create a shortcut to Launcher in the game directory.
Supports command line arguments, like "Launcher <program.exe> [args]" from command line or from a shortcut.
Use F11 to enter/exit fullscreen. Do not try to use any fullscreen functionality that's built-in to the game itself, it won't work properly.
Use --optimus if you want to use the NVIDIA GPU on a gaming laptop.

Screenshots:

space_cadet_pinball_original_portion.png
Filename
space_cadet_pinball_original_portion.png
File size
13.48 KiB
Views
741 views
File comment
Screenshot of Space Cadet Pinball (portion of screen)
File license
Fair use/fair dealing exception
space_cadet_pinball_upscaled_portion.jpg
Filename
space_cadet_pinball_upscaled_portion.jpg
File size
39.9 KiB
Views
741 views
File comment
Screenshot of Space Cadet Pinball (portion of the screen to demonstrate the upscaling)
File license
Fair use/fair dealing exception
minesweeper_screen_portion.png
Filename
minesweeper_screen_portion.png
File size
868 Bytes
Views
738 views
File comment
Screenshot of Minesweeper (portion of the screen)
File license
Fair use/fair dealing exception
minesweeper_screen_portion_upscaled.png
Filename
minesweeper_screen_portion_upscaled.png
File size
18.24 KiB
Views
738 views
File comment
Screenshot of Minesweeper (portion of the screen to demonstrate the upscaling)
File license
Fair use/fair dealing exception
Last edited by Dwedit on 2020-07-09, 17:21. Edited 1 time in total.

http://www.dwedit.org/

Reply 1 of 15, by ZellSF

User metadata
Rank Oldbie
Rank
Oldbie

Very nice and simple utility. I have a few problems with it though:

  1. On the three games I tested (Nectaris, Space Cadet, Wetrix) I just get a white screen until I resize the window.
  2. On two of the games I tested (Nectaris, Space Cadet), I can't get fullscreen working. The taskbar never hides and I can also see the bottom of the desktop (I have taskbar on top).
  3. With Wetrix I get a 1px line at the top that shouldn't be there.
  4. G-Sync seems to result in severe performance issues, though obviously you can just turn that off in Nvidia settings.

Any possibility for more scaling options (bilinear, nearest)? Not everyone's too fond of xBR.

Reply 2 of 15, by Dwedit

User metadata
Rank Newbie
Rank
Newbie

Got two of the issues fixed, file on Github has been updated now.
The white screen was from a mistake made during refactoring, it thought that the screen size became 0x0 for some stupid reason, I got rid of the offending code.
And the Fullscreen problem was a weird quirk with Windows providing a smaller screen height than requested, so it was about 20 pixels too short, and did not cover up the taskbar, so Windows did not want to hide the taskbar. Got it fixed, and now the taskbar gets fully covered up properly, so Windows hides it now.

I don't know what I can do about the GSync problem. This program uses Immediate presentation mode, so it tries to draw a small amount to the screen at the highest possible speed without vsync. This simulates how GDI immediately draws to the screen without any waiting or buffering in between.
But variable refresh rate displays interpret that request differently, and think that it must be a complete frame to present, and it must wait for the display to become ready.

http://www.dwedit.org/

Reply 7 of 15, by Dwedit

User metadata
Rank Newbie
Rank
Newbie

New version released. Now it's 1.0.2, and supports DirectDraw and Direct3D9 as well. Since it's no longer GDI only, I've renamed the program to GameStretcher.
Any feedback would be appreciated.

http://www.dwedit.org/

Reply 9 of 15, by Dwedit

User metadata
Rank Newbie
Rank
Newbie

Neat, what shader do you want to see? Right now, the program uses Direct3D9, so it needs to be compatible with that, haven't learned how to code for D3D10, 11, or 12 yet.

http://www.dwedit.org/

Reply 12 of 15, by Stiletto

User metadata
Rank l33t
Rank
l33t
tjcbs wrote on 2020-07-15, 02:50:
A crt shader I've been working on. It works with D3D9! […]
Show full quote

A crt shader I've been working on. It works with D3D9!

ddtod.png?dl=0
ddtodcrt.png?dl=0

Okay, but please host your images elsewhere (here is fine, or Imgur, or wherever), I am pretty sure you cannot embed images from Dropbox in the manner you attempted. You used to be able to but I think they've removed that functionality.

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 13 of 15, by Dwedit

User metadata
Rank Newbie
Rank
Newbie

One of the things Stretcher supports is small update regions, used for games that support Dirty Rectangles.

A game can redraw a tiny part of the window → Tiny region of the unscaled texture gets changed → Tiny region goes through the pixel shader → Finally, tiny region gets presented to the screen.
To support the small screen updates, I use a combination of the Scissor Rectangle and punching holes in a Z buffer. If there's just one rectangle, I use only the scissor rectangle. If there are multiple rectangles, I punch holes in the Z buffer, then use the scissor rectangle for the overall area. Once you have a scissor rectangle and/or Z buffer set up, you can draw a single big quad, and the GPU will skip drawing parts that don't need to be drawn.
Some games will do very small screen updates during idle time, for example, display a small looping animation in the corner of the screen. These games might be running at the idle screen for minutes or hours on end. If you support partial screen updates, then you don't waste CPU and GPU on updating the entire screen.

I can see that the CRT filter adds a fish-eye distortion effect to try to simulate some old TVs. That makes the step of going from Unscaled Bounding Box → Screen Bounding Box harder. But if you can come up with a function that will accurately calculate the screen bounding box, then would make small screen updates work fine.

Right now, the code isn't really set up for anything other than Linear Interpolation or one specific Two-Pass shader (superXBR), so I'd need to do a little work there for everything else. I know that RetroArch has a system for doing multi-pass shader stuff, but there are slight incompatibilities between CG and HLSL that break using RetroArch filters directly in D3D9. Single-Pass shaders are probably a lot more simple.

Additionally, the backing texture is set up as being screen sized (such as 1920x1080), with the active small screen area (possibly 320x240, 640x480, or 800x600) in the upper-left corner. UV values are set in the quad it draws so it uses the correct area. If that's a problem, I might introduce a feature that forces the texture size to match the small size.

http://www.dwedit.org/

Reply 15 of 15, by tjcbs

User metadata
Rank Newbie
Rank
Newbie
Dwedit wrote on 2020-07-15, 03:52:
One of the things Stretcher supports is small update regions, used for games that support Dirty Rectangles. […]
Show full quote

One of the things Stretcher supports is small update regions, used for games that support Dirty Rectangles.

A game can redraw a tiny part of the window → Tiny region of the unscaled texture gets changed → Tiny region goes through the pixel shader → Finally, tiny region gets presented to the screen.
To support the small screen updates, I use a combination of the Scissor Rectangle and punching holes in a Z buffer. If there's just one rectangle, I use only the scissor rectangle. If there are multiple rectangles, I punch holes in the Z buffer, then use the scissor rectangle for the overall area. Once you have a scissor rectangle and/or Z buffer set up, you can draw a single big quad, and the GPU will skip drawing parts that don't need to be drawn.
Some games will do very small screen updates during idle time, for example, display a small looping animation in the corner of the screen. These games might be running at the idle screen for minutes or hours on end. If you support partial screen updates, then you don't waste CPU and GPU on updating the entire screen.
I can see that the CRT filter adds a fish-eye distortion effect to try to simulate some old TVs. That makes the step of going from Unscaled Bounding Box → Screen Bounding Box harder. But if you can come up with a function that will accurately calculate the screen bounding box, then would make small screen updates work fine.

Nice, I like that. If you are willing to directly support my shader there is no problem deriving that function. Also, the fish bowl effect is tunable, from nothing to more extreme than what I showed.

Dwedit wrote on 2020-07-15, 03:52:

Right now, the code isn't really set up for anything other than Linear Interpolation or one specific Two-Pass shader (superXBR), so I'd need to do a little work there for everything else. I know that RetroArch has a system for doing multi-pass shader stuff, but there are slight incompatibilities between CG and HLSL that break using RetroArch filters directly in D3D9. Single-Pass shaders are probably a lot more simple.

The shader is only one pass, so that isn't an issue.

Dwedit wrote on 2020-07-15, 03:52:

Additionally, the backing texture is set up as being screen sized (such as 1920x1080), with the active small screen area (possibly 320x240, 640x480, or 800x600) in the upper-left corner. UV values are set in the quad it draws so it uses the correct area. If that's a problem, I might introduce a feature that forces the texture size to match the small size.

That is pretty standard, so no problem there either. The shader is already set up for that.