Vivero / Kerbal-VR

An add-on for Kerbal Space Program (KSP) to enable virtual reality.
MIT License
174 stars 31 forks source link

Unpleasant flickering #17

Closed killerken924 closed 4 years ago

killerken924 commented 6 years ago

As the title says, it appears to almost flickering, the interior of the ship appears to disappear i can see the outside. It does this at a fast rate and it is very unpleasant . It mainly happens in my right eye, but it also happens in my left eye. Other than that, im getting great fps and everything appears to generally be great. Specs, I7-6700k GTX-1080 16gb of Ram Windows-10

Vivero commented 6 years ago

Yep I think I see it... I think I've got a fix for it. I'll make a new release later today with the fix.

For more gory details: I think I was not being consistent in the order in which each camera renders every frame. I should stop using foreach loops, they cause more trouble than they're worth. Anyways, I think if I make sure that the cameras render in the right order (first GalaxyCamera, then Camera ScaledSpace, then Camera 00, then Camera 01, then InternalCamera), the flickering should go away.

Vivero commented 6 years ago

Closed via #19

Please let me know if the issue comes back though.

killerken924 commented 6 years ago

Problem still is taking place for me, this time i recorded it. I also noticed an error which is shown at the end of the video, if that means anything. https://www.youtube.com/watch?v=6Kkt1mDmXzg Hopefully this helps EDIT: It does appear that the error in the console was caused by my raster prop monitor

Vivero commented 6 years ago

Oh wow, okay yea that is not at all what I thought the problem was. The flickering I was seeing was not nearly that bad.

I noticed you have RasterPropMonitor installed. It seemed to me like RPM is broken in KSP 1.4. Could you do me a favor and try testing it on a clean install of KSP (no other mods, only KerbalVR)? The error you showed at the very end is talking about a function that is not used in my code, it kind of makes me think there is a broken mod somewhere that's making the rendering go bonkers.

Thanks for bringing up this issue.

killerken924 commented 6 years ago

Still appears to be there, ill try reinstalling the game.

killerken924 commented 6 years ago

Yeah a reinstall and a restart of my computer, still no luck. Could it be my drivers, i have the latest ones right now. I'll mess around more with it tomorrow, thanks for the help.

killerken924 commented 6 years ago

So i downgraded my drivers to see if that would do anything, they are now at 388.31 Still no luck for me, any suggestions? Note: It appears the flickering stops when i look up

killerken924 commented 6 years ago

It also seems this only happens near/on certain planets. I do not experience this near jool

Vivero commented 6 years ago

That is strange... I'm not sure, can't think of what else you could try... For what it's worth I've been running Nvidia drivers 388.31. I just updated to 391.01 and didn't notice any changes, nor flickering.

killerken924 commented 6 years ago

Yeah it is odd, i only experience it when you are able to see the planet/moon, i do not experience this when orbiting jool or the sun. So if im orbiting/on kerbin, i can just look away from it and it will stop New video of it https://youtu.be/npPvKl-HFVA

Vivero commented 6 years ago

I'm now seeing this issue with KSP 1.4.1. It is as you say, when you look at Kerbin. No other mods present. I'll keep looking into it.

Vivero commented 6 years ago

Hey it might be the graphics settings, I'm not sure what exactly. If every single graphics setting is toned down, there is no flickering. At some point, I changed something and started seeing the flickering. Going to narrow down exactly which graphics setting triggers the flickering.

killerken924 commented 6 years ago

Alright

Vivero commented 6 years ago

Honestly seems like it's the aggregated effect of the KSP Graphics settings. Render Quality in particular seems to have the highest impact on the rendering. When set to Fantastic I can almost guarantee I'll see the flickering effect.

I would recommend toning down all your graphics settings and experiment with what works best for your system. For reference, these settings worked well for me, and inside the cockpit still looks good:

Terrain Detail: High Terrain Scatters: On / 100% Render Quality: Fast Texture Quality: Full Res Aerodynamic FX Quality: Normal Surface FX / Underwater FX: On Screen Res: 1024x768 Full Screen: unchecked Anti-aliasing: disabled V-Sync: Don't Sync Frame Limit: 120 FPS Pixel Light Count: 8 Shadow Cascades: 0

I'm running a Core i5-6600K @ 4.1GHz / Nvidia GTX 1070 8GB

killerken924 commented 6 years ago

I noticed for me that the pixel light count mainly causes it for me. It actually works great now!

Li0n-0 commented 6 years ago

Is it somehow possible to add "The Lab Renderer"'s plugin to your project ? From Unity Asset Store description :

This is the set of scripts and shaders that drove rendering in The Lab. It is a forward renderer with support for up to 18 dynamic shadowing lights in a single pass with MSAA enabled, and it included the Adaptive Quality system that dynamically adjusts rendering resolution to maintain framerate in VR

From the language used here I understand that Unity/SteamVR support less than 18 dynamic shadowing lights, so the issue may come from this ?

Vivero commented 6 years ago

@killerken924 Ok great! I will keep this issue open while I dig a little deeper into what causes the flicker.

@Li0n-0 I'm familiar with the plugin, but I'm not sure how feasible it really is to use it as part of this mod. It is typically used while building the game in Unity, and that would require a lot of under-the-hood changes that are inaccessible at the mod level.

aVolnov commented 4 years ago

Still experiencing this on your recommended settings and on the lowest they'll go at 1024*768. The left eye 90% of the time only shows the furthest layer (sun and atmo), the right one is ok 60% of the time and flickers for the rest. Does seem to get a little better on your settings rather than default but it's still unplayable. FPS as showed by the nVidia overlay is around 88-90, so probably 90 with some error creeping in.

Running a 4790k with a 1070ti, the headset is a Vive. Anything I can do to diagnose this? There's nothing freaky in the log and my KSP install is clean.

Edit: This seems to have been fixed by downgrading KSP to 1.7.1 via Steam Betas. Now suffering from somewhat delayed tracking haha

EJTH commented 4 years ago

Hello! I experience this issue with the latest KSP version. Im about to downgrade to 1.7.1, but is there any chance that it can be fixed for new versions of KSP?

What exactly is the issue?

Vivero commented 4 years ago

Try the latest release for KSP 1.9.1. Performance is a crap-shoot, I don't expect it will ever get good. The game wasn't designed with VR in mind. Good luck!

Vivero commented 4 years ago

Everyone's performance is going to vary, I don't think there's anything else I can do here from the KerbalVR mod's perspective. If there are graphical glitches, I'm not seeing them on my system (Valve Index, Core i5, GTX 1070), and it would be unfeasible for me to test/debug anything other than that configuration, i.e. I don't have access to other headsets or graphics cards, etc.