Gamma correction over VGA
- colonel panic
- Posts: 53
- Joined: Mon May 25, 2020 1:54 pm
- Been thanked: 2 times
Gamma correction over VGA
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
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
- colonel panic
- Posts: 53
- Joined: Mon May 25, 2020 1:54 pm
- Been thanked: 2 times
Re: Gamma correction over VGA
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.ash2fpga wrote: ↑Tue Jun 23, 2020 2:47 amYou 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 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
Ah, yes, sorry, my mistake. My guess is the framework (and the individual cores) would need to support that.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.