Jump to content

[WIP][1.9.x-1.12.x] Scatterer-atmospheric scattering (0.0838 - 14/08/2022) Scattering improvements, in-game atmo generation and multi-sun support


blackrack

Recommended Posts

My best bet is to give up and just deal with the lens dirt in the unity flare, because if the person who made the mod doesn't know why it's throwing errors or what they mean then my chances of figuring it out are basically zero.  I can already tell from the log that the flare it's getting tripped up on is the transparent barycenter, I don't need to mess around with an in game configuration editor to figure that out.  

The sunflares look correct in game, you said my configs look correct, so the only real problem is the constant log spam of an error that is dragging my performance into the gutter.  Why even have the error or the repetitive log spam about it?  It isn't giving you any useful information if you can't tell me what it means, and it sure as hell isn't giving me any useful information, it's just wasting my disk space and making the game run like crap.  Seems rather pointless.

Is there a way I can tell scatterer to just be quiet so my game stops running like crap?

 

Link to comment
Share on other sites

40 minutes ago, DeliriumTrigger said:

My best bet is to give up and just deal with the lens dirt in the unity flare, because if the person who made the mod doesn't know why it's throwing errors or what they mean then my chances of figuring it out are basically zero.  I can already tell from the log that the flare it's getting tripped up on is the transparent barycenter, I don't need to mess around with an in game configuration editor to figure that out.  

The sunflares look correct in game, you said my configs look correct, so the only real problem is the constant log spam of an error that is dragging my performance into the gutter.  Why even have the error or the repetitive log spam about it?  It isn't giving you any useful information if you can't tell me what it means, and it sure as hell isn't giving me any useful information, it's just wasting my disk space and making the game run like crap.  Seems rather pointless.

Is there a way I can tell scatterer to just be quiet so my game stops running like crap?

 

Yeah just remove the mod from your gamedata and stop posting

Link to comment
Share on other sites

I understand you're probably busy and constantly inundated with support requests and i'm sympathetic to that, and i'm sorry if my frustration has annoyed you, but if you didn't want to help you could have just said that 3 days ago instead of wasting both of our time.  I tried removing sunflares with the in game editor.  the sunflares don't go away, the nres still happen, and the game still runs like crap.  believe me, if i could figure this out on my own instead of asking you for help, i would be doing that.  I've been doing that for days before I came here with hat in hand.  the error isn't something that i understand, it's referencing a line number in code, i don't know a thing about programming and as far as i have gathered the only way i'll get close to understanding it on my own is attaching a debugger, which according to the help i've gotten outside of this thread may not even work since "scatterer has issues with debug mode".

 

Edited by DeliriumTrigger
Link to comment
Share on other sites

Alright, well, you told me to delete scatterer and stop posting, but I'm stubborn and I really want these flares without lens dirt.  So after much tutorial reading and handholding by JonnyOThan in the /r/ksp discord, I managed to attach the debugger and feed him enough information to (I think?  Hope?) nail down the issue.  Don't shoot the messenger, I'm just gonna pass along what I gathered, do with it what you will.

PzJSPDs.png

so... "hey there's more of these"

https://github.com/LGhassen/Scatterer/blob/3124f0cbaa051d77bdfb548bcc2ee054f8b36411/scatterer/Effects/SunFlare/SunflareCameraHook.cs#L27

https://github.com/LGhassen/Scatterer/commit/3124f0cbaa051d77bdfb548bcc2ee054f8b36411

also I guess I'm supposed to ping @linuxgurugamer since he's the one that was working on it? 

idk, my head hurts, i need an aspirin.  IDK how you guys do it, but after all this I can understand why you're so grumpy about it when someone throws a problem in your lap.

edit:  and of course, if you need any more info from me, i'll provide it, just ask.

Edited by DeliriumTrigger
Link to comment
Share on other sites

2 hours ago, DeliriumTrigger said:

I worked on it because I was having issues, but @blackrack is the maintainer.

There are about another 140 places in the code where ReferenceEquals() is used @blackrack.  I don't have time to go through them all; since you know the code, you might want to go through and either replace them all or the ones that might be an issue.  For now, I can patch things which I hear about or see in my log files.

PR is here:  https://github.com/LGhassen/Scatterer/pull/174

Link to comment
Share on other sites

51 minutes ago, linuxgurugamer said:

Cheers, I will build with this and see if it helps.  You have, as always, my eternal gratitude :)

Edit:  No joy.  Thanks for looking into it anyway.  Seems this problem is a hydra, cut one head off and another one pops up.

Edited by DeliriumTrigger
Link to comment
Share on other sites

7 hours ago, DeliriumTrigger said:

Alright, well, you told me to delete scatterer and stop posting, but I'm stubborn and I really want these flares without lens dirt.  So after much tutorial reading and handholding by JonnyOThan in the /r/ksp discord, I managed to attach the debugger and feed him enough information to (I think?  Hope?) nail down the issue.  Don't shoot the messenger, I'm just gonna pass along what I gathered, do with it what you will.

PzJSPDs.png

so... "hey there's more of these"

https://github.com/LGhassen/Scatterer/blob/3124f0cbaa051d77bdfb548bcc2ee054f8b36411/scatterer/Effects/SunFlare/SunflareCameraHook.cs#L27

https://github.com/LGhassen/Scatterer/commit/3124f0cbaa051d77bdfb548bcc2ee054f8b36411

also I guess I'm supposed to ping @linuxgurugamer since he's the one that was working on it? 

idk, my head hurts, i need an aspirin.  IDK how you guys do it, but after all this I can understand why you're so grumpy about it when someone throws a problem in your lap.

edit:  and of course, if you need any more info from me, i'll provide it, just ask.

 

4 hours ago, linuxgurugamer said:

I worked on it because I was having issues, but @blackrack is the maintainer.

There are about another 140 places in the code where ReferenceEquals() is used @blackrack.  I don't have time to go through them all; since you know the code, you might want to go through and either replace them all or the ones that might be an issue.  For now, I can patch things which I hear about or see in my log files.

PR is here:  https://github.com/LGhassen/Scatterer/pull/174

Thanks a lot to both of you for putting in the time. If you look on my dev branch I've already replaced every ReferenceEquals there 50a2f8e , haven't merged to master/released yet because I haven't had enough time for testing. This one should be included as well though I will check it later.

@DeliriumTrigger I honestly blew you off because you seemed quite rude and unwilling to narrow it down when I suggested doing so. If you still have the issue isolate the sunflare causing it (remove the others) and look for what's causing it: Is it the config itself? Does the default config cause the same issue? Is it related to the transparent body potentially missing a component? Does it work another body? Is there another ModuleManager patch somewhere else overriding the config?

Link to comment
Share on other sites

50 minutes ago, blackrack said:

Thanks a lot to both of you for putting in the time. If you look on my dev branch I've already replaced every ReferenceEquals there 50a2f8e , haven't merged to master/released yet because I haven't had enough time for testing. This one should be included as well though I will check it later.

@DeliriumTrigger I honestly blew you off because you seemed quite rude and unwilling to narrow it down when I suggested doing so. If you still have the issue isolate the sunflare causing it (remove the others) and look for what's causing it: Is it the config itself? Does the default config cause the same issue? Is it related to the transparent body potentially missing a component? Does it work another body? Is there another ModuleManager patch somewhere else overriding the config?

That's great news, I'll build the dev branch tomorrow (well, today, but much later) and give it a whirl.  Now that I know how to load up the plugin in debug mode, if I run into any problems I'll at least be a little better equipped to give you information that's a bit more helpful than a simple NRE.  

I admit that I was frustrated and inarticulate and the whole thing could have been handled better.  I was grinding on trying to find *some* way to get this lens dirt gone for quite some time. Even offered to buy Jade lunch to fix the unity flare, assuming it was as simple as replacing that dirt layer with a transparent one, only to find that it was much more involved than that and that addressing it was going to be quite the undertaking.  When you didn't address the NREs and then I loaded the in game editor just to find that it was an in-game text editor, it felt like a complete brush off, and even though that's totally fair since you don't owe me *anything*, I didn't handle it well.  It wasn't you, it was just realizing that I was basically at the extent of my abilities and out of options, and I vented.  Sorry for that.

Didn't mean to imply in any way that you don't understand your own mod or anything of the sort, though I see now how that was how you took it.  It was more an "well damn, if I've been banging my head against this wall for a week, and you just looked at the logs and don't see anything obvious, I'm *never* going to fix this" exasperated statement.  I think the vent about the uselessness of the error message was valid, but also unnecessary, after all it's not like you designed the engine or how it reports NREs.  

To address the last bit, I did try using the in game editor to delete the sunflare config for Destiny as you suggested, and when I cleared it all out and reloaded the config, Destiny was still there in all of it's scattery glory.  I don't know if *that* is a bug or just pebcak or what, but it's worth mentioning.  At any rate, coming from 15+ minute load times on my full install, restarting KSP with less than 10 mods total isn't much of a bother at all so I'll start with your suggestion if I run into any more problems with the dev build and report my findings as best as I can.

Thanks for your help :)

Edited by DeliriumTrigger
Link to comment
Share on other sites

Okay!  I have good news and bad news.

The good news is that simply commenting out the Sun (read: barycenter) config entirely made the NREs stop, and while the sun is visible in game, it's also super tiny and only visible if you go out of your way to zoom in on it, so it looks correct for my purposes.  Tested in both the release and dev build. The bad news is that I only found this out by commenting out that portion of my config outside of the game and restarting the game.  Any time I edit the flares in game with the scatterer in game editor, it throws an exception and nothing actually changes.  I'll spare you the full log, if you want it I can reproduce and provide but here is the relevant NRE that happens when I use the in game editor:

Spoiler

 

[Scatterer][Info] Applying sunflare config from UI:
Kerbol
{
//	syntaxVersion = 2
//	flareColor = 1.0,1.0,1.0
//	flares
//	{
//		Item
//		{
//			texture = BeyondHome/Scatterer/Config/Sunflares/Kerbol/sunFlare.png
//			displayAspectRatio = 1
//			scaleCurve
//			{
//				key = 1 6 0 -0.2
//				key = 52 1.25 0 -0.01
//				key = 76 0.8 0 -0.005
//				key = 262 0.3 0 0
//				key = 434 0.1 0 0
//			}
//			intensityCurve
//			{
//				key = 2 0.0 0 0
//				key = 11 1 0 0
//			}
//		}
//		Item
//		{
//			texture = BeyondHome/Scatterer/Config/Sunflares/Kerbol/sunSpikes.png
//			displayAspectRatio = 1
//			scaleCurve
//			{
//				key = 1 6 0 -0.2
//				key = 52 2.5 0 -0.01
//				key = 76 1 0 -0.005
//				key = 262 0.3 0 0
//				key = 434 0.1 0 0
//			}
//			intensityCurve
//			{
//				key = 2 0.0 0 0
//				key = 11 1 0 0
//				key = 60 0.6 0 0
//			}
//		}
//	}
//	ghosts
//	{
//		Item
//		{
//			texture = BeyondHome/Scatterer/Config/Sunflares/Kerbol/Ghost2.png
//			intensityCurve
//			{
//				key = 2 0 0 0
//				key = 11 1 0 0
//				key = 135 0 0 0
//			}
//			instances
//			{
//				Item
//				{
//					intensityMultiplier = 0.4
//					displayAspectRatio = 1
//					scale = 0.05
//					sunToScreenCenterPosition = -0.25
//				}
//				Item
//				{
//					intensityMultiplier = 0.4
//					displayAspectRatio = 1
//					scale = 0.14
//					sunToScreenCenterPosition = 0.2
//				}
//				Item
//				{
//					intensityMultiplier = 0.4
//					displayAspectRatio = 1
//					scale = 0.02
//					sunToScreenCenterPosition = 0.5
//				}
//				Item
//				{
//					intensityMultiplier = 0.2
//					displayAspectRatio = 1
//					scale = 0.08
//					sunToScreenCenterPosition = 0.8
//				}
//				Item
//				{
//					intensityMultiplier = 0.1
//					displayAspectRatio = 1
//					scale = 0.17
//					sunToScreenCenterPosition = 1.2
//				}
//				Item
//				{
//					intensityMultiplier = 0.2
//					displayAspectRatio = 1
//					scale = 0.06
//					sunToScreenCenterPosition = 1.7
//				}
//				Item
//				{
//					intensityMultiplier = 0.15
//					displayAspectRatio = 1
//					scale = 0.014
//					sunToScreenCenterPosition = 2.0
//				}
//			}
//		}
//		Item
//		{
//			texture = BeyondHome/Scatterer/Config/Sunflares/Kerbol/Ghost3.png
//			intensityCurve
//			{
//				key = 2 0 0 0
//				key = 11 1 0 0
//				key = 135 0 0 0
//			}
//			instances
//			{
//				Item
//				{
//					intensityMultiplier = 0.35
//					displayAspectRatio = 1
//					scale = 0.09
//					sunToScreenCenterPosition = -0.3
//				}
//				Item
//				{
//					intensityMultiplier = 0.4
//					displayAspectRatio = 1
//					scale = 0.07
//					sunToScreenCenterPosition = 0.3
//				}
//				Item
//				{
//					intensityMultiplier = 0.3
//					displayAspectRatio = 1
//					scale = 0.04
//					sunToScreenCenterPosition = 0.55
//				}
//				Item
//				{
//					intensityMultiplier = 0.2
//					displayAspectRatio = 1
//					scale = 0.04
//					sunToScreenCenterPosition = 0.85
//				}
//				Item
//				{
//					intensityMultiplier = 0.1
//					displayAspectRatio = 1
//					scale = 0.25
//					sunToScreenCenterPosition = 1.45
//				}
//				Item
//				{
//					intensityMultiplier = 0.2
//					displayAspectRatio = 1
//					scale = 0.06
//					sunToScreenCenterPosition = 1.74
//				}
//				Item
//				{
//					intensityMultiplier = 0.15
//					displayAspectRatio = 1
//					scale = 0.04
//					sunToScreenCenterPosition = 2.02
//				}
//			}
//		}
//	}
}
 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Uploading Crash Report
NullReferenceException: Object reference not set to an instance of an object
  at Scatterer.SunFlare.LoadSettingsFromConfigNode (ConfigNode node) [0x00000] in <0f043c8a3a984ec48288f7ff5205018c>:0 
  at Scatterer.SunFlare.ApplyFromUI (ConfigNode node) [0x00000] in <0f043c8a3a984ec48288f7ff5205018c>:0 
  at Scatterer.SunflareGUI.DrawSunflareGUI () [0x001d7] in <0f043c8a3a984ec48288f7ff5205018c>:0 
  at Scatterer.GUIhandler.DrawScattererWindow (System.Int32 windowId) [0x000ef] in <0f043c8a3a984ec48288f7ff5205018c>:0 
  at UnityEngine.GUILayout+LayoutedWindow.DoWindow (System.Int32 windowID) [0x00070] in <58f888e0d56a4620958c8e58a768c70d>:0 
  at UnityEngine.GUI.CallWindowDelegate (UnityEngine.GUI+WindowFunction func, System.Int32 id, System.Int32 instanceID, UnityEngine.GUISkin _skin, System.Int32 forceRect, System.Single width, System.Single height, UnityEngine.GUIStyle style) [0x00078] in <58f888e0d56a4620958c8e58a768c70d>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
 
(Filename: <0f043c8a3a984ec48288f7ff5205018c> Line: 0)

Just to sanity check, I also tried just editing small bits of the config since I thought maybe the error was a result of commenting out an entire sunflare config, but the NRE still happens if I flip a 0.3 to a 0.7 on the intensity multiplier, change the aspect ratio, or whatever else.  This is why removing configs one by one wasn't working for me, didn't test it by just editing the config outside of the game and restarting, and missed the NRE about the editor in the gigantic log full of NRE spam.  I wrongly assumed that the problem with the editor was related to the other NRE spam when in fact it was an independent issue.

As it stands I'm pretty satisfied with how things look, could stand to change a few things with some of the ghosts to clean up a little bit but going to chill on that until I can do it with the in game editor, since seeing immediate feedback will make that whole process much easier.    If there's anything I can do to help out with the editor issue, let me know, happy to try some troubleshooting steps, test changes or send you screenshots from the debugger with my specific setup or whatever else you need.  

Edited by DeliriumTrigger
clarity,punctuation
Link to comment
Share on other sites

  • 3 weeks later...

Hi @blackrack I'm getting constant NRE log spam. It's writing every frame, so I want to fix this. 

Scatterer 0.0838 on KSP 1.12.3 with several other mods (Spectra, Parallax, Kopernicus, Principia...)

First exception: 

[EXC 22:37:01.836] NullReferenceException: Object reference not set to an instance of an object
    scatterer.OceanNode.OnPreCull () (at <684aa87c0d2345f8a9e4739403f4afff>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

Later:

Spoiler

[LOG 22:36:55.031] [Scatterer][Debug] Ocean config found for: Laythe
[ERR 22:36:55.032] [Scatterer][Error] Effects couldn't be loaded for Laythe, System.NullReferenceException: Object reference not set to an instance of an object
  at scatterer.OceanNode.InitOceanMaterial () [0x00206] in <684aa87c0d2345f8a9e4739403f4afff>:0 
  at scatterer.OceanNode.Init (scatterer.ProlandManager manager) [0x00022] in <684aa87c0d2345f8a9e4739403f4afff>:0 
  at scatterer.OceanFFTgpu.Init (scatterer.ProlandManager manager) [0x00000] in <684aa87c0d2345f8a9e4739403f4afff>:0 
  at scatterer.OceanWhiteCaps.Init (scatterer.ProlandManager manager) [0x00000] in <684aa87c0d2345f8a9e4739403f4afff>:0 
  at scatterer.ProlandManager.InitSkyAndOceanNodes () [0x00133] in <684aa87c0d2345f8a9e4739403f4afff>:0 
  at scatterer.ProlandManager.Init (scatterer.ScattererCelestialBody scattererBody) [0x00287] in <684aa87c0d2345f8a9e4739403f4afff>:0 
  at scatterer.ScattererCelestialBodiesManager.loadEffectsForBody (scatterer.ScattererCelestialBody scattererCelestialBody) [0x00022] in <684aa87c0d2345f8a9e4739403f4afff>:0 

[LOG 22:36:55.033] [Scatterer][Debug] manager couldn't be removed for Laythe because of exception: System.NullReferenceException: Object reference not set to an instance of an object
  at scatterer.OceanFFTgpu.Cleanup () [0x00006] in <684aa87c0d2345f8a9e4739403f4afff>:0 
  at scatterer.OceanWhiteCaps.Cleanup () [0x00000] in <684aa87c0d2345f8a9e4739403f4afff>:0 
  at scatterer.ProlandManager.OnDestroy () [0x00026] in <684aa87c0d2345f8a9e4739403f4afff>:0 
  at scatterer.ScattererCelestialBodiesManager.loadEffectsForBody (scatterer.ScattererCelestialBody scattererCelestialBody) [0x000da] in <684aa87c0d2345f8a9e4739403f4afff>:0 
[LOG 22:36:55.037] [Scatterer][Debug] Laythe removed from active planets.
[LOG 22:36:55.037] 9/14/2022 10:36:55 PM,KerbalAlarmClock,Scene Change from 'TRACKSTATION' to 'FLIGHT'

Player log

KSP log

 

Link to comment
Share on other sites

On 9/12/2022 at 1:27 AM, AntiAirCannon23 said:

Hi, since installing this mod, I may have had a few issues concerning the camera wobble in the map screen, I'm certain Scatterer is the cause, as I tried removing it and the camera wobbling disappearing, though that works, I would like to keep the mod installed in my gamedata folder, could there be a fix to this?

Disable the "Temporal antialiasing" setting in the scatterer settings window (the blue circle button on the toolbar when in the KSC view)

Link to comment
Share on other sites

On 9/16/2022 at 6:17 AM, Rodger said:

Disable the "Temporal antialiasing" setting in the scatterer settings window (the blue circle button on the toolbar when in the KSC view)

With the amount of issues that temporal antialiasing causes, why is it still a feature? /j

Link to comment
Share on other sites

Heads-up: If your map screen has flickering atmospheres and temporal antialiasing is off in Scatterer, it's your TUFX profile. Just ran into this, probably AA in TUFX

On 9/16/2022 at 6:17 AM, Rodger said:

Disable the "Temporal antialiasing" setting in the scatterer settings window (the blue circle button on the toolbar when in the KSC view)

 

Link to comment
Share on other sites

On 9/18/2022 at 6:35 AM, Socowez said:

With the amount of issues that temporal antialiasing causes, why is it still a feature? /j

I'm gonna say it :D TAA is the only true AA. Try looking at swaying Parallax grass with 8xMSAA, SMAA or FXAA, see how much it shimmers, then compare with TAA and you'll understand what I mean.

Link to comment
Share on other sites

17 hours ago, dok_377 said:

I have the same thing as in the screenshots above. I don't think it's a bug, probably just needs some tweaking by blackrack. It started happening when he updated atmospheres.

 

18 hours ago, Vphurple Izumi said:

So Scatterer right good stuff, but why is Laythe doing this?
Rp7xcet.png

I7aylu4.png

7cEqW7q.png

its like an extra shiny exosphere.

GameData Folder;

qm3Mf9A.png

Player.log[Link]

That's an issue with thick mie scattering which is rather low priority for me so I haven't gotten around to it.

To fix just edit the atmo to have less mie scattering, open the GUI->Laythe->atmo tab-> mie -> thicken with value 0.8 multiple times until it goes away then save.

This will make sunsets/sunrises less nice and the atmo less foggy though, adjust to taste.

Edited by blackrack
Link to comment
Share on other sites

2 hours ago, blackrack said:

 

That's an issue with thick mie scattering which is rather low priority for me so I haven't gotten around to it.

To fix just edit the atmo to have less mie scattering, open the GUI->Laythe->atmo tab-> mie -> thicken with value 0.8 multiple times until it goes away then save.

This will make sunsets/sunrises less nice and the atmo less foggy though, adjust to taste.

I did the BIG lazy and just pasted Kerbins configs for Laythe >:D

Link to comment
Share on other sites

On 9/23/2022 at 8:50 PM, Vphurple Izumi said:

I sure dose,
KimDrVR.png

HSNMEA6.png
Clouds are from SVE if you are wondring.

Which resolution do you run the game at and is this with or without any antialiasing methods?

8 hours ago, Naeth Kerman said:

Is there meant to be a grainy look to the highlight when I hover over one of the buildings in the space center view?

What?

Link to comment
Share on other sites

On 9/25/2022 at 2:39 AM, blackrack said:
On 9/24/2022 at 6:16 PM, Naeth Kerman said:

Is there meant to be a grainy look to the highlight when I hover over one of the buildings in the space center view?

What?

There's like a grainy after-image outline that lingers for a few seconds
It's much more present during flight
 

 

Edited by Naeth Kerman
clarification and video
Link to comment
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.

×
×
  • Create New...