The NEW Build Your Own Arcade Controls
Software Support => GroovyMAME => Topic started by: SuperSpongo on February 17, 2020, 04:03:54 am
-
Hey guys!
I've been using CRT_Emudriver successfully for quite some time. I have a cabinet with a consumer TV as a monitor.
Recently, I aquired a new (to me) Sony CRT with a flat tube. Horizontal linearity on this tube is quite bad, there is significant warping. I saw that this problem is also present on arcade monitors etc and in general, there almost never is an option to adjust this in the service menu.
First, I thought about shaders: There are a couple of barrel distortion shaders to simulate the look of a CRT. I guess it would be possible to compensate for bad linearity by setting up a profile specific to a monitor. Let's say the picture stretches the image in the middle and compresses it on the sides. Then you'd have to set it up inverse to compensate.
Then I thought about Super Resolutions: a classic Super resolution would be 2560 horizontal. If the video signal has 256 pixels, an integer factor of 10 is applied to each of the 256 pixels. If it would now be somehow possible to modify this factor for each pixel, (use 12 for the outer pixels, 8 for the inner pixels), it would compensate the distortion once again.
My question now is: is this feasible to implement? Do you think the feature is too niche to bother? I'd really like to hear some feedback!
-
Your idea of using shaders to compensate for bad horizontal linearity is pure genius.
Using super resolutions by itself can't fix that. You need to create a shader that is able to scale the way you need without degrading the picture in any other way.
My question now is: is this feasible to implement? Do you think the feature is too niche to bother? I'd really like to hear some feedback!
I'd say it's feasible and too niche at the same time. But I promise to include this feature in GM if someone figures out how to do it.
Too little time and too many fronts for me unfortunately.
-
Most of sony tvs have a system menu .
-
Hi and thanks for the quick reply Calamity! Again, I love the project!
I took a look at the Barrel Distortion Shader (completely new to all this) and they are made in OpenGL and seem not overly complicated... maybe I'll try to get something going if I find the time :dunno
@Substring: True, most Sony TVs and PVMs have a service menu, but like I mentioned earlier, almost no TV has the option of modifying horizontal linearity, only vertical to an extent.
-
Going the shaders way is really pure genius idea ... But, If I'm not wrong, this would only be worth with super resolutions, not genuine resolutions such as 320x240 I guess ?
-
Going the shaders way is really pure genius idea ... But, If I'm not wrong, this would only be worth with super resolutions, not genuine resolutions such as 320x240 I guess ?
320 isn't more genuine than 2560. You still hold unfounded prejudices against super resolutions ;)
-
That doesn't answer the real question : shaders should be more efficient on a super resolution than on a non super resolution. Right ?
-
That doesn't answer the real question : shaders should be more efficient on a super resolution than on a non super resolution. Right ?
Yes, they're only viable on a super resolution, the wider the better.
-
Yes, the way I see it, the picture has to have the space to compress and expand. Which is not the case using 1:1 pixels horizontally.
Do you guys know of anyone who is knowledgeable in writing shaders? My guess is that this effect should not be a huge deal to implement, but getting it configurable will most likely involve modifying code and recompiling...
EDIT
@Calamity, would HLSL shaders be the way to go to implement in Groovymame or is there another way?
https://docs.mamedev.org/advanced/hlsl.html
Source:
https://github.com/mamedev/mame/tree/master/hlsl
Right now I'm thinking (maybe naively) that it might be doable to use for example the cubic distortion and expand it to apply not on the whole width of the picture, but on ten or so different zones. That might give enought flexibility already. Using the Super resolution 2560 as an example again, maybe 10 zones of 256pixels each, or 5 of 512...