Page 1 of 2

edge distortion fix/plugin

Posted: 03 Aug 2009, 12:00
by Racer_S
after testing the new iRacing triplewide support i had the idea to try to fix the fisheye distortion effect with some other games... i went in photoshop and tried a few filters,notably 'spherize' which seems to correct the edge distortion. I figured, why not make a directx filter that does this in realitime like the Sol7 software, except it will be free.

the only drawbacks I can see if that the overall picture will be zoomed by some degree and it will not be pixel perfect anymore, also hud elements will be distorted as well.

I've already demonstrated it is possible with a proxy dll but i havent written any code that duplicates what the spherize filter in photoshop does yet.

check out these two screenshots, one without filtering, one with...

without spherize


with spherize

edge distortion fix/plugin

Posted: 03 Aug 2009, 12:15
by thales100
Wow , thats fantastic ! :D

edge distortion fix/plugin

Posted: 03 Aug 2009, 18:15
by scavvenjahh
Exciting stuff indeed, although I don't mind if there's some distortion on the outer edges of my side monitors - but I do mind losing vertical FOV.

edge distortion fix/plugin

Posted: 03 Aug 2009, 18:46
by GeneralAdmission
Wow wow wow! This is fantastic stuff, Racer_S. I would love to play around with such a tool.

Why in the world do the vast majority of 3D games employ a fisheye camera? Humans don't see the world spherically, and it's always made games look a little "off" to me. Is it just easy to program a camera that way?

I could probably adjust to a little Vert FOV loss...considering it's not nearly as bad as most Vert- games in TH. I'm assuming that some/most Vert- hacks/fixes/mods could be tweaked a little to compensate for the filter's effect.

If you get this working well and release it into the wild, I'd say that the top 10 publishers all owe you a graphics card this time. ;) :D

edge distortion fix/plugin

Posted: 03 Aug 2009, 21:47
by redgun
great work. Looks very nice.

however, this edge looks kinda weird. I'm not sure if i would notice that while gaming but in the screen shot it confuses me.



unfortunately a fix like that could only be used in SP games :(

edge distortion fix/plugin

Posted: 03 Aug 2009, 23:00
by whismerhill
nice seems to correct a few discripencies
however the end result is not perfect either
for example the sides of the building on the left are not straight anymore...

and I think a real time effect like that would be rather weird if some straight buildings or other stuff bend on the sides ...

that said it's only my opinion since I'm no TH user anyway ;)

edge distortion fix/plugin

Posted: 04 Aug 2009, 03:21
by Ryom
http://www.cambridgeincolour.com/tutorials/image-projections.htm

edge distortion fix/plugin

Posted: 04 Aug 2009, 04:22
by MobsterOO7
Racer_S, this is very cool. VERY COOL. It's really too bad about the HUD getting borked though.

Now all we need is for some devs to implement something like this.

edge distortion fix/plugin

Posted: 04 Aug 2009, 15:41
by BHawthorne
Doesn't SoftTH have some spherical correction built in? I remember seeing it when I played around with it awhile back in Warhammer Online.

edge distortion fix/plugin

Posted: 04 Aug 2009, 18:05
by GeneralAdmission
Doesn't SoftTH have some spherical correction built in? I remember seeing it when I played around with it awhile back in Warhammer Online.

I just looked at their site the other day. Apparently SoftTH allows you to render extra lines of resolution on either side of the image, essentially displacing the most distorted part of the image outside the visible screen area.

If I'm completely wrong please correct me. :P

edge distortion fix/plugin

Posted: 05 Aug 2009, 17:39
by BHawthorne
Here's a snipit of the config file for SoftTH. Might be worth looking into the multiple methods it uses.

Code: Select all

[Direct3D]

   ; ** Advanced setting for Direct3D games **
   ; lensCorrection: Lens correction, set to 1 to enable support. >1 to enable by default
   ; lensCorrectionEdge: Lens correction edge offset
   ; hideNondefaultDevices: Hides all but the default adapter from the game
   ; forceHorizontalFOV: Forces horizontal FOV to be three times as wide
   ; forceResolutionWidth/Height: Forces device to be created with this resolution
   ; force16bitDepth: Force game to use 16bit depth buffer, can improve performance and reduce memory use
   ; sleepBeforeRead: Time in ms to sleep before reading back buffer data from video card
   ; useMultihead: Uses multihead features of primary card if available, can increase performance and reduce memory use
   ; delayedPresent: When useMultihead enabled, delay primary monitor present to sync with secondary head
   ; d3d8dll: Path to D3D8.dll/D3D9.dll to use or auto for automatic (system32 dir)
   ; altResetBehaviour: Do not reset lost main device after secondary device initialization (WDDM crash workaround)
   lensCorrection=0
   lensCorrectionEdge=0
   hideNondefaultDevices=0
   forceHorizontalFOV=0
   forceResolutionWidth=0
   forceResolutionHeight=0
   force16bitDepth=0
   sleepBeforeRead=2
   useMultihead=1
   delayedPresent=0
   autoSquash=0
   altResetBehaviour=0
   d3d8dll=auto


My curiousity is the methods used for lensCorrection, lensCorrectionEdge, forceHorizontalFOV, autoSquash?

edge distortion fix/plugin

Posted: 06 Aug 2009, 02:53
by Leapo
forceHorizontalFOV attempts to force a games FOV to expand by 3 times. Better do use a games own settings if at all possible.

autoSquash attempts to detect when only 2D elements are on screen (like menus), and if it does, squishes the output to the center monitor. This helps with stretched menus in games like Bioshock.

Lens correction is the one you want. It can do pretty much what Racer_S has done in photoshop, but with one important difference. It can do it without stretching the HUD. The effect is only applied to 3D rendered elements.

edge distortion fix/plugin

Posted: 06 Aug 2009, 03:53
by GeneralAdmission
Lens correction is the one you want. It can do pretty much what Racer_S has done in photoshop, but with one important difference. It can do it without stretching the HUD. The effect is only applied to 3D rendered elements.

Dost I detect one Holy Grail? Or at least a pretty goblet? :wink:

edge distortion fix/plugin

Posted: 14 Aug 2009, 02:07
by geniv2
Racer_S never cease to amaze me!
this is amazing

edge distortion fix/plugin

Posted: 14 Aug 2009, 04:22
by Leapo
[quote]Lens correction is the one you want. It can do pretty much what Racer_S has done in photoshop, but with one important difference. It can do it without stretching the HUD. The effect is only applied to 3D rendered elements.

Dost I detect one Holy Grail? Or at least a pretty goblet? :wink:
Sure, if you want to throw your your TripleHead2Go and join the SoftTH club :wink:

edge distortion fix/plugin

Posted: 14 Aug 2009, 16:30
by WaveZtream
Why did I even buy a damn TH2GO if the softTH does the job better? Shame on me lol

edge distortion fix/plugin

Posted: 26 Aug 2009, 21:58
by suiken_2mieu
Why did I even buy a damn TH2GO if the softTH does the job better? Shame on me lol

it was an easier setup and is compatible with more games. =P

edge distortion fix/plugin

Posted: 27 Aug 2009, 02:00
by Leapo
"Easier to set up" is debatable. Look at all the problems some people are having with the TH2G and specific drivers, and the fact that you have to make sure your screens support 57Hz if you want to run 5040x1050.

SoftTH doesn't have these hardware and driver compatibility issues, and supports resolutions upwards of 7680x1600, but it only works with DirectX8 and DirtectX9 applications (OpenGL version pending).

There's always a catch, no matter what solution you use.

edge distortion fix/plugin

Posted: 30 Aug 2009, 22:43
by mattsimis
Why did I even buy a damn TH2GO if the softTH does the job better? Shame on me lol


I thought it was common knowledge SoftTH did this. I was playing with it before I got my TH2G 6mths ago. The Lens Correction works (though like Racer-S's solution it zooms the image) and IRC it can be adjusted on the fly to allow some compromise.

It wasnt enough for me to put up with lower colour depth and obviously laggy sidescreens as well as obscure per game INI settings to keep it over a hardware solution like TH2G. I would however be interested in something that added Lens Correction to TH2G!

edge distortion fix/plugin

Posted: 31 Aug 2009, 16:58
by Leapo
It wasnt enough for me to put up with lower colour depth and obviously laggy sidescreens as well as obscure per game INI settings to keep it over a hardware solution like TH2G. I would however be interested in something that added Lens Correction to TH2G!
The side screens have never been laggy with SoftTH as long as you have enough bandwidth for your two video cards to communicate with one another. You're also not forced to run lower bit-depth on your side screens, you can set it to 32bit color if you want. I'm using a PCIe 16x 8400GS to run one of my side screens, which seems to do the trick just fine.

There's also the CUDA based frame copy method inroduced in the latest version for Nvidia cards, which pretty much eliminates the possibility of any side screen lag and boosts performance hugely.