Jump to content

[1.8] EnvironmentalVisualEnhancements [1.8.0-2]


Waz

Recommended Posts

Hello everyone,

I came up with a way to improve the performance of EVE volumetrics.

Currently on EVE, every volumetric particle has it's properties (position, transform etc) calculated and updated every frame on the CPU. This is very intensive and as you add volumetric layers the performance only gets worse (default config has 817 particles for the default kerbin config).

I came up with a way to offload these expensive operations to the GPU at no additional GPU overhead using a geometry shader. This improves the performance A LOT.

This requires shader model 4.0 and up, meaning it only works on Directx10, Directx11 and new-ish versions of Opengl, no Directx9.

To give you an idea of the performance gains, here are some tests on my i5 3470 + GTX 1060 3gb done by cloning the default volumetric layer multiple times in the 500-1000 altitude range, all tests done by loading a plane on KSC and sitting there, antialiasing is set to 4x (not sure if it has much impact here):

OWYvfil.png

 

4 layers before:

Q9nn6Ou.jpg

 

 

4 layers after (you can see soft depth is disabled here, I will fix it):

khMIvXT.jpg

 

I will upload a test version soon. But for now I go to sleep.

Edited by blackrack
Link to comment
Share on other sites

As promised, here is the EVE version with reduced CPU usage for the volumetrics (see post above): https://mega.nz/#!aB4jBCpY!ARcDynVH6PqbDn8WhXQtZ4LJ5OtavXqIKd-s786_n_w

soft depth is also fixed.

To use this with scatterer's EVE integration you need these modified shaders for scatterer: https://mega.nz/#!vZ4iAZ5R!uhEDgvaWbSOAQxQgiceQ2oVcG1IO81_R2iDZ-WpO0os

However, keep in mind that with scatterer if the ocean shaders are active the performance increase will not be as dramatic, this is because the GPU's limit will be reached much quicker than the CPU limit. That will depend on your CPU and GPU speed however.

I would like if you guys can test this and report back on the performance and any anomalies with the particle rendering.

Paging the usual suspects: @Galileo @Poodmund @Proot @Avera9eJoe  @Waz @V8jester @cobbman11 @selfish_meme

Edited by blackrack
Link to comment
Share on other sites

1 minute ago, blackrack said:

As promised, here is the EVE version with reduced CPU usage for the volumetrics (see post above): https://mega.nz/#!aB4jBCpY!ARcDynVH6PqbDn8WhXQtZ4LJ5OtavXqIKd-s786_n_w

To use this with scatterer's EVE integration you need these modified shaders for scatterer: https://mega.nz/#!vZ4iAZ5R!uhEDgvaWbSOAQxQgiceQ2oVcG1IO81_R2iDZ-WpO0os

However, keep in mind that with scatterer if the ocean shaders are active the performance increase will not be as dramatic, this is because the GPU's limit will be reached much quicker than the CPU limit.

I would like if you guys can test this and report back on the performance and any anomalies with the particle rendering.

Paging the usual suspects: @Galileo @Poodmund @Proot @Avera9eJoe  @Waz @V8jester @cobbman11 @selfish_meme

Will this work with SVE cloud configs? I guess I'll find out, I just updated and run it, will report back soonish.

Link to comment
Share on other sites

2 minutes ago, selfish_meme said:

Will this work with SVE cloud configs? I guess I'll find out, I just updated and run it, will report back soonish.

Yes, it should work (would like some testers though :D ) don't forget to run in Directx11 or whatever video mode supports shader model 4.0

Link to comment
Share on other sites

6 minutes ago, blackrack said:

Yes, it should work (would like some testers though :D ) don't forget to run in Directx11 or whatever video mode supports shader model 4.0

Yeah I totally forgot that, restarting, damn Squad forgot to add shaders for their part thumbnails in Directx11

Edited by selfish_meme
Link to comment
Share on other sites

This is pretty awesome. I will test over the next day or two for you. It should be noted though, @blackrack that there are a fair amount of users are reporting issues with KSP 1.4.* when using DX10/11/12 so as much as we should be stepping away from DX9 (Unity is deprecating DX9 from Unity 2017.3 onwards anyway, WHY ARE WE STILL USING IT?!) it is a change that should not be taken lightly.

Link to comment
Share on other sites

Just now, Poodmund said:

This is pretty awesome. I will test over the next day or two for you. It should be noted though, @blackrack that there are a fair amount of users are reporting issues with KSP 1.4.* when using DX10/11/12 so as much as we should be stepping away from DX9 (Unity is deprecating DX9 from Unity 2017.3 onwards anyway, WHY ARE WE STILL USING IT?!) it is a change that should not be taken lightly.

Yes, I'm well aware of this, however the performance gains above, as well as many other cool things we can do, are only enabled by using shader model 4.0 or 5.0

You can try to run OpenGL and see if it works but that has its own issues as well.

Link to comment
Share on other sites

41 minutes ago, blackrack said:

Yes, it should work (would like some testers though :D ) don't forget to run in Directx11 or whatever video mode supports shader model 4.0

OK I just run a test, I am running a Ryzen 5 1600x and a GTX 1080 with 16gb of Memory, playing at 1440p with all AA turned up to max, in Directx11. - no scatterer

There seems to be no discernible difference in FPS, I took video and ran them side by side, I am just looking through the log now to see if I can see anything

Edit: There might be between 5 to 10 FPS when I ran it again, hard to say, my FPS was varying between 30 - 40 between the 2 tests and dropping to 20+ when in the clouds

@Galileo you might notice the squiggles in the sky on the video.

Edited by selfish_meme
Link to comment
Share on other sites

15 minutes ago, selfish_meme said:

OK I just run a test, I am running a Ryzen 5 1600x and a GTX 1080 with 16gb of Memory, playing at 1440p with all AA turned up to max, in Directx11. - no scatterer

There seems to be no discernible difference in FPS, I took video and ran them side by side, I am just looking through the log now to see if I can see anything

Edit: There might be between 5 to 10 FPS when I ran it again, hard to say, my FPS was varying between 30 - 40 between the 2 tests and dropping to 20+ when in the clouds

@Galileo you might notice the squiggles in the sky on the video.

Check your CPU and GPU usage with the normal EVE, if you're GPU limited you will not see any improvements, this is mostly to reduce the CPU usage. At 1440p with max AA it sounds like you should be GPU limited, also try launching a ship with high higher part count or add more volumetric layers.

Edited by blackrack
Link to comment
Share on other sites

5 minutes ago, GunnDawg said:

I've installed both EVE and SVE and so far things look great on Kerbin, however the ground on the Mun is stretched out, not sure what's going on here. I'm using the high rese SVE textures if that makes a difference.

tKE7ZC4.jpg

EVE nor SVE changes anything to the textures of the surfaces. They only add clouds, citylights...

Did you install a TexturePack for Groundtextures like SVT oder KSPRC? They need Kopernicus but Kopernicus isn`t updatet yet. If you have installed Kopernicus you must reject it. As far as I know Thomas is working on a new Version of Kopernicus for 1.4.1.

Link to comment
Share on other sites

25 minutes ago, blackrack said:

Check your CPU and GPU usage with the normal EVE, if you're GPU limited you will not see any improvements, this is mostly to reduce the CPU usage. At 1440p with max AA it sounds like you should be GPU limited, also try launching a ship with high higher part count or add more volumetric layers.

I am definitely CPU bound, GPU usage didn't get much above 30 or 40% where one CPU core is almost always maxxed out when in flight

Link to comment
Share on other sites

23 minutes ago, selfish_meme said:

I am definitely CPU bound, GPU usage didn't get much above 30 or 40% where one CPU core is almost always maxxed out when in flight

And you don't see any performance benefits? That's weird, I was CPU bound in my test cases above and saw huge improvements.

Any screenshots of what your test run looks like? Are you using any other CPU-heavy mods?

You should be able to see two maxed cores however not one.

And maybe the ship you're launching dwarfs any performance gains by EVE volumetrics?

Edited by blackrack
Link to comment
Share on other sites

Just woke up to this :) I'll give it a go with Spectra this afternoon, most likely on stream since I've been getting back into building. Spectra has relatively few cloud layers all things considered (5 on Eve, 2 on Kerbin, 3 on Jool, 3 on Laythe). I've been running without Scatterer in 1.4 since it seems to be causing a bunch of extra lag compared to before, atleast when near oceans. I was getting 24 frames when flying to the island with an 85 part jet. 1440p, max AA, 1080ti Duke OC, I7-6700K.

Edited by Avera9eJoe
Link to comment
Share on other sites

@blackrack I tested it out and with a basic SVE install (Scatterer, EVE, and SVE) and I'm not seeing a big gain in performance.

4 minutes ago, Avera9eJoe said:

Just woke up to this :) I'll give it a go this afternoon, most likely on stream since I've been getting back into building. Been running without Scatterer in 1.4 since it seems to be causing a bunch of extra lag compared to before. Atleast when flying in and around oceans. 1440p, max AA, 1080ti Duke OC, I7-6700K.

You should not be experiencing anymore lag than before. Are you certain you have water refractions turned off?

Edited by Galileo
Link to comment
Share on other sites

1 minute ago, Galileo said:

@blackrack I tested it out and with a basic SVE install (Scatterer, EVE, and SVE) and I'm not seeing a big gain in performance.

You should not be experiencing anymore lag than before. Are you certain you have water refractions turned off?

I'll need to confirm; I thought I had a config to disable those automatically with Spectra but I might have missed something? I'll be back on in a few hours to report.

Link to comment
Share on other sites

5 minutes ago, Galileo said:

@blackrack I tested it out and with a basic SVE install (Scatterer, EVE, and SVE) and I'm not seeing a big gain in performance.

As I said depends on your CPU/GPU combo and how many volumetric layers you are running. Also with scatterer you reach the GPU limit faster anyway. In my tests above I get pretty much double the framerate but once I added scatterer it was basically the same as before.

I remember at one point there was a tornado that was using 3 or so volumetric layers, I imagine that would run better.

Edited by blackrack
Link to comment
Share on other sites

2 minutes ago, blackrack said:

As I said depends on your CPU/GPU combo and how many volumetric layers you are running.

I remember at one point there was a tornado that was using 3 or so volumetric layers, I imagine that would run better.

980ti and a i5 4790k overclocked to 4.2 ghz. I always stay above 70 fps regardless so I guess i wouldnt see much difference, especially since SVE never uses more than 2 volumetric layers. Ill keep toying with it!

 

Link to comment
Share on other sites

1 minute ago, Galileo said:

980ti and a i5 4790k overclocked to 4.2 ghz. I always stay above 70 fps regardless so I guess i wouldnt see much difference, especially since SVE never uses more than 2 volumetric layers. Ill keep toying with it!

Yep, shouldn't make much difference to you in any case. Next, to lower the GPU usage of scatterer...

Link to comment
Share on other sites

Daft question here..  Is it normal that terrainmanager, atmospheremanager and textureconfig tabs throw an error about no config? 

I got EVE 1.4.0-1, no scatterer and SVE 1.3.0. + hires 1.0.6. Installed with CKAN1.24.

For example this:

No config! Please add a config with the content of "EVE_ATMOSPHERE{}" to populate.

I guess it wants the eve_atmosheres.cfg which lives here in my setup:

C:\SteamLibrary\steamapps\common\Kerbal Space Program\GameData\StockVisualEnhancements\SVE_Configs

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

Edited by barleyman
Link to comment
Share on other sites

1 minute ago, barleyman said:

Daft question here..  Is it normal that terrainmanager, atmospheremanager and textureconfig tabs throw an error about no config? 

I got EVE 1.4.0-1, no scatterer and SVE 1.3.0. + hires 1.0.6. Installed with CKAN1.24.

For example this:


No config! Please add a config with the content of "EVE_ATMOSPHERE{}" to populate.

I guess it wants the eve_atmosheres.cfg which lives here in my setup:

C:\SteamLibrary\steamapps\common\Kerbal Space Program\GameData\StockVisualEnhancements\SVE_Configs

 

Yes, because those are no longer used/no longer function in EVE.

Edited by Galileo
Link to comment
Share on other sites

10 minutes ago, barleyman said:

Oh, okay. The installation docs are a bit light.. So theoretically nothing needs to be adjusted out of ckan?

you will need cfgs, like the default EVE cfgs or SVE, but other than that, no, nothing needs adjusting.

Edited by Galileo
Link to comment
Share on other sites

Just now, Galileo said:

you will need cfgs, like the default EVE cfgs or SVE, but other than that, no nothing needs adjusting.

Yes, well, CKAN  put them into the gamedata folder but EVE will find the cfg files automagically in the SVE folder? 

Incidentally, EVE cloudmanager generates errors in the logfile. I'm not sure if that means anything but you can see them in the end of the file. 

[LOG 18:04:43.758] [EVE CloudsManager]: CloudsPQS: (EVE Clouds: Laythe-Atmo) OnSphereInactive
[LOG 18:04:43.758] [EVE CloudsManager]: Clouds2D is now SCALED
[ERR 18:04:43.759] Exception handling event onGameSceneLoadRequested in class CloudsPQS:System.NullReferenceException: 
  at (wrapper managed-to-native) UnityEngine.Object:get_name ()
  at Atmosphere.CloudsPQS.OnSphereInactive () [0x00000] in <filename unknown>:0 
  at Atmosphere.CloudsPQS.SceneLoaded (GameScenes scene) [0x00000] in <filename unknown>:0 
  at EventData`1[GameScenes].Fire (GameScenes data) [0x00000] in <filename unknown>:0 

[EXC 18:04:43.760] NullReferenceException
	Atmosphere.CloudsPQS.OnSphereInactive ()
	Atmosphere.CloudsPQS.SceneLoaded (GameScenes scene)
	EventData`1[GameScenes].Fire (GameScenes data)
	UnityEngine.Debug:LogException(Exception)
	EventData`1:Fire(GameScenes)
	HighLogic:SetLoadSceneEventsAndFlags(GameScenes, Boolean)
	HighLogic:LoadScene(GameScenes)
	KSCPauseMenu:<draw>m__9()
	DialogGUIButton:OptionSelected()
	DialogGUIButton:<Create>m__6()
	UnityEngine.EventSystems.EventSystem:Update()
[LOG 18:04:43.760] [EVE CloudsManager]: CloudsPQS: (EVE Clouds: Duna-Atmo) OnSphereInactive

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...