Jump to content

VR Shaders mod for better VR experience


Recommended Posts

I got it working by doing the following two steps after installing the VR mod - I've only tested for the F-14 and the F-18

 

Revert file to original

Bazar\shaders\model\functions\glass.hlsl

 

Edit includes at the top

Bazar\shaders\model\mirror_material.fx

#include "common/textures.hlsl"
#include "common/uniforms.hlsl"
#include "functions/vertex_shader.hlsl"
#include "functions/matParams.hlsl"
#include "functions/impostor.hlsl"
#include "common/shader_macroses.hlsl"
#include "common/states.hlsl"
#include "common/states11.hlsl"
#include "functions/structs.hlsl"
#include "functions/vt_utils.hlsl"

 

That being said, the 2.5.5 update actually increased the performance on my system, the stuttering I usually experience was totally gone. Looking forward to the huge VR optimization in the next OB :thumbup:

 

Modda

 

Doesnt work for me :/

 

Maybe I am doing something wrong. Would you share your files?

Proud owner of DCS: FC3, A-10C Warthog, F-14A/B Tomcat, F-5E Tiger, Mig21bis Fishbed, Mirage 2000C, Nevada Test Site, Normandy, Ka-50 Black Shark, Mi-8MTV2 Magnificent Eight, UH-1H Huey, SA342 Gazelle, Bf 109 K-4 Kurfurst, FW 190 D-9 Dora, Spitfire LF Mk. IX, P-51D Mustang Combined Arms, Hawk T.1A, L-39 Albatros, NS 430 Nav System, F-86F Sabre, MiG-15bis, AV-8B Night Attack V/STOL, F/A-18C Hornet, Yak-52 and the mighty AJS-37 Viggen! :music_whistling:

Link to post
Share on other sites
  • Replies 2.4k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

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 fra

I added an update to the first post for DCS 2.7.0.4625. Everything else is the same, except the HMD mask feature is removed since DCS now has a correctly implemented mask. I didn't do much testing wit

yes they still work...

There were even more changes needed since last OB 2.5.5.32299.

I've updated the dependencies in the Kegetys vr mod and it seems to be working at least on F/A-18, F-14B, Mig-21bis, M2000 Mirage, P-51D and A-10C.

I haven't tested what the FPS impact really is from vanilla DCS.

 

https://drive.google.com/open?id=1psMHQEFVNy26B6nnYHnwoEYxNclQBzOH

 

EDIT: No doubt, with this mod I'm on pretty steady 45fps downtown Dubai at low altitude (some drops occurs when touching the streets). Without it it's more steady 30-35 with high's at 45.


Edited by modda

i9-9900KS @5.2GHz | Aorus Z390 Master | MSI RTX 3090 Gaming X Trio | 32GB DDR4 3200MHz | HP Reverb G2 | TM Warthog | Logitech G Pro

Link to post
Share on other sites

@modda, got your files to work, then went to multiplayer.... :( so tried to replace the non compliant files with the ones in the back up, did not work. Did notice there was an improvement in single player though. But I mostly play MP

| CyperPower PC | AMD Ryzen 7 3700X @ 4.4 GHz | 64Gb DDR4 3200 MHz | Radeon RX 5700 8Gb | 32" Samsung Curve| Oculus Rift S | Thrustmaster T160000 HOTAS + Rudder Pedals | Windows 10-64 |

Link to post
Share on other sites
@modda, got your files to work, then went to multiplayer.... :( so tried to replace the non compliant files with the ones in the back up, did not work. Did notice there was an improvement in single player though. But I mostly play MP

Thanks for the feedback! I didn't consider MP to be a factor here, I'll look into it tonight.

i9-9900KS @5.2GHz | Aorus Z390 Master | MSI RTX 3090 Gaming X Trio | 32GB DDR4 3200MHz | HP Reverb G2 | TM Warthog | Logitech G Pro

Link to post
Share on other sites

Tested this with my PiMax 5K+. Really helped FPS on the deck of the carrier. I'm running 150x SS and couldn't hold 45 (Brain warp on). Sitting at the start of the Caucus cold start carrier mission. After applying this mod I was able to hold 45 no problem. I did need to make this change in _HMD.hlsl:

#define MASKSIZE 0.590f

This got rid of almost all of the masking for the PiMax in Normal FOV. @modda is there a way to make the mask more oval to better mach wide FOV headsets? increasing to .59 meant the top and bottom had less masking than needed.

Processor: i7-8700K CPU @ 5.1GHz (OC)

Memory: 16384MB RAM DDR 4266

Card name: NVIDIA GeForce RTX 2080TI FE

VR: PiMax 5K+

HDD: Samsung SSD 960 EVO

HDD: WD SSD WDS100T2B0A-00SM50

Link to post
Share on other sites
@modda, got your files to work, then went to multiplayer.... :( so tried to replace the non compliant files with the ones in the back up, did not work. Did notice there was an improvement in single player though. But I mostly play MP

 

@Chandawg I've uploaded a new version that seems to work in MP. I had to update the fake_spot_lights.fx as well.

Note: With this mod it seems that you get excluded from the shielded servers for not having a pure DCS installation.

 

modda

i9-9900KS @5.2GHz | Aorus Z390 Master | MSI RTX 3090 Gaming X Trio | 32GB DDR4 3200MHz | HP Reverb G2 | TM Warthog | Logitech G Pro

Link to post
Share on other sites
Tested this with my PiMax 5K+. Really helped FPS on the deck of the carrier. I'm running 150x SS and couldn't hold 45 (Brain warp on). Sitting at the start of the Caucus cold start carrier mission. After applying this mod I was able to hold 45 no problem. I did need to make this change in _HMD.hlsl:

#define MASKSIZE 0.590f

This got rid of almost all of the masking for the PiMax in Normal FOV. @modda is there a way to make the mask more oval to better mach wide FOV headsets? increasing to .59 meant the top and bottom had less masking than needed.

 

@DarkClown nice you got it running! I've got a VivePro myself, looking forward to try out a wider FOV :)

 

I've updated the _HMD.hlsl adding two factors for masksize and msaa_masksize.

Find the apropriate width (x) first (0.59f) and adjust the height to higher with Y_FACTOR > 1.0 and lower with Y_FACTOR < 1.0. The values must be clamped to [0.0, 2.0] but close to the extremes will give a very useless viewport.

If I understood your problem correctly you'd want it lower, try the y factors at 0.8f

 

It seems to work as expected in my VivePro, but no guarantees :smilewink:

Let me know how it works for you.

 


#define MASKSIZE_X 0.525f // change this to adjust the size of the mask, 0.525f seems to be ok for the Vive
#define MASKSIZE_Y_FACTOR 1.0f
#define MSAA_MASKSIZE_X 0.25f // Mask size used for MSAA - area outside this circle will not have MSAA applied on it
#define MSAA_MASKSIZE_Y_FACTOR 1.0f
[/Code]

https://drive.google.com/open?id=1bcsWJAyx7ClS0cziFLsF870EEXjeci-N

 

Modda

i9-9900KS @5.2GHz | Aorus Z390 Master | MSI RTX 3090 Gaming X Trio | 32GB DDR4 3200MHz | HP Reverb G2 | TM Warthog | Logitech G Pro

Link to post
Share on other sites

Cool that did make the shape a bit closer to what is in the visible area. These are the values I ended up with:


#define MASKSIZE_X 0.590f // PiMax Normal FOV ~150
#define MASKSIZE_Y_FACTOR 0.86f
[/Code]

 

 

The PiMax does seem to have a flatter top and bottom than the oblong oval:

attachment.php?attachmentid=212171&stc=1&d=1560810903

And my mom said I would never be an artist ;)

 

Probably not worth investing any more time on it since the perf gain would be negligible at best, if any.

 

Thanks for doing the work on this. This mod has a bigger impact on performance then the map changes that went into the OB.

Shape..jpg.13b1d8e3a603fd4646d5da4dcc83fa01.jpg

Processor: i7-8700K CPU @ 5.1GHz (OC)

Memory: 16384MB RAM DDR 4266

Card name: NVIDIA GeForce RTX 2080TI FE

VR: PiMax 5K+

HDD: Samsung SSD 960 EVO

HDD: WD SSD WDS100T2B0A-00SM50

Link to post
Share on other sites
There were even more changes needed since last OB 2.5.5.32299.

I've updated the dependencies in the Kegetys vr mod and it seems to be working at least on F/A-18, F-14B, Mig-21bis, M2000 Mirage, P-51D and A-10C.

I haven't tested what the FPS impact really is from vanilla DCS.

 

https://drive.google.com/open?id=1psMHQEFVNy26B6nnYHnwoEYxNclQBzOH

 

EDIT: No doubt, with this mod I'm on pretty steady 45fps downtown Dubai at low altitude (some drops occurs when touching the streets). Without it it's more steady 30-35 with high's at 45.

 

 

Thanks Modda, I have been using the Kegetys mod for a while now and had become used to its performance improvement. But since the 2.5.5 update that stopped working I was disappointed.

 

I tried to make it work but I did not get it: I do not have the necessary programming skills ?!

In case anyone is interested: I prefer to keep the original "glass.hlsl" file. In this way I maintain the reflections in the cockpit dome and the sun does not make strange effects with cockpit clocks ... Maintaining acceptable performance.

 

Apologies for my english: I am using the Google translator ...

 

 

regards

Link to post
Share on other sites

And my mom said I would never be an artist ;)

 

Probably not worth investing any more time on it since the perf gain would be negligible at best, if any.

 

Thanks for doing the work on this. This mod has a bigger impact on performance then the map changes that went into the OB.

 

Haha, I think that art was awesome! :thumbup:

Maybe it would be best to use a rectangle on those wide displays.

You can try to the _HDM.hlsl with the following code.

Use your regular MASKSIZE_X and experiment with the Y_FACTOR (it's just the height of the rect).

I'll add it to the zip if you find it useful.

 

 


// 0=Rectangle (experimental for wide FOV), 1=Oval
#define MASK_OVAL 0

#define ENABLE_MASK 1
#define MASKSIZE_X 0.525f // change this to adjust the size of the mask, 0.525f seems to be ok for the Vive, both for Rectangle and Oval. Unknown width for Pimax5k

// [Oval] MASK_OVAL=1 Y_FACTOR is the height relative to MASKSIZE_X to make an ellipse
// Vive,VivePro,Rift (FOV=110) 1.0f | Pimax5k+ 0.86f
// [Rectangle] MASK_OVAL=0 (Rectangle) MASKSIZE_Y_FACTOR is the height of the rectangle
// Vive,VivePro,Rift (FOV=110) 0.4f | Pimax5k+ ???f
#define MASKSIZE_Y_FACTOR 0.4f

#define MSAA_MASKSIZE_X 0.25f // Mask size used for MSAA - area outside this circle will not have MSAA applied on it
#define MSAA_MASKSIZE_Y_FACTOR 1.0f // the height relative to MSAA_MASKSIZE_X to make an ellipse, set typically 0.5-1.5 to adjust height

bool inVR()
{
// detect VR (off-center projection)
return any(gProj[2][0]);
}

void _discardHmdMask(float2 vpos, uint2 bufSize, float2 maskSize, int MaskMode)
{
#if ENABLE_MASK
// poor man's invisible area mask for the Vive, similar to the mask from OpenVR SDK (DCS For some reason does not use it)
if (inVR())
{
float2 spos = vpos / (float2) bufSize;
if(MaskMode == 1 || MASK_OVAL == 1) {
if (distance(spos * float2(1.0, 2.0-maskSize.y), float2(0.5 + gProj[2][0] / 2, 0.5) * float2(1.0, 2.0-maskSize.y)) > maskSize.x)
clip(-1);
} else {
if(abs(spos.x - (0.5 + gProj[2][0] / 2)) > maskSize.x || abs(spos.y - (0.5 + gProj[2][0] / 2)) > maskSize.y)
clip(-1);
}
}
#endif
}

uint2 getBufferSize(in TEXTURE_2D(uint2, buf))
{
uint2 bufSize;
#ifdef MSAA
uint samples;
buf.GetDimensions(bufSize.x, bufSize.y, samples);
#else
buf.GetDimensions(bufSize.x, bufSize.y);
#endif
return bufSize;
}

void discardHmdMask(float2 vpos, uint2 bufSize)
{
_discardHmdMask(vpos, bufSize, float2(MASKSIZE_X, MASKSIZE_Y_FACTOR), MASK_OVAL);
}

void discardHmdMaskMSAA(float2 vpos, uint2 bufSize)
{
_discardHmdMask(vpos, bufSize, float2(MSAA_MASKSIZE_X, MSAA_MASKSIZE_Y_FACTOR), 1);
}

void discardHmdMaskWrite(float2 vpos)
{
#if ENABLE_MASK
#endif
}
[/Code]

 

Modda

i9-9900KS @5.2GHz | Aorus Z390 Master | MSI RTX 3090 Gaming X Trio | 32GB DDR4 3200MHz | HP Reverb G2 | TM Warthog | Logitech G Pro

Link to post
Share on other sites

I tried to make it work but I did not get it

 

Hi!

Doesn't it work at all? If so, do you get any error messages? A screenshot would be very helpful.

 

I prefer to keep the original "glass.hlsl" file.

Does the mod break after keeping the original glass.hlsl?

 

Modda

i9-9900KS @5.2GHz | Aorus Z390 Master | MSI RTX 3090 Gaming X Trio | 32GB DDR4 3200MHz | HP Reverb G2 | TM Warthog | Logitech G Pro

Link to post
Share on other sites
Hi!

Doesn't it work at all? If so, do you get any error messages? A screenshot would be very helpful.

 

 

Does the mod break after keeping the original glass.hlsl?

 

Modda

 

 

...maybe I do not explain myself well, thanks to your modification that I downloaded from your DRIVE no problem. I can fly again with the same fps as version 2.5.4...THANKS AGAIN!!!

 

 

If I keep the file "glass.hlsl" the mod works perfectly and the sim is still looking perfect. Maybe I do not have so much improvement in performance but I prefer it: better eye candy!!!

Link to post
Share on other sites
Haha, I think that art was awesome! :thumbup:

Maybe it would be best to use a rectangle on those wide displays.

You can try to the _HDM.hlsl with the following code.

Use your regular MASKSIZE_X and experiment with the Y_FACTOR (it's just the height of the rect).

I'll add it to the zip if you find it useful.

 

Modda

 

Finally had a little bit of time to test this no real FPS difference and I think it was a little easier to get the mask right using the oval.

Processor: i7-8700K CPU @ 5.1GHz (OC)

Memory: 16384MB RAM DDR 4266

Card name: NVIDIA GeForce RTX 2080TI FE

VR: PiMax 5K+

HDD: Samsung SSD 960 EVO

HDD: WD SSD WDS100T2B0A-00SM50

Link to post
Share on other sites
Finally had a little bit of time to test this no real FPS difference and I think it was a little easier to get the mask right using the oval.

 

Ok! Thanks for testing it, we'll stick to the oval then :thumbup:

 

Modda

i9-9900KS @5.2GHz | Aorus Z390 Master | MSI RTX 3090 Gaming X Trio | 32GB DDR4 3200MHz | HP Reverb G2 | TM Warthog | Logitech G Pro

Link to post
Share on other sites
Sice the latest update this mod isnt working anymore.
Dcs update would always wipe out any third party mod.

It is advice to reinstall mod like this after update.

Windows 10 Pro 64bit|Intel i5 7600k @3.8Ghz|Gigabyte GTX 1060 6G|Corair vengence 32G DDR4 @3000mhz|Gigabyte Z270 HD3|Thrustmaster Flightstick| T-16000M Throttle| Samsung Odyssey Plus Headset

Link to post
Share on other sites
Sice the latest update this mod isnt working anymore.
Did you download the fix from my post #804 or the original kegetys?

 

Modda

 

Sent from my SM-G950F using Tapatalk

i9-9900KS @5.2GHz | Aorus Z390 Master | MSI RTX 3090 Gaming X Trio | 32GB DDR4 3200MHz | HP Reverb G2 | TM Warthog | Logitech G Pro

Link to post
Share on other sites

Ok, using the one in post #804 seems to work, at least for instant action on P51. Well, I'm still loading, but it hasn't given me the shader error.

[sIGPIC][/sIGPIC]



Saitek x45 Hotas

Canadian!

Link to post
Share on other sites
  • Kegetys changed the title to VR Shaders mod for better VR experience
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...