vpinball / libdmdutil

A cross platform library for performing DMD tasks.
Other
2 stars 7 forks source link

Scaling not great? #2

Closed francisdb closed 8 months ago

francisdb commented 8 months ago

https://github.com/PPUC/libzedmd/issues/13 mentions that the issue is probably here?

This is Baywatch:

192x64 rendered to 128*32

image

toxieainc commented 8 months ago

When i last looked at the code, some scaling code was using bilinear lookups, but this will only have a positive effect when upscaling. For downscaling, one must do an averaging of the downscaled pixels. The problem is that with these very low resolutions and non-integer scalings, the result will also suck. So what i did for pinmame (when adapting the external dmd driver code) was to downscale in y-direction via averaging (to go from 192x64 to 192x32 by averaging 2 rows into one) and then only averaging 2/3s of the pixels in x-direction, and leaving 1/3 untouched/as-is (to go to 128x32). Also not optimal, but was the best tradeoff in my experiments.

jsm174 commented 8 months ago

Scaling / aspect ratio centering is only for Pixelcade which we do in this library. I added it at the last moment as I realized some games would not work on it. I'm no expert on this topic 😄

@francisdb is showing a ZeDMD device I believe, and ZeDMD firmware and or libzedmd handles all the scaling.

@mkalkbrenner could elaborate on this more?

francisdb commented 8 months ago

I asked @mkalkbrenner before and he told me the scaling is done here 🤔

jsm174 commented 8 months ago

All I can say is if you look at the code in this repo, there is no scaling done on the frame for the zedmd path.