Shaders mod for better VR performance (experimental) - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 07-08-2018, 10:14 PM   #1
Kegetys
Member
 
Kegetys's Avatar
 
Join Date: Mar 2010
Location: Kuopio, Finland
Posts: 102
Default Shaders mod for better VR performance (experimental)

I was slightly frustrated with poor performance when playing in VR with the new deferred rendering engine, so I had a look what would be possible to remove/simplify from the shaders to improve the framerate without too huge sacrifices in image quality. Focusing on anything that has a potentially high memory bandwidth cost (which is usually a big problem with deferred renderers + high resolutions) I was able to do some seemingly decent "optimizations".

The mod nowdays also does visual improvements. Full list of changes/options:

Performance optimizations:
- Simplified canopy glass shader
- "Emulation" for the OpenVR hidden area mesh
- Simplified histogram calculation
- Disabled bloom & color grading
- Simplified grass rendering
- Reduced shadow PCF maximum sample count from 16 to 10
- Simple transparent objects rendering, ie. propellers and smoke
- Disabled atmosphere for things close to camera
- Removed one GBuffer entirely for bandwidth savings
- Removed water refractions shader as it doesn't work with the above

Visual improvements:
- Albedo texture supersampling, for sharpening object textures. Visible especially with cockpit text labels.
- Multi-sampled shadow sampling in terrain with MSAA enabled (less aliased shadows)
- Alpha-to-coverage support for trees and tree flat shadows with MSAA enabled (less aliased trees)
- Improved night vision goggles, useable in VR with smaller, properly positioned scope and new noise effect.
- Optional NVG scope raise/lower feature with gain control (fixed gain)
- Added dithering to HDR tonemap to smooth out banding, visible especially at the sky
- The 3D mouse cursor is less bright at night time
- Slight mip bias adjustment for text rendering (sharper text)

Many of these can be toggled/configured from the config file.

Info about albedo texture supersampling here: http://www.kegetys.fi/dcs-shaders-perf-mod-update/
AToC & Multisampled shadow sampling comparison here: http://junk.kegetys.fi/atoc.jpg
Dithering comparison here: http://junk.kegetys.fi/dit.png ('off' is a bit worse in the shot than it is in-game)

Example scenes:
Stock shaders in Hornet, 65fps: http://junk.kegetys.fi/xzy/carrierlanding_orig_ssaa.jpg
With the mod, 98fps: http://junk.kegetys.fi/xzy/carrierlanding_opt_ssaa.jpg
Stock shaders in Harrier, 61fps: http://junk.kegetys.fi/xzy/readyramp_orig_ssaa.jpg
With the mod, 94fps: http://junk.kegetys.fi/xzy/readyramp_opt_ssaa.jpg
(These are taken in non-vr mode with some SSAA to get accurate FPS numbers)

Download for DCS World 2.5.6.50321: http://junk.kegetys.fi/DCS%20VR%20Sh....5.6.50321.zip (latest)

Download for DCS World 2.5.6.49314: http://junk.kegetys.fi/DCS%20VR%20Sh....5.6.49314.zip (old version)
Download for DCS World 2.5.6.47224: http://junk.kegetys.fi/DCS%20VR%20Sh....5.6.47224.zip (old version)
Download for DCS World 2.5.6.45915: http://junk.kegetys.fi/DCS%20VR%20Sh....5.6.45915.zip (old version)
Download for DCS World 2.5.6.43503: http://junk.kegetys.fi/DCS%20VR%20Sh....5.6.43503.zip (old version)
Download for DCS World 2.5.5.41371: http://junk.kegetys.fi/DCS%20VR%20Sh....5.5.41371.zip (old version)
Download for DCS World 2.5.5.34644: http://junk.kegetys.fi/DCS%20VR%20Sh....5.5.34644.zip (old version)
Download for DCS World 2.5.5.33184: http://junk.kegetys.fi/DCS%20VR%20Sh....5.5.33184.zip (old version)
Download for DCS World 2.5.4.25729: http://junk.kegetys.fi/DCS%20VR%20Sh....5.4.25729.zip (old version)
Download for DCS World 2.5.3.21107: http://junk.kegetys.fi/DCS%20VR%20Sh....5.3.21107.zip (old version)
Download for DCS World 2.5.2.19273.411: http://junk.kegetys.fi/DCS%20VR%20Sh...273.411(b).zip (old version)

See the readme for install instructions. Its very likely it will break with future DCS versions that change the shaders...

It works in non-VR mode too, but likely the performance gain is not that huge unless you play in very high resolution.

FAQ
Does the mod work in multiplayer?
Only on servers with disabled integrity check.

My game freezes at startup with the mod?
It just takes a long time to compile the shaders at first run, be patient. If you want, you can monitor the progress with SysInternals DebugView.

Game freezes when starting a particular mission?
Likely you have loaded a new terrain for the first time after installing the mod and metashaders for the terrain are getting recompiled. Just wait as above and it should be fast the next time.

Plane cockpit is missing/transparent?
This seems to happen randomly when the shaders for the cockpit were just compiled. Re-entering the plane/restarting the mission or DCS should fix it and it should not happen any more when the shaders are already compiled.

Changelog
2.5.6.50321:
- Compatibility with DCS World version 2.5.6.50321 (6.6.2020)
- Fixed tree AToC in TGP
2.5.6.49314:
- Renamed the mod to 'DCS World VR shaders mod'
- Compatibility with DCS World version 2.5.6.49314 (23.5.2020)
- Removed MSAA_MASKSIZE setting as ED "cloned" it to DCS itself
- Added multi-sampled terrain shadow sampling (less aliased shadows with MSAA)
- Added alpha-to-coverage support for trees and tree flat shadows (less aliased trees with MSAA)
- Fixed ship wakes being permanently "burned in" with high water detail
- Simple transparent objects rendering setting (off by default - not well tested)
- Fixed some issues with NVG especially with NVG_GAIN_ADJUSTS_POSITION enabled
2.5.6.47224:
- Compatibility with DCS World version 2.5.6.47224 (19.4.2020)
- Fixed some potential issues with GBuffer decoding
- Fixed simple glass albedo color
- Added ENABLE_NO_BLOOM setting to keep bloom enabled (appears to perform better nowdays)
- Changed HMD mask outside area to write black rather than discard to be compatible with bloom
- Added albedo texture supersampling (ENABLE_DIFFUSE_SS setting)
2.5.6.45915:
- Compatibility with DCS World version 2.5.6.45915 (3.4.2020)
2.5.6.43503:
- Compatibility with DCS World version 2.5.6.43503 (16.2.2020)
- Restored original sun flare
- Added simplified version of histogram calculation (previously it was removed completely)
- Above can be turned off with ENABLE_SIMPLE_HG setting
- Removed the sRGB fix as the game seems to have some other workaround for it now
- ENABLE_SIMPLE_SHADOWS now limits the sample count to 10 instead of 16
v2.5.5.41371:
- Compatibility with DCS World version 2.5.5.41371 (4.1.2020)
v2.5.5.34644:
- Compatibility with DCS World version 2.5.5.34644 (14.8.2019)
v2.5.4.28615:
- Restored resolveDepth as it was causing problems with haze and NVG depth effect
- Fixed fog not being visible near the camera
- NVG effect improved for VR goggles (smaller scope, correct positioning, new noise)
- NVG gain now does something proper rather than just brightens up the sky
- NVG parameters configurable from _HMD.hlsl
- Included the sRGB gamma fix in the mod (fix elevated black levels, visible esp. at night)
- Added simple dithering to HDR tonemap to smooth out banding, visible especially at the sky
- Made the 3D mouse cursor less bright at night time
- Some optimizations can now be turned off from _HMD.hlsl (simple shadows, grass, canopy)
v2.5.4.25729:
- Compatibility with DCS World version 2.5.4.25729 (20.12.201
v2.5.3.21107:
- Compatibility with DCS World version 2.5.3.21107 (31.8.201
- Fixed moonlight illuminating cockpit glass too much
v2.5.2.19273.411(b):
- Fixed compile error with DIFFUSE_UV
v2.5.2.19273.411:
- Fist version
__________________
As a cyborg, you will serve SHODAN well
http://www.kegetys.fi

Last edited by Kegetys; 06-06-2020 at 10:45 AM. Reason: update for 2.5.6.50321
Kegetys is offline   Reply With Quote
Old 07-08-2018, 10:28 PM   #2
Brixmis
Senior Member
 
Join Date: Dec 2014
Location: Gone
Posts: 2,198
Default

Thanks for sharing this - will be interesting to see what effect it has on my rig.
__________________

Brixmis is offline   Reply With Quote
Old 07-08-2018, 11:47 PM   #3
zionid
Member
 
Join Date: Sep 2013
Posts: 973
Default

Interesting! Will test!
zionid is offline   Reply With Quote
Old 07-09-2018, 03:47 AM   #4
Zeroskills
Junior Member
 
Join Date: Feb 2014
Posts: 66
Default

I gave this a shot. Resolution seemed better and the frame rate seemed the same, but I definatly have the weird artifacts around the edge of my vision now. It kind of felt like I was getting eye strain after 10 minutes or so. Any suggestions for the MASKSIZE value for an Oculus Rift?


Edit: I used 0.575 for the MASKSIZE and it got rid of the artifacts at the edge of my vision and FPS seemed unaffected. A lower value might work, but trying it out will have to wait until I have more time.

Last edited by Zeroskills; 07-09-2018 at 04:15 AM.
Zeroskills is offline   Reply With Quote
Old 07-09-2018, 03:55 AM   #5
Nero.ger
Member
 
Nero.ger's Avatar
 
Join Date: Feb 2016
Posts: 791
Default

this looks VERY interresting. Does it work in MP or does the Integrity Check freak out?
__________________
'controlling' the Ka50 feels like a discussion with the Autopilot and trim system about the flight direction.
Nero.ger is offline   Reply With Quote
Old 07-09-2018, 05:49 AM   #6
Highwayman-Ed
Senior Member
 
Highwayman-Ed's Avatar
 
Join Date: Nov 2005
Location: Melbourne, Australia
Posts: 1,554
Send a message via AIM to Highwayman-Ed
Default

Quote:
Originally Posted by Zeroskills View Post
definatly have the weird artifacts around the edge of my vision now.
Same, although I still just had them at .575...


Quote:
Originally Posted by Nero.ger View Post
this looks VERY interresting. Does it work in MP or does the Integrity Check freak out?
It will kill the integrity check as it is making changes to core game files, but it does look very promising.
__________________

Intel i9-9900KF @5.2GHz
MSI Z390 Gaming Pro Carbon
32GB G.Skill Trident Z DDR3200 RAM
MSI RTX 2080 Ti Gaming X Trio
40" Panasonic TH-40DX600U @ 4K
Pimax Vision 8K Plus / Oculus Rift CV1 / HTC Vive
Gametrix JetSeat with SimShaker
Windows 10 64 Bit Home Edition



Last edited by Highwayman-Ed; 07-09-2018 at 07:16 AM.
Highwayman-Ed is offline   Reply With Quote
Old 07-09-2018, 08:00 AM   #7
Roller25
Junior Member
 
Join Date: Apr 2010
Location: Australia
Posts: 76
Default

Definitely made a difference on my machine.. VR with Oculus and runs much smoother..
Roller25 is offline   Reply With Quote
Old 07-09-2018, 08:43 AM   #8
Nero.ger
Member
 
Nero.ger's Avatar
 
Join Date: Feb 2016
Posts: 791
Default

Quote:
Originally Posted by Highwayman-Ed View Post
It will kill the integrity check as it is making changes to core game files.
not that there was any doubt, just to confirm i tested it and its triggering IC problems
__________________
'controlling' the Ka50 feels like a discussion with the Autopilot and trim system about the flight direction.
Nero.ger is offline   Reply With Quote
Old 07-09-2018, 09:02 AM   #9
Cibit
Veteran
 
Cibit's Avatar
 
Join Date: Jan 2009
Location: Northumberland. UK
Posts: 4,168
Default

Can this be used via OvGME? Do the visuals suffer much
@ Highwayman-ED be nice to hook up with some hornet flying with you mate Hope all is well with you down under
__________________
i5 8600k@5.2Ghz, Asus Prime A Z370, 32Gb DDR4 3000, GTX1080 SC, Oculus Rift CV1, Modded TM Warthog Modded X52 Collective, Jetseat, W10 Pro 64

Cibit is offline   Reply With Quote
Old 07-09-2018, 09:11 AM   #10
Highwayman-Ed
Senior Member
 
Highwayman-Ed's Avatar
 
Join Date: Nov 2005
Location: Melbourne, Australia
Posts: 1,554
Send a message via AIM to Highwayman-Ed
Default

Quote:
Originally Posted by Cibit View Post
Can this be used via OvGME? Do the visuals suffer much
Yes, it can and no they don't. The only thing that I've noticed any real degradation with is the grass, and right now, I'm not seeing a lot of that in my Hornet (Notice I said in my Hornet, I'm seeing plenty of it at the end of my silk let downs )

I've found setting the mask size to 0.600f works great for me with a CV1 and I will congratulate Kegetys for making my text easier to read in my MFD's!
__________________

Intel i9-9900KF @5.2GHz
MSI Z390 Gaming Pro Carbon
32GB G.Skill Trident Z DDR3200 RAM
MSI RTX 2080 Ti Gaming X Trio
40" Panasonic TH-40DX600U @ 4K
Pimax Vision 8K Plus / Oculus Rift CV1 / HTC Vive
Gametrix JetSeat with SimShaker
Windows 10 64 Bit Home Edition



Last edited by Highwayman-Ed; 07-09-2018 at 09:16 AM.
Highwayman-Ed is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 12:55 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.