Aspect ratio stretch pre-upscale or post-upscale?

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
elvisish
Posts: 55
Joined: Tue Mar 12, 2013 5:43 pm

Aspect ratio stretch pre-upscale or post-upscale?

Post by elvisish »

I'm interested in how ScummVM actually performs the aspect ratio stretch so each pixel is 1.2 tall. Is this done pre-upscale and then scaled up to full screen, or is it always performed on the up-scale? Otherwise, Guybrush would look like "forced aspect correction":
Image

So how exactly is it done?
elvisish
Posts: 55
Joined: Tue Mar 12, 2013 5:43 pm

Re: Aspect ratio stretch pre-upscale or post-upscale?

Post by elvisish »

Thanks, but I can't read that. Can you tell me which order the stretching occurs?
User avatar
ezekiel000
Posts: 443
Joined: Mon Aug 25, 2008 5:17 pm
Location: Surrey, England

Re: Aspect ratio stretch pre-upscale or post-upscale?

Post by ezekiel000 »

The comments in those two source files seem to explain what the process is, it's in plain English.
Comments are the lines that start with // or * (in between /** & */
User avatar
criezy
ScummVM Developer
Posts: 955
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Aspect ratio stretch pre-upscale or post-upscale?

Post by criezy »

Those two files will only give a partial answer (which I already gave here). This actually depends on the graphics mode and stretch mode selected in the options.

If you select the OpenGL graphics mode, then all the scaling and stretching, including the aspect ratio correction, is done in one pass (to go from original game size to final display size).

If you select any other graphics mode though, then it is done in three steps:
  1. First apply the graphics mode scaling (2x or 3x, unless the graphics mode is Normal).
  2. Then apply the aspect ratio correction stretch.
  3. And finally apply the stretch mode to fill the screen (if the stretch mode is Center there is no scaling or stretching in this step as it will only add black bars to fill the space, but otherwise there might be one).
elvisish
Posts: 55
Joined: Tue Mar 12, 2013 5:43 pm

Re: Aspect ratio stretch pre-upscale or post-upscale?

Post by elvisish »

criezy wrote: Wed Dec 12, 2018 8:19 am Those two files will only give a partial answer (which I already gave here). This actually depends on the graphics mode and stretch mode selected in the options.

If you select the OpenGL graphics mode, then all the scaling and stretching, including the aspect ratio correction, is done in one pass (to go from original game size to final display size).

If you select any other graphics mode though, then it is done in three steps:
  1. First apply the graphics mode scaling (2x or 3x, unless the graphics mode is Normal).
  2. Then apply the aspect ratio correction stretch.
  3. And finally apply the stretch mode to fill the screen (if the stretch mode is Center there is no scaling or stretching in this step as it will only add black bars to fill the space, but otherwise there might be one).
Thanks, that's very helpful! So, how do the mouse interactions such as clicks or hover highlights work after it's been scaled? If this is a post-processing stretch, how are the cursor interaction positions accounted for after the scaling?
User avatar
criezy
ScummVM Developer
Posts: 955
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Aspect ratio stretch pre-upscale or post-upscale?

Post by criezy »

Basically the game engine knows nothing about the stretch. All it knows about is the original game resolution, for example 320x200 pixels. So it will draw at that resolution and pass this to the backend. The backend is responsible for the interaction with the computer, phone or other device on which you are running ScummVM. It will handle the scaling, aspect ratio correction and stretching, and display the result on the screen. It also gets cursor position in the screen coordinates from the system and convert that back to the original game coordinates before passing the information to the game engine.
Post Reply