Announcement

Collapse
No announcement yet.

Shaders mod for better VR performance (experimental)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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
    Last edited by Kegetys; 06-06-2020, 10:45 AM. Reason: update for 2.5.6.50321
    As a cyborg, you will serve SHODAN well
    http://www.kegetys.fi

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

    Comment


      #3
      Interesting! Will test!

      Comment


        #4
        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, 04:15 AM.

        Comment


          #5
          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.

          Comment


            #6
            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...


            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.
            Last edited by Highwayman-Ed; 07-09-2018, 07:16 AM.

            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


            sigpic

            Comment


              #7
              Definitely made a difference on my machine.. VR with Oculus and runs much smoother..

              Comment


                #8
                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.

                Comment


                  #9
                  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

                  sigpic

                  Comment


                    #10
                    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!
                    Last edited by Highwayman-Ed; 07-09-2018, 09:16 AM.

                    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


                    sigpic

                    Comment


                      #11
                      @kegetys so we do not need to enable MSAA in the DCS settings? I noticed you don't have it enabled in your settings.

                      Awesome work. If this was just a quick attempt, I can't wait to see how you tweak it further!

                      Comment


                        #12
                        Working here.
                        Got my FPS back.

                        Tanks.

                        Edit : I really don't like this deferred shading thing.
                        Last edited by Cyb0rg; 07-09-2018, 10:04 PM.
                        sigpic
                        Asteroids
                        ____________________________________________
                        Update this

                        Portugal.

                        Comment


                          #13
                          Tried it out briefly today. Running a GTX1060. Incredible improvement in FPS, it's absolutely fluid now. No loss in graphics quality; in fact, I was able to change shadows from flat to high without any visible loss in FPS. So... Better graphics coupled with a dramatic increase in FPS.

                          What sorcery is this?!
                          Matthew 'Mags' Maclauchlan
                          Oculus CV1, Thrustmaster FCS HOTAS/Pedals

                          Comment


                            #14
                            Originally posted by mmaclauchlan View Post

                            What sorcery is this?!

                            Comment


                              #15
                              Are you a wizard?

                              Comment


                                #16
                                interesting. will check this out this weekend, (too much RL activities during the week). thanks OP.
                                sigpic
                                Gigabyte Z390 Aorus Ultra, i7-9700k (4.9ghz all cores), NH-D15 cooler, 64 GB CL-14 3200mhz RAM, GTX1080SC, Soundblaster Z, Yamaha 5.1 A/V Receiver, 2x 512GB Samsung NVMe, 1x 1TB Samsung NVMe, WD 2TB HDD, Win 10 Pro, TM Warthog, Virpil WarBRD, MFG Crosswinds, 43" Samsung 4K TV, 21.5 Acer VT touchscreen, TrackIR, JetSeat KW-908, Rift "S", Wheel Stand Pro Super Warthog, Phanteks Enthoo Pro Full Tower Case, Seasonic Prime 750W Titanium PW Supply, PointCTRL, Buttkicker 2

                                Comment


                                  #17
                                  Impressive. I'm running a pretty decent rig, and was having FPS issues with the Hornet in the Gulf; this solves that. Be sweet if ED could implement something like this. Thanks for your work!
                                  Sorry, no cool signature here.

                                  Comment


                                    #18
                                    Is it possible to get an ic ok version for mp or is there practically no changes that will work in that case

                                    Sent from my SM-G925I using Tapatalk

                                    Comment


                                      #19
                                      Hi Kegetys, you’ve done a great mod.
                                      Yesterday night I tried to set my settings to MSAA 2x using your mod. Unfortunately DCS freeze during startup. Since I restored the legacy shaders directory, no problem ?
                                      I run VR with a WMR headset via SteamVR.

                                      Does anybody get the same issue ?


                                      Envoyé de mon iPhone en utilisant Tapatalk
                                      Corei7 2600K 4.4Ghz OC - NVIDIA GTX 1080 Ti 11Gb - 16 Gb DDR3
                                      HP Reverb PRO HMD - Thrusmaster TWCS + TopGun Stick

                                      Comment


                                        #20
                                        I didn't noticed any difference. 45-90fps. Maybe I did something wrong. I'll try again.
                                        sigpic

                                        Comment

                                        Working...
                                        X