Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Using Super Resolutions to compensate for bad horizontal linearity  (Read 2797 times)

0 Members and 1 Guest are viewing this topic.

SuperSpongo

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:January 29, 2024, 03:28:19 am
  • I want to build my own arcade controls!
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!

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7411
  • Last login:March 14, 2024, 05:26:05 am
  • Quote me with care
Re: Using Super Resolutions to compensate for bad horizontal linearity
« Reply #1 on: February 17, 2020, 01:35:07 pm »
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.

Quote
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.

Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

Substring

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 816
  • Last login:March 23, 2024, 02:35:43 pm
  • Forking GroovyArcade
    • forum.arcadecontrols.com/index.php/topic,160023.0.html
    • GroovyArcade active fork
Re: Using Super Resolutions to compensate for bad horizontal linearity
« Reply #2 on: February 17, 2020, 01:38:39 pm »
Most of sony tvs have a system menu .

SuperSpongo

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:January 29, 2024, 03:28:19 am
  • I want to build my own arcade controls!
Re: Using Super Resolutions to compensate for bad horizontal linearity
« Reply #3 on: February 18, 2020, 02:57:45 am »
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.

Substring

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 816
  • Last login:March 23, 2024, 02:35:43 pm
  • Forking GroovyArcade
    • forum.arcadecontrols.com/index.php/topic,160023.0.html
    • GroovyArcade active fork
Re: Using Super Resolutions to compensate for bad horizontal linearity
« Reply #4 on: February 18, 2020, 04:48:39 am »
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 ?

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7411
  • Last login:March 14, 2024, 05:26:05 am
  • Quote me with care
Re: Using Super Resolutions to compensate for bad horizontal linearity
« Reply #5 on: February 18, 2020, 06:14:28 am »
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 ;)
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

Substring

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 816
  • Last login:March 23, 2024, 02:35:43 pm
  • Forking GroovyArcade
    • forum.arcadecontrols.com/index.php/topic,160023.0.html
    • GroovyArcade active fork
Re: Using Super Resolutions to compensate for bad horizontal linearity
« Reply #6 on: February 18, 2020, 09:38:45 am »
That doesn't answer the real question : shaders should be more efficient on a super resolution than on a non super resolution. Right ?

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7411
  • Last login:March 14, 2024, 05:26:05 am
  • Quote me with care
Re: Using Super Resolutions to compensate for bad horizontal linearity
« Reply #7 on: February 18, 2020, 10:57:58 am »
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.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

SuperSpongo

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:January 29, 2024, 03:28:19 am
  • I want to build my own arcade controls!
Re: Using Super Resolutions to compensate for bad horizontal linearity
« Reply #8 on: February 19, 2020, 02:49:13 am »
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...
« Last Edit: February 19, 2020, 04:52:35 am by SuperSpongo »