Google Cardboard HMD - SweetFX VR Correction Shader Suite

Talk about Head Mounted Displays (HMDs), augmented reality, wearable computing, controller hardware, haptic feedback, motion tracking, and related topics here!
Fortran
One Eyed Hopeful
Posts: 11
Joined: Tue May 12, 2015 7:50 am

Google Cardboard HMD - SweetFX VR Correction Shader Suite

Post by Fortran »

After several weeks of playing various PC titles with my Google Cardboard VR setup (LG G3 phone + Zeiss VR ONE HMD) mostly with vireio perception and thoroughly enjoying it I decided to try some other non vireio perception supported games such as DX10/11 titles some of which have native SBS (such as Elite Dangerous) and some of which require TriDef. The thing I instantly missed was the lens and aspect ratio correction, not to mention chromatic aberration correction so I decided to try and create a better experience for myself using some custom SweetFX shaders. I'm very new to writing shaders in general so as such there are probably mistakes which could be tidied up but regardless everything is working fine anyway.

The base shader HLSL snippets I adapted these from for SweetFX are mostly from freely available examples I found around the net for the DK1. As such this is not a proper "mod" release or anything of that nature, I just decided to make my personal work available for those who might find it useful, I won't really be supporting this or updating it, everything required is in the folder and can be tweaked further or totally re-written as you wish.

As any of us who use non-Oculus Rift HMD solutions know (outside of vireio perception), there is no way of dealing with lens correction (unless you stream with Trinus VR) and having to run every game with double width resolution to get the correct aspect ratio can be a bit of a pain. The result is a SweetFX based tool kit which basically works with any game that SweetFX can be run with. There are two shader files, one is targeted at games running their own native SBS stereo and the other is specifically targeted at TriDef and will correct for any game you run with it, by using either one or the other you should be able to get aspect ratio correction,lense distortion correction (barrel distortion) + Cromatic Aberration correction working for your own HMD with whichever game you like that is capable of supporting 3D either natively or with TriDef and can support SweetFX.

These shaders allow for the following (and one or two other things too):


- Barrel Distortion
- Vignette on/off
- Aspect Ratio Correction on/off
- ScaleFactor (larger or smaller)
- Chromatic Aberration Correction
- Distortion Scaling (Can be tweaked for various lenses)


Here are a few screenshots of it in-game, all effects can be configured or tweaked in the shader files themselves and are commented:


All effects ON
Image

Vignette OFF
Image

Scaling
Image

Chromatic Aberration (exaggerated settings to show separation)
Image

Aspect Ratio Correction OFF
Image

Anyway hope this of some use to those who stream PC games to their HMD's, as I said before I only created this for my own needs but thought it could be handy for others in the same boat.

Installation and tweaking instructions are included in the readme:
D/L LINK: https://dl.dropboxusercontent.com/u/916 ... _LENSE.zip
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by cybereality »

Nice work.
User avatar
Hannibalj2
Binocular Vision CONFIRMED!
Posts: 300
Joined: Sun May 26, 2013 2:45 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Hannibalj2 »

Very cool!
Portal Dual 180+ HFOV HMD: http://www.mtbs3d.com/phpBB/viewtopic.php?f=26&t=18335

PORTAL DUAL VR, Downloads: http://hannibalj2.jimdo.com/
budda
Sharp Eyed Eagle!
Posts: 388
Joined: Thu May 22, 2008 9:13 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by budda »

Hi,

Just a quick question.

Should not the chromatic aberration 'fix' example show the blue shift toward the outside and red shift toward the centre of the image. :?

The lens would be expected to reverse the shift to correct the colour shift in the image.


Thanks.
Fortran
One Eyed Hopeful
Posts: 11
Joined: Tue May 12, 2015 7:50 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Fortran »

Thanks guys.
budda wrote:Hi,

Just a quick question.

Should not the chromatic aberration 'fix' example show the blue shift toward the outside and red shift toward the centre of the image. :?

The lens would be expected to reverse the shift to correct the colour shift in the image.


Thanks.
Hi budda, the shift can be performed in either direction just by setting the color to either positive or negative. I just bashed in a load of random offsets for the image just to show that separation was working :)

Here is one with the red shifted inward:

Image

and this one is using the default DK1 values that get posted around the net:

Image

Tweaking it to get it perfect for any particular lens can be tricky but its just a matter of trial and error really.
Darthlord
One Eyed Hopeful
Posts: 4
Joined: Sun May 31, 2015 8:44 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Darthlord »

Hello, your shader was posted on a Cardboard group, but none of us there has been able to get it to work... I can use SweetFX perfectly fine normally, but with your shader the effects never kick in. I tried it both the x32(the game doesn't even start with those) and x64 dlls and both the native and tridef settings with multiple games. Do you have any clue on what could be happening? My system is Windows 7 64bits and I have a nvdia gtx 760 card
Fortran
One Eyed Hopeful
Posts: 11
Joined: Tue May 12, 2015 7:50 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Fortran »

Hi Darthlord, sorry to hear you're having problems with it. I'm not entirely sure what could be causing the issue. The version of SweetFX its using is Boulotaur2024.Injector_CeeJay.dk's.1.5.1.Shader ChromaticAberrationShader, is that the version of SweetFX you have used before that works for you? Also I presume you are copying the entire thing into the game directory (where the game executable is) as opposed to injecting it with something like RadeonPro ? I use mine specifically with RadeonPro as I'm on windows 8.1 and I find injecting cleaner for multiple titles than constantly copying over folders. If you have a specific game you're trying it with that's not working for you let me know and I can try it on that game myself here.

If you can't get my SweetFX working normally you could try combine my custom shaders with your working version. The DLL versions are not really important as I believe most versions of SweetFX should support the calculations the shaders are performing regardless (ie they don't do anything that should be specific to any particular version). If you want to try and combine my version with your working installation of SweetFX you would need to do the following.

1: Copy OculusDroidNative.h and OculusDroidTridef.h from my versions shader folder and paste them into your SweetFX install shader folder (same place)
2: Open up Main.h in your installation of SweetFX (again in the shaders folder) and add

Code: Select all

#if (USE_OCULUSDROIDTRIDEF == 1)
  #include "OculusDroidTridef.h"
#endif

#if (USE_OCULUSDROIDNATIVE == 1)
  #include "OculusDroidNative.h"
#endif
after

Code: Select all

#if (USE_SPLITSCREEN == 1)
  #include "Splitscreen.h"
#endif

then add

Code: Select all

  #if (USE_OCULUSDROIDTRIDEF == 1)
   FinalColor = OculusDroidTridef(FinalColor,tex);
#endif

  #if (USE_OCULUSDROIDNATIVE == 1)
   FinalColor = OculusDroidNative(FinalColor,tex);
#endif
after

Code: Select all

  // Splitscreen
  #if (USE_SPLITSCREEN == 1)
	FinalColor = SplitscreenPass(FinalColor,tex);
  #endif
3: Then open up your SweetFX_Settings.tx file (the one where you normally configure all SweetFX settings and add

Code: Select all

#define USE_OCULUSDROIDTRIDEF  0
#define USE_OCULUSDROIDNATIVE  0
to the end of the "Choose Effects" section of the settings. Then simply turn one or the other on by changing the 0 to a 1.

Hopefully that might work for you, it's just basically combining my 2 custom shaders into your working SweetFX installation.

If that approach doesn't work and you still want to try this, I actually made a Reshade compatible version as well which I use for some titles where SweetFX doesn't play nicely. You can download it from here: https://dl.dropboxusercontent.com/u/916 ... ESHADE.zip

To install it (as per the Reshade install guide) just run ReShade Setup.exe and select the game executable that you would like to add Reshade to, it will automatically install the correct DLL's depending on the type of DirectX version or OpenGL that the game is using, once its finished installing just go to the game directory and find the ReShade folder the installer created then open SweetFX_settings.cfg and either turn on (by setting to 1) USE_OCULUSDROIDTRIDEF or USE_OCULUSDROIDNATIVE depending on which one works with the type of 3D the game or external 3d injector is creating. You will see a few warnings for implicit truncation of vector type (still haven't cleaned those up yet) but the shader will work regardless and the warning messages will dissapear after a few seconds.
Darthlord
One Eyed Hopeful
Posts: 4
Joined: Sun May 31, 2015 8:44 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Darthlord »

Okay, I figured it out :) I did what you said, but the game crashed... Then I looked at the log file and found this

Code: Select all

redirecting CreateDevice
initialising shader environment
D3DXCreateEffectFromFile failed
SweetFX/Shaders/Main.h(71,12): error X1507: failed to open source file: 'OculusDroidTridef.h'
Apparently SweetFX is trying to load the shader from the main folder instead of the right folder, so all I had to do was change this on Main.h

Code: Select all

#if (USE_OCULUSDROIDTRIDEF == 1)
  #include "OculusDroidTridef.h"
#endif
to this

Code: Select all

#if (USE_OCULUSDROIDTRIDEF == 1)
  #include "SweetFX\Shaders\OculusDroidTridef.h"
#endif
It's working perfectly now hahah Thank you so much for your help :) Let the tweaking begin now
Fortran
One Eyed Hopeful
Posts: 11
Joined: Tue May 12, 2015 7:50 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Fortran »

Ah! ok, weird, my version loads from the shader folder automatically but I guess different versions do it differently. Glad you got it fixed though :)
Darthlord
One Eyed Hopeful
Posts: 4
Joined: Sun May 31, 2015 8:44 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Darthlord »

Hey, it's me again... I thought it was just a matter of tweaking the values, but all my games looks like this:
Image
Do you know how to fix this?
Fortran
One Eyed Hopeful
Posts: 11
Joined: Tue May 12, 2015 7:50 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Fortran »

Yep, try the other shader if you haven't already, there are no hard-fast rules about which one of the two shaders will work properly, the TriDef named one usually works fine for TriDef injected titles, however on certain games you will have to use the other Native shader even with TriDef as noted in the readme. For example Alien Isolation works perfectly with the TriDef shader, but DCS World even when being injected with TriDef requires the Native shader. If you get the "one lens stretched over both viewports" result in your screenshot then you will know you need the other shader instead. The only things that should need tweaking are distortion amount and chromatic abberation correction and scaling in pretty much all cases.

It seems to be down to how any particular game engine reacts to the 3D injection as to which shader provides a proper SBS correction. Which deadspace is that ? 2 or 3 ? Let me know if the Native shader doesn't work with it and I will try create one that will (if I have a copy of the game in my library).
Fortran
One Eyed Hopeful
Posts: 11
Joined: Tue May 12, 2015 7:50 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Fortran »

Ok I had a chance to test this with Dead Space 2 today, still not sure if you're playing 2 or 3 from the screenshot however here is the method I used to get it working properly.

1: Use the ReShade version I posted after your first question. SweetFX seems to have some issues with DeadSpace 2 and although the shaders were working correctly SweetFX seems to be over darkerning this particular game. It might not be SweetFX in general, it might be because im on windows 8.1 or the version of SweetFX I built the custom shaders on has some issues with it.

2: Install ReShade but it won't auto-detect which DX version, select DX9 when auto detect fails. (this is provided you're playing DS2 not 3, if its 3 im not sure which DX version its running on or if ReShade might detect it properly itself).

3: After it installs go to > SteamLibrary\steamapps\common\Dead Space 2\ReShade\SweetFX_settings.cfg or wherever your DS game is installed to.

4: Open SweetFX_settings.cfg and set

Code: Select all

#define USE_OCULUSDROIDTRIDEF  0 //Lense correction for non-native SBS 3D, such as when using Tridef
#define USE_OCULUSDROIDNATIVE  1 //Lense correction for non-native SBS 3D, such as when using Tridef
5: Launch DS with TriDef, however it will still have an issue with being over dark, so open up the TriDef OSD menu (0 on the numpad by default) and turn off 3D under the 3D setting menu, then turn 3D back on again, this will reset the darkness level to how it should be. You will need to do this once each time you boot the game up and start playing.

If it's not Dead Space 2 but 3 instead you might have to experiment with the other shader if Native doesn't create the proper correction. Sorry I can't be of more help, sadly to do this we basically have to double inject the game (once with 3D and once with SweetFX either the normal version or the ReShade version) so it can lead to some issues with some games. I tend to find older dx9 titles to have more problems with being injected like this than newer dx10/11 titles. For Android VR it's all about experimenting really until you get the results you need.

Image
Darthlord
One Eyed Hopeful
Posts: 4
Joined: Sun May 31, 2015 8:44 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Darthlord »

Oh, I totally forgot to test with the "native" shader. It's Dead Space 3, but it worked the same with it. Thanks for all your work.
Fortran
One Eyed Hopeful
Posts: 11
Joined: Tue May 12, 2015 7:50 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Fortran »

So the native shader also gives the wrong result for you? Is this running it with your own SweetFX install ? Or did you also try the ReShade option. Give ReShade a go if you like and see if that fixes it. I'm not really sure where it's going wrong sadly and I dont have DS3 to test it with. I have a feeling the issue might be coming from it being added to your own SweetFX version maybe, although I cant say for sure.
SousaKing
One Eyed Hopeful
Posts: 8
Joined: Thu May 07, 2015 7:27 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by SousaKing »

Thank you so much for this! I've been hunting for a while to see if anyone had a fix for tridef sbs. I've been playing around with this for a couple days now. I still have several games to try out. The reshader version seems to be working best for me. I've done some adjusting to some of the virieo settings to get it looking better. Look for my post on that.
maxtriano
One Eyed Hopeful
Posts: 1
Joined: Thu Jul 09, 2015 5:24 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by maxtriano »

Has anyone been able to get this working with the latest ReShade (0.19.2)? It work perfectly with the version of ReShade that was posted here, but as soon as I try to update to the newest ReShade, it stops working.
User avatar
Dilip
Certif-Eyed!
Posts: 692
Joined: Sat Dec 13, 2008 9:23 am
Location: Ahmedabad//INDIA

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Dilip »

Does this all work at good frame rate?
Jpwinks001
One Eyed Hopeful
Posts: 13
Joined: Wed Feb 18, 2015 7:00 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Jpwinks001 »

Hello.
I think I got this to work. I instead used the Sweetfx Configurator and just switched out the SFX folder in it: http://sweetfx.thelazy.net/

I followed all the instructions in the sweetfx. Everything works with tridef. The only problem is I cant get the lenses large enough on fullscreen:
[img=http://s10.postimg.org/afd8fwsmd/Screenshot_2015_07_23_12_42_43.jpg](had to do it window mode as tridef wouldnt inclue the shader)

I want to get the same effect as yours where the 2 lenses are right next to each other and stretched.
I've tried changing the setting in the config file but I have yet to get the same results as you.

I also tried the Reshade fx but tridef does not like it...
The game I am using is Iron Front Liberation 1944.

Let me know if you need more information
Fortran
One Eyed Hopeful
Posts: 11
Joined: Tue May 12, 2015 7:50 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Fortran »

maxtriano wrote:Has anyone been able to get this working with the latest ReShade (0.19.2)? It work perfectly with the version of ReShade that was posted here, but as soon as I try to update to the newest ReShade, it stops working.
Might not be compatible with the latest, will have a look when I get a chance.
Dilip wrote:Does this all work at good frame rate?
Has an almost negligible impact, maybe 2-5 fps at the very most.
Jpwinks001 wrote:Hello.
I think I got this to work. I instead used the Sweetfx Configurator and just switched out the SFX folder in it: http://sweetfx.thelazy.net/

I followed all the instructions in the sweetfx. Everything works with tridef. The only problem is I cant get the lenses large enough on fullscreen:
[img=http://s10.postimg.org/afd8fwsmd/Screenshot_2015_07_23_12_42_43.jpg](had to do it window mode as tridef wouldnt inclue the shader)

I want to get the same effect as yours where the 2 lenses are right next to each other and stretched.
I've tried changing the setting in the config file but I have yet to get the same results as you.

I also tried the Reshade fx but tridef does not like it...
The game I am using is Iron Front Liberation 1944.

Let me know if you need more information
The effect you're seeing is from using the wrong shader, as I noted in the readme sometimes you will have to use the other version regardless of it you're using tridef. It seems to depend on how the game renders things as to which one will do the job properly. This is why there are two shaders, which work in slightly different ways, you can always tell if you need to try the other if it renders the "eyes" in the incorrect format like in your screenshot. Try the other shadeer first, if that also doesn't work either then it might be that it won't work with that particular game sadly.
Jpwinks001
One Eyed Hopeful
Posts: 13
Joined: Wed Feb 18, 2015 7:00 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Jpwinks001 »

That gave me better results. Now that the lenses are correct, do you adjust the size so it takes up the whole screen or should it automatically do that? Does that have to do with what resolution the game is running on?
Thank you so much for your help and tips!
Fortran
One Eyed Hopeful
Posts: 11
Joined: Tue May 12, 2015 7:50 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Fortran »

Jpwinks001 wrote:That gave me better results. Now that the lenses are correct, do you adjust the size so it takes up the whole screen or should it automatically do that? Does that have to do with what resolution the game is running on?
Thank you so much for your help and tips!
It shouldn't depend on resolution, it operates on the relative X and Y values that the shader calculates from the resolution you are using. The shader itself (with default settings) should compensate for the display change when using a 3D driver or native SBS 3D it will basically create the proper aspect ratio, something which a 3D TV does automatically. If you post a screenshot of what you're seeing I can try help a little further. Should look like the screenshots above for proper VR correction.
Jpwinks001
One Eyed Hopeful
Posts: 13
Joined: Wed Feb 18, 2015 7:00 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Jpwinks001 »

Here is the screenshot:
[img=http://s9.postimg.org/cboym4o6j/Screenshot_2015_07_25_10_19_30.jpg]
I have not touched any settings.
Fortran
One Eyed Hopeful
Posts: 11
Joined: Tue May 12, 2015 7:50 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Fortran »

Jpwinks001 wrote:Here is the screenshot:
[img=http://s9.postimg.org/cboym4o6j/Screenshot_2015_07_25_10_19_30.jpg]
I have not touched any settings.
Well it appears to be working ok, it's just the resolution. What res is that window at? I take it it's not 16:9? Could be an issue as it was designed around 16:9/16:10 type resolutions as opposed to 4:3 or any other. For starters you could try using a smaller number for:

#define ScaleFactor float(1.0)

so for example

#define ScaleFactor float(0.8)

This will scale up the entire pair of lenses to fill the screen more.
Jpwinks001
One Eyed Hopeful
Posts: 13
Joined: Wed Feb 18, 2015 7:00 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Jpwinks001 »

Thank you very much! Everything is working great now. Time to tweak!
errational
One Eyed Hopeful
Posts: 3
Joined: Mon Jul 27, 2015 2:46 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by errational »

Hi Fortran! This is great stuff. I got the shaders working (after some false starts trying to figure out what version of ReShade to download I realised that your .zip included the setup file!)

My first question is: can you share your settings for your G3 setup? I would like to know if I am getting the scale settings etc correct.

Secondly: is the resolution best left at 1920x1080? I am streaming to Moonlight (so it's downscaled to 1920x1080 then upscaled to 2160x1440 haha).

I have a Baofeng III Mojing/Storm HMD and I find the biggest issue I'm seeing is chromatic aberration throughout about 2/3rds of the image (a known issue with this HMD that I failed to understand until now). Can you explain what the 4 variables in the chromatic aberration setting are (eg. red shift/blue shift - x & y perhaps?) or is there something you can refer me to so I can understand it better?

Finally: can the shader variables be adjusted on the fly, or do you have to exit the game, change a variable and relaunch to test?
Fortran
One Eyed Hopeful
Posts: 11
Joined: Tue May 12, 2015 7:50 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Fortran »

No worries, if you're using the Re-Shade version you can simply make changes and alt-tab in and out of the game, the changes will apply. As for resolution it's your choice. I actually run some games in 4k such as Elite Dangerous as it totally transforms the readability of the text, use Nvidia DSR and run in 2k or 4k if you have the performance to do so, will help with image clarity, even though moonlight will only stream in 1080p max it does make a big difference with aliasing.

My G3 setup is the exact settings in the original shaders, I removed my chromatic settings and set them to 0 because it totally depends on the lenses in your HMD. The settings are simple enough to understand, it's just Red Green Blue and Alpha. You can shift them in one direction or another simply by using positive or negative numbers for each. Can be tricky and a bit of a pain in the ass to get the values correct, but just keep playing with them and alt-tabbing between the game the shader file to update until you get them spot on for your lenses. Sadly the actual chromatic abberation calculations are based on the ones in the DK1 so might not be %100 tweak-able to every single type of lens setup, just depends.
errational
One Eyed Hopeful
Posts: 3
Joined: Mon Jul 27, 2015 2:46 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by errational »

Fortran wrote:No worries, if you're using the Re-Shade version you can simply make changes and alt-tab in and out of the game, the changes will apply. As for resolution it's your choice. I actually run some games in 4k such as Elite Dangerous as it totally transforms the readability of the text, use Nvidia DSR and run in 2k or 4k if you have the performance to do so, will help with image clarity, even though moonlight will only stream in 1080p max it does make a big difference with aliasing.

My G3 setup is the exact settings in the original shaders, I removed my chromatic settings and set them to 0 because it totally depends on the lenses in your HMD. The settings are simple enough to understand, it's just Red Green Blue and Alpha. You can shift them in one direction or another simply by using positive or negative numbers for each. Can be tricky and a bit of a pain in the ass to get the values correct, but just keep playing with them and alt-tabbing between the game the shader file to update until you get them spot on for your lenses. Sadly the actual chromatic abberation calculations are based on the ones in the DK1 so might not be %100 tweak-able to every single type of lens setup, just depends.
Thank you so much for everything! Hopefully I can get something passable to tide me over until Oculus/Vive etc releases :)
SousaKing
One Eyed Hopeful
Posts: 8
Joined: Thu May 07, 2015 7:27 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by SousaKing »

Has anyone been able to compare this type of setup (Zeiss VR1, etc.) to an Oculus Rift or Vive? I'm really curious how much better a rift really is if any. I know the frame rate and head tracking should be better but is it enough of a difference to make it a far better experience?
el-spectre
One Eyed Hopeful
Posts: 1
Joined: Wed Aug 05, 2015 3:58 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by el-spectre »

errational wrote:Thank you so much for everything! Hopefully I can get something passable to tide me over until Oculus/Vive etc releases :)
Hello, did you succeed in correction of chromatic aberrations in your Baofeng III HMD?
errational
One Eyed Hopeful
Posts: 3
Joined: Mon Jul 27, 2015 2:46 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by errational »

el-spectre wrote:
errational wrote:Thank you so much for everything! Hopefully I can get something passable to tide me over until Oculus/Vive etc releases :)
Hello, did you succeed in correction of chromatic aberrations in your Baofeng III HMD?
Somewhat. I just started messing around with this again.

Here's the values I've got so far:

Code: Select all

#define ChromAbParam float4(0.98, -0.003, 1.022, 0)
My main problem is that anything just outside of the center of the lenses is quite distorted. I'm still messing with all the settings to find a happy medium.
Blinkstar
One Eyed Hopeful
Posts: 23
Joined: Tue Apr 21, 2015 5:59 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Blinkstar »

Fortran ... this is awesome, but the resulting image is a little small on my note 3 ... Anyway to reduce the curve slightly on the barrel effect so I can fill up more of my screen?
Bluedeath
One Eyed Hopeful
Posts: 49
Joined: Mon Feb 10, 2014 4:48 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Bluedeath »

Guys im currently using DXtory and VRPLAYER for the games that do not accept sweetfx shaders, i've seen that media player classic is lighter and has less frame drop ( i was able to elimiminate most of the lag in vr player but for some reason the stream sometimes stutters and, anyway, VRplayer use too many resources that i would prefer to dedicate to the actual game).

my question is would it be possible to covert the shaders in this thread to "plain" HLSL (i am a total noob in this) to be used as media player HC shaders?

Thanks in advance

edited to fix typos
esworp
One Eyed Hopeful
Posts: 3
Joined: Thu Dec 17, 2015 11:28 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by esworp »

Hey Fotran,

Thanks for the excellent work. I dropped the reshade file you provided in the middle of this thread into my E:D folder and was quite happy to see the 'stock' aspect ratio fixed.

But then, tragedy. Elite was upgraded to 1.5, and the shader was lost. And, doesnt seem to work any longer. :(

Any hope for a SweetFX 2.0 compatible shader?
SousaKing
One Eyed Hopeful
Posts: 8
Joined: Thu May 07, 2015 7:27 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by SousaKing »

esworp wrote:Hey Fotran,

Thanks for the excellent work. I dropped the reshade file you provided in the middle of this thread into my E:D folder and was quite happy to see the 'stock' aspect ratio fixed.

But then, tragedy. Elite was upgraded to 1.5, and the shader was lost. And, doesnt seem to work any longer. :(

Any hope for a SweetFX 2.0 compatible shader?
Elite now has a 64bit exe. Just make sure you chose that when you install reshade and you should be good to go. It works for me on Horizons.
esworp
One Eyed Hopeful
Posts: 3
Joined: Thu Dec 17, 2015 11:28 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by esworp »

SousaKing wrote:
Elite now has a 64bit exe. Just make sure you chose that when you install reshade and you should be good to go. It works for me on Horizons.
I was happy to see that, too... But it seems like this a really old version or ReShade now.

But, alas, it works. Yay.

Next question: how do i disable the lens correction-shape, yet keep the aspect ratio correction?
Blinkstar
One Eyed Hopeful
Posts: 23
Joined: Tue Apr 21, 2015 5:59 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Blinkstar »

esworp wrote:
SousaKing wrote:
Elite now has a 64bit exe. Just make sure you chose that when you install reshade and you should be good to go. It works for me on Horizons.
I was happy to see that, too... But it seems like this a really old version or ReShade now.

But, alas, it works. Yay.

Next question: how do i disable the lens correction-shape, yet keep the aspect ratio correction?
Let me know if you still need an answer to this. I just typed it all out and then accidentally shut the window losing all my text.
esworp
One Eyed Hopeful
Posts: 3
Joined: Thu Dec 17, 2015 11:28 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by esworp »

Blinkstar wrote:
Let me know if you still need an answer to this. I just typed it all out and then accidentally shut the window losing all my text.

Ouch. I hate that.

But yes, if you can find time, I'd find it helpful. I use a ColorCross headset, which has big FOV.. The lens shape isn't necessary for that model. :)
asprind
One Eyed Hopeful
Posts: 12
Joined: Mon Jan 11, 2016 11:19 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by asprind »

Have you checked the shader files: OculusDroidTridef.h and OculusDroidNative.h they are located in SWEETFX_3D_LENSE\SweetFX\Shaders ?

Inside those files there are separate settings for Distortion Scaling and Aspect ratio. Read the readme file.
Blinkstar
One Eyed Hopeful
Posts: 23
Joined: Tue Apr 21, 2015 5:59 pm

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by Blinkstar »

esworp wrote:
Blinkstar wrote:
Let me know if you still need an answer to this. I just typed it all out and then accidentally shut the window losing all my text.

Ouch. I hate that.

But yes, if you can find time, I'd find it helpful. I use a ColorCross headset, which has big FOV.. The lens shape isn't necessary for that model. :)
It's a combination of these two settings in the OculusDroidNative.h file (or the tridef version if you're using that.)

#define ScaleFactor float(0.16)

Which makes the lens image smaller or larger (but also changes the shape of the lenses for some reason)

and this:

#define HmdWarpParam float4(7,0.22,0.24,0)

Which changes the shape of the lenses (but can also change their size, for some reason). Here you only change the first number, at least I've only changed the first number, to tweak the lens distortion.

You kind of have to go back and forth between these two options to get the image you want, because each alters the other. The values I posted are the ones I'm currently using with a particular game, but I have different versions for different games. (FPS seem to require more screen space than third person games in terms of maintaining the 3D effect)
kakashisensei
Two Eyed Hopeful
Posts: 62
Joined: Fri Dec 06, 2013 2:09 am

Re: Google Cardboard HMD - SweetFX VR Correction Shader Suit

Post by kakashisensei »

Wow this is great stuff. Thank you so much. Worked for me to use tridef sbs 3d and this for my smartphone HMD. Tridef sbs works way better in many games than vorpx. And vorpx now only works with oculus directmode, and I only have a DK1.

Having issues to get this to work without crashing on arkham knight and witcher3, both the sweetfx 1.5.1 and reshade versions. Seems arkham knight has issues with older sweetfx/reshade, but not the latest reshade. I tried to get the reshade version shader files to work with the newest reshade, but no go. It spits out errors when trying to run the shader at start.

Are you planning to update the shader to work with the more recent reshade or sweetfx 2.0?

Thx again!
Post Reply

Return to “General VR/AR Discussion”