Slow OpenGL mode in SCUMM

Ask for help with ScummVM problems

Moderator: ScummVM Team

User avatar
criezy
ScummVM Developer
Posts: 549
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Post by criezy » Thu Oct 11, 2018 5:24 pm

Oh. Without even looking at the images I know what you mean.

This is related to what I explained in this post. When using OpenGL the aspect ratio correction and stretching is done all in one pass, respecting the "Filter graphics" option. But in SDL mode the aspect ratio correction is done first (for example to go from 320x200 to 320x240) and then the stretching is done in a second pass. The "Filter graphics" option then only impacts the second pass.

It is actually possible to change the interpolation done for the aspect ratio correction in SDL graphics modes by changing this line of code (for example using kSuperFastAndUglyAspectMode to get nearest neighbor interpolation) and recompiling the code. However this is not going to be perfect due to image being scaled in two passes.

Ideally we should change the way the SDL graphics modes handle aspect ratio so that it works in a way similar to OpenGL. This is something that I have plans to work on as part of some changes I am working on in the way we handle aspect ratio correction (to handle corrections different from the 6:5 correction we currently always do - as is explained in this pull request). However I have not had much time lately to make progress on that :(

UrQuan
Posts: 12
Joined: Wed Oct 10, 2018 5:27 am

Post by UrQuan » Fri Oct 12, 2018 7:12 am

criezy wrote:Oh. Without even looking at the images I know what you mean.

This is related to what I explained in this post. When using OpenGL the aspect ratio correction and stretching is done all in one pass, respecting the "Filter graphics" option. But in SDL mode the aspect ratio correction is done first (for example to go from 320x200 to 320x240) and then the stretching is done in a second pass. The "Filter graphics" option then only impacts the second pass.

It is actually possible to change the interpolation done for the aspect ratio correction in SDL graphics modes by changing this line of code (for example using kSuperFastAndUglyAspectMode to get nearest neighbor interpolation) and recompiling the code. However this is not going to be perfect due to image being scaled in two passes.

Ideally we should change the way the SDL graphics modes handle aspect ratio so that it works in a way similar to OpenGL. This is something that I have plans to work on as part of some changes I am working on in the way we handle aspect ratio correction (to handle corrections different from the 6:5 correction we currently always do - as is explained in this pull request). However I have not had much time lately to make progress on that :(
I wish you good luck with that. It would kill two birds with one stone and you would have my eternal gratitude as well :wink:

One thing I have to ask: Would it be possible to implement a 4x scaler.... A. as a stop-gap measure (assuming the fixed aspect ratio correction won't happen for a while) and B. to compliment the pixel-perfect stretch mode.

Currently 3x and pixel-perfect stretch mode at 1080p is obviously the same as playing with "centered" or windowed, which is too small. On 2x it doubles the window size but because of that same aspect ratio issue we run into more scaling artifacts. Having a native 4x scaler, while not 100% sharp because of the aspect ratio issue, would at least produce a reasonable image, "good enough" and big enough for 1080p.

From what I've read, the 4x or 5x scaling issue comes up every once in a while, but those requests were ultimately shut down since the whole scaling system was to be replaced with some more flexible like this: https://github.com/scummvm/scummvm/pull/1255

Do you think this will arrive sometime in the near future, or if not, same question: could a 4x scaler be implemented as a stop-gap measure?

Post Reply