blackrack

[WIP][1.8] Scatterer-atmospheric scattering (v0.0541 - 26/10/2019)

Recommended Posts

3 minutes ago, blackrack said:

Could you test if the performance issue persists with stock only?

 

This also doesn't make sense but whatever works...

The performance does occur with stock only if I use DX11. I don't know what the deal is there. It's fine if I click the runway, pick a craft, and launch.  But if I go into VAB or SPH, build/load a craft, hit launch, I'm hit with that bug until restarting the game, it's unrelated to Scatterer but the only way I can use Scatterer with no graphical issues. DX9 and 10 work perfectly fine performance wise, but then terrain shadows are a bust and go all stripey

Edited by Sabor

Share this post


Link to post
Share on other sites
2 minutes ago, Sabor said:

The performance does occur with stock only if I use DX11. I'm don't know what the deal is there. It's fine if I click the runway, pick a craft, and launch.  But if I go into VAB or SPH, build/load a craft, hit launch, I'm hit with that bug until restarting the game. DX9 and 10 work perfectly fine, but then terrain shadows are a bust and go all stripey

Are there no issues in the debug log? The terrain shadows issue is known as "shadow acne" and is out of my hands, it's more of an issue with how unity does shadows, might be a reason why SQUAD chose to not have terrain shadows.

Edited by blackrack

Share this post


Link to post
Share on other sites
27 minutes ago, blackrack said:

Are there no issues in the debug log? The terrain shadows issue is known as "shadow acne" and is out of my hands, it's more of an issue with how unity does shadows, might be a reason why SQUAD chose to not have terrain shadows.

The only issues in the log are...

HKb3sOx.jpg

And I don't *think* these would cause this performance issue in DX11 but not 9/10

I guess I'm just going to have to use DX10 and turn off terrain shadows, which is a shame because damn they look good

Edited by Sabor

Share this post


Link to post
Share on other sites

Quick question to anyone who would know, I have an issue with large float and Color arrays never getting garbage collected despite leaving no references or anything behind and the arrays going out of scope.

Should I use unsafe code like this to manage that memory myself?

Edited by blackrack

Share this post


Link to post
Share on other sites
1 minute ago, Thomas P. said:

Unitys Garbage Collector is old and broken, so this behaviour is normal :( I'm not sure if manually collecting them would work better.

Well it seems using Marshal.FreeHGlobal() should work, or so the internet says, I was just wondering if there wouldn't be issues in runtime, or on linux and mac when using unsafe code.

Share this post


Link to post
Share on other sites
Just now, Thomas P. said:

Well the problem here is that C# Unsafe is still executed through the runtime and still managed by the GarbageCollector, even if it is called manually. IIRC you would have to interop with C/C++ directly to free it, but that would make the GC go nuts again.

I see, however in that ink I posted earlier the poster reports the memory successfully being freed. So I don't really know what's happening behind the scenes but I thought it might still be useful to try.

Share this post


Link to post
Share on other sites

@blackrack I have found a bug where there is no flare around the sun. Nor in atmosphere or in space. The sun right now for me is just white ball in the sky

Share this post


Link to post
Share on other sites
1 hour ago, Joco223 said:

@blackrack I have found a bug where there is no flare around the sun. Nor in atmosphere or in space. The sun right now for me is just white ball in the sky

Are you sure you have the latest version? Did this happen before? Are you using any rescale mods? Information is key here.

31 minutes ago, atomontage said:

Hey @blackrack! The game getting stuck at KSC is actually not an issue with Scatterer.

Yes I knew this for a while but people always associate it with scatterer regardless so I put it in the known issues sections. Also in the previous version (last week) there was a very similar bug with the view stuck but also with a blue background behind KSC that was indeed caused by scatterer so it was a bit confusing.

Edited by blackrack

Share this post


Link to post
Share on other sites

Guys this is a scatterer issue or  new EVE  ? 

3OqWGRy.png  

 

And in the map view it is not there:

 

927S60f.png

Edited by Jovzin

Share this post


Link to post
Share on other sites
37 minutes ago, Jovzin said:

Guys this is a scatterer issue or  new EVE  ? 

3OqWGRy.png  

 

And in the map view it is not there:

 

927S60f.png

I have a feeling it's EVE. I'm experiencing the problem too

Share this post


Link to post
Share on other sites

Any way to resolve these weird lines?

 

 

 

Edited by Oddible

Share this post


Link to post
Share on other sites

May be experiencing issues with nuEVE + most recent version of Scatterer. Updates as I can.

Share this post


Link to post
Share on other sites
9 hours ago, Jovzin said:

Guys this is a scatterer issue or  new EVE  ? 

And in the map view it is not there:

Check if removing scatterer fixes it.

 

2 hours ago, Oddible said:

Any way to resolve these weird lines?

Switch to dx11 or disable terrain shadows.

Share this post


Link to post
Share on other sites

I shaved down the memory usage by about 200-300 mb by managing the memory myself, I only tested in 32bits on windows and dx11 and it seems to work well for me, but I'm going to need you guys to test it out and confirm whether it works or not on your platform and if the savings are indeed real.

https://mega.nz/#!HQI2TTqB!dCS6guq2vDyb0c3QVtG33nR6KMAn0T6CnITf_CqTg7w

 

18 hours ago, Thomas P. said:

Well the problem here is that C# Unsafe is still executed through the runtime and still managed by the GarbageCollector, even if it is called manually. IIRC you would have to interop with C/C++ directly to free it, but that would make the GC go nuts again.

It seems to actually work, at the KSC I now get about 1450-1500 mb memory usage instead of 1700 mb and at the runway 1750 or so instead of 1980 mb, I posted the new .dll above and I'm waiting for more people to report on how (or if) it works on their platform.

Edited by blackrack

Share this post


Link to post
Share on other sites

Linux 64bit OpenGL 1760mb free with old dll, 2072mb free with new dll, quite a saving

Share this post


Link to post
Share on other sites
16 minutes ago, selfish_meme said:

Linux 64bit OpenGL 1760mb free with old dll, 2072mb free with new dll, quite a saving

Great, do you notice longer load times on switching scenes?

Share this post


Link to post
Share on other sites
Just now, selfish_meme said:

Nothing noticeable yet

Great, I might be able to save even more memory.

Share this post


Link to post
Share on other sites
6 hours ago, blackrack said:

but I'm going to need you guys to test it out and confirm whether it works or not on your platform and if the savings are indeed real.

Tested on 64bit workaround with dx9 at KSC. Old usage: 5657MB, new usage: 5472MB. Saved 185MB
Cannot tell if load times have increased. Too little to notice in other words.

Share this post


Link to post
Share on other sites

@blackrack I took at shot at scaling the sunflare.cfg for RSS with no luck today. Could you suggest some values for that file that might cause a visible increase in the flare size? Nothing I attempt to do appears to cause a change, and I've tried a few different settings in DX9, DX11, and OpenGL.

Share this post


Link to post
Share on other sites
35 minutes ago, stratochief66 said:

@blackrack I took at shot at scaling the sunflare.cfg for RSS with no luck today. Could you suggest some values for that file that might cause a visible increase in the flare size? Nothing I attempt to do appears to cause a change, and I've tried a few different settings in DX9, DX11, and OpenGL.

I just tried

//sunFlare.png
flareSettings = 0.45,1,0.085

//sunSpikes.png
spikesSettings = 0.6,1,0.1

Literally just made it 10 times bigger by adding a zero to the last value in the first line and a decimal point to the last value in the second line

And the results:

 

Edited by blackrack

Share this post


Link to post
Share on other sites

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.