Page 1 of 1

Gamma correction over VGA

Posted: Fri Jun 19, 2020 1:12 am
by colonel panic
When I use VGA output with my MiSTer, either with a direct video dongle or using the I/O board's VGA output, the filters are disabled but the gamma correction setting is not. Can the gamma be changed to work like the filters? It's useful for example to be able to have the raw 240p image sent to a PVM, and the filtered and gamma corrected image simultaneously sent to a modern display for calibration purposes. Plus in general it's a minor annoyance to remember to switch the gamma settings for each core you're gonna use every time you switch between different displays lol

Re: Gamma correction over VGA

Posted: Tue Jun 23, 2020 2:47 am
by ash2fpga
colonel panic wrote: Fri Jun 19, 2020 1:12 am Can the gamma be changed to work like the filters?
You could possibly recreate a limited subset of filter functionality in a gamma LUT. They tend to be rather different beasts, however. (And in reverse, a gamma LUT can have more granularity than could be reproduced with a filter, due to the phase count [and tap count?] of filters.)

The filters are "generic 4 tap, 16 phase polyphase filter[s]", which let you implement various resampling [e.g., upscaling/downscaling] algorithms such as lanczos, catmull-rom, etc.; while gamma tables are transformation LUTs, basically for a given color channel (red, green, or blue), when you see this value as input, replace it with this other value as output. (The gamma tables appear to be relatively simple 1D LUTs with one table [not sure if luminance, or shared R/G/B values], and not separate R/G/B values.)

The filters allow neighboring pixels to have different values from each other (e.g., to derive image "resolution" [detail] where there was not in the original source for upscaling, or to blur or combine pixels together for downscaling), while the gamma LUTs operate on a per-pixel basis.

https://github.com/MiSTer-devel/Filters_MiSTer

Re: Gamma correction over VGA

Posted: Tue Jun 23, 2020 8:30 am
by Jeruro
I use gamma correction over VGA ...

Re: Gamma correction over VGA

Posted: Tue Jun 23, 2020 11:20 pm
by colonel panic
ash2fpga wrote: Tue Jun 23, 2020 2:47 am
colonel panic wrote: Fri Jun 19, 2020 1:12 am Can the gamma be changed to work like the filters?
You could possibly recreate a limited subset of filter functionality in a gamma LUT. They tend to be rather different beasts, however. (And in reverse, a gamma LUT can have more granularity than could be reproduced with a filter, due to the phase count [and tap count?] of filters.)
I think you misunderstand me. With different mister.ini settings, it's possible to disable the scaler, and therefore the filters, over VGA. I was wondering if there was a way to extend this functionality to the gamma correction as well.

Jeruro wrote: Tue Jun 23, 2020 8:30 am I use gamma correction over VGA ...
I can definitely see the need for using gamma correction over VGA, like if you use an older flat-panel monitor, but it would be nice to have the option to disable it, while still being able to simultaneously use it over HDMI. The use-cases are uncommon, I know, but I figured I'd put it out there and ask if there was already some way to do this that I wasn't aware of, or if it's easy for a dev to implement.

Re: Gamma correction over VGA

Posted: Tue Jun 23, 2020 11:47 pm
by ash2fpga
colonel panic wrote: Tue Jun 23, 2020 11:20 pm I think you misunderstand me. With different mister.ini settings, it's possible to disable the scaler, and therefore the filters, over VGA. I was wondering if there was a way to extend this functionality to the gamma correction as well.
Ah, yes, sorry, my mistake. :oops: My guess is the framework (and the individual cores) would need to support that.