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

Despite hundreds of bug reports, weird things and even more weird puns.

I just want to say..

Thank you! You did so much for me and thousands of other people who use this mod to make the game look absolutely amazing. The work you did is astounding, stunning. It is really great that you share it, without thinking of the non-existent gain. 

Reminder: You are awesome.

Link to comment
Share on other sites

Hey! I have a suggestion. Myself and @Avera9eJoe have been talking, and we feel as if disabling Scatterer's EVE integration is a massive blow to the quality of planets when both mods are used in conjunction. 

The problem (isn't a bug), is that we like to use EVE cloud layers as glows for non-atmospheric planets, such as this:

TWRCv7X.png

However we can't do this if Scatterer's EVE integration is enabled, as it destroys the daylight side of the planet (the glow only appears at night where scatterer is "least active")

I'm suggesting that in the planetsList config file, we can specify whether the integration is enabled for each individual planet. For example:

scattererCelestialBodies
	{
		Item
		{
			celestialBodyName = Gaia
			transformName = Gaia
				[...]
			{
				[...]
			}
		EVEIntegration = FALSE // <-------
		}

And then we can use modulemanager configs to do this (this is pseudocode):

@Scatterer:NEEDS[EVE]
{
	@Scatterer[Scatterer_planetsList]
		{
			@scattererCelestialBodies
			{
				@celestialBodyName [Gaia]
					{
						IntegrateWithEVEClouds = false
					}
			}
		}
}

 

Link to comment
Share on other sites

Though I still wouldn't be able to add multi-colored atmospheres to Eve or Duna if I can't have Layer2D run alongside Scatterer ;.; It would be a nice fix for non-atmospheric bodies though

Edited by Avera9eJoe
Link to comment
Share on other sites

20 minutes ago, Gameslinx said:

Hey! I have a suggestion. Myself and @Avera9eJoe have been talking, and we feel as if disabling Scatterer's EVE integration is a massive blow to the quality of planets when both mods are used in conjunction. 

The problem (isn't a bug), is that we like to use EVE cloud layers as glows for non-atmospheric planets, such as this:

However we can't do this if Scatterer's EVE integration is enabled, as it destroys the daylight side of the planet (the glow only appears at night where scatterer is "least active")

I'm suggesting that in the planetsList config file, we can specify whether the integration is enabled for each individual planet. For example:

And then we can use modulemanager configs to do this (this is pseudocode):

Per-planet EVE integration has already been suggested by @Galileo, and in fact I've implemented it 4 days ago: https://github.com/LGhassen/Scatterer/commit/8718f61876ef5db4ac3f8a08a98fe74d4bb86bab

it will be in the next release.

15 minutes ago, Avera9eJoe said:

Though I still wouldn't be able to add multi-colored atmospheres to Eve or Duna if I can't have Layer2D run alongside Scatterer ;.; It would be a nice fix for non-atmospheric bodies though

Wait, could you elaborate on this? Whi would this mess up multi-colored atmospheres?

7 hours ago, cratercracker said:

Despite hundreds of bug reports, weird things and even more weird puns.

I just want to say..

Thank you! You did so much for me and thousands of other people who use this mod to make the game look absolutely amazing. The work you did is astounding, stunning. It is really great that you share it, without thinking of the non-existent gain. 

Reminder: You are awesome.

7 hours ago, Dafni said:

Roger that. Just saw your SSRSS post too now. We must have posted at almost the same time.

Anyway, lets hope this info helps blackrack to track down the issue.

And to Blackrack himself a huge Thank You for this lovely mod and all the work to maintain it. You make the KSP experience a lot more beautiful.

Thanks, and thank you all for supporting me since the beginning.

@cratercracker I added your fanart to the OP, thanks a lot :)

Link to comment
Share on other sites

44 minutes ago, blackrack said:

Wait, could you elaborate on this? Whi would this mess up multi-colored atmospheres?

I believe he means having the Layer2D and scatterer atmospheric integration work together on one planet. The thing is, turning on integration will remove the effect of the Layer2D glow and bring back the terminator dawn/dusk lines on the planet. Turning it off removes the terminators and gives back the glow.

That might he hard to integrate, though, but I would also love this. 

Link to comment
Share on other sites

1 hour ago, blackrack said:

Wait, could you elaborate on this? Whi would this mess up multi-colored atmospheres?

Aye I wrote that pretty fast sorry :P

   In a nutshell, I use Scatterer to give planets their realistic haze and atmosphere, but I use EVE's Layer2D glow to add accent colors. If you take a peek at Laythe or Duna in my current release of Spectra, you'll notice that I added a feint color shift with Layer2D at the edge of their atmospheres. Duna has a blue glow and Laythe green. Likewise on Kerbin and Eve though unfinished. If EVE-Scatterer integration is off then both effects stack nicely to give the planet a scifi-esque, oldschool glow. However when EVE-Scatterer integration is on, the Layer2D effects break something and turn all cloud layers black, and kill all Layer2D and Scatterer effects.

The takeaway is that disabling Eve-Scatterer integration on a planet by planet basis wouldn't help me because I have to use both Scatterer and Layer2D on the same planet to create multicolored atmospheres. The godsend would be to somehow get them to both work alongside each other and still have EVE-Scatterer integration enabled... though I haven't a clue if that's possible. Perhaps disabling Scatterer-EVE integration on Layer2D would fix it? I'm just grasping at straws :P

 

   There's also an unrelated EVE-Scatterer integration bug I found were cloud layers and terminators change color correctly but the volumetric particles stay solid white but that's not related to Layer2D so I'll chat about that later on I think

 

EDIT: I made a lot of changes to this message after posting this... sorry :P I probably added more if you read it before the edit time v

Edited by Avera9eJoe
Link to comment
Share on other sites

With that all said though I'll probably remove my multicolored glows and turn on integration for the time being... :P - people are more used to the beautiful terminators and to quote @million_lights on this topic, "It's better to steal a kids present that he doesn't know about than steal one he's already got!"

But Vall though...

R77svk6.png

 It won't have a shift to teal until Layer2D is re-added ;.;

Edited by Avera9eJoe
Link to comment
Share on other sites

@blackrack another very minor thing could be to add comparability with @Artyomka15's Instantiator plugin. I see a few more planet packs are using it, but scatterer doesn't draw over the top of it. Perhaps there's a way to force scatterer to load after Instantiator? (It's a special kind of ring which I imagine takes after the Kopernicus rings)

Link to comment
Share on other sites

On 5/29/2017 at 1:27 AM, Bombaatu said:

Sorry if I wasn't clear.  What you need is on the screen where you can go to Start New Game or Settings; right after the game finishes loading completely (when you first here the music), but before you select which save you're going to play. there should be a Scatterer settings panel overlaid on the upper left - if not, hit alt-f10 or alt-f11. The setting you are looking for is "Alternate SQRT in shader" (3rd radio button from the bottom):

That worked, thank you!
Sadly it does affect my framerate a lot too. But looks really pretty!. So I might still use it for a Screenshot when FPS isn't important :)
(GPU used is a AMD Radeon R9 M395X 4096 MB )

Edited by Bersaelor
typos
Link to comment
Share on other sites

Hey, question for anyone who does long aircraft missions.

 

Is there anyone getting a gradual slowdown from extended time (several hours) spent in a single scene instance?

 

For example, I long-haul turboprops for survey missions, and the missions take upwards of four hours.  I take off and get going with almost perfect smooth framerate, but over the course of the flight, it gradually slows down until my time ratio is 33 percent of realtime.

I thought it might have been related to physics, but I left my program on in the space center while I slept, and came back to it being jittery and slow as well.  Of the two solid instances, I can see the following behavior.

 

1: In a long haul flight, especially if it goes through a Kerbin 'night', in an atmosphere, it slows to a crawl.  If I swap to map view, it's smooth and fast, but reduces to a crawl when I swap back.  Completing the flight and RTBing, then returning to the space center smoothed it up.

2: Left the space center in view for eight hours while I slept.  Woke up to it being a crawl.  Switching to a flight and recovering the flight smoothed it out both at flight start, and after returning to the space center.

 

I'm thinking that because this seems to occur without regard to a physics condition, that it's a problem with a graphics thread over long operational periods without a 'reset'.  That put scatterer in as a potential contender.  So I'd like to check if anyone is seeing this behavior, or may now know to set up and test for said behavior.

Link to comment
Share on other sites

@AdmiralTigerclaw I have heard of the same issue only once in the past, but I am not sure many people leave their games on overnight, and thus, never experience the problem. My only suggestion is to turn off KSP if you aren't playing it.

This is an issue that takes particular circumstances to happen, so I wouldn't call it a memory leak or a bug. 

It's like when you have a bruise on your arm, you poke it, and say "it hurts when I do that" well, don't do it then! :D for you it's "the game slows to a crawl when I leave it on for many hours at a time" Well, don't do that then! :D 

Edited by Galileo
Link to comment
Share on other sites

1 hour ago, AdmiralTigerclaw said:

Hey, question for anyone who does long aircraft missions.

 

Is there anyone getting a gradual slowdown from extended time (several hours) spent in a single scene instance?

 

For example, I long-haul turboprops for survey missions, and the missions take upwards of four hours.  I take off and get going with almost perfect smooth framerate, but over the course of the flight, it gradually slows down until my time ratio is 33 percent of realtime.

I thought it might have been related to physics, but I left my program on in the space center while I slept, and came back to it being jittery and slow as well.  Of the two solid instances, I can see the following behavior.

 

1: In a long haul flight, especially if it goes through a Kerbin 'night', in an atmosphere, it slows to a crawl.  If I swap to map view, it's smooth and fast, but reduces to a crawl when I swap back.  Completing the flight and RTBing, then returning to the space center smoothed it up.

2: Left the space center in view for eight hours while I slept.  Woke up to it being a crawl.  Switching to a flight and recovering the flight smoothed it out both at flight start, and after returning to the space center.

 

I'm thinking that because this seems to occur without regard to a physics condition, that it's a problem with a graphics thread over long operational periods without a 'reset'.  That put scatterer in as a potential contender.  So I'd like to check if anyone is seeing this behavior, or may now know to set up and test for said behavior.

I sometimes leave the same scene instance running in the background while I change things around in the shaders and load them back in the game without restarting. When I did this, I noticed that the game slowed down over a few hours but always assumed it was related to swapping shaders around.

In any case, one way to test your theory would be to run the same test with and without scatterer, to be sure.

Link to comment
Share on other sites

41 minutes ago, Galileo said:

@AdmiralTigerclaw I have heard of the same issue only once in the past, but I am not sure many people leave their games on overnight, and thus, never experience the problem. My only suggestion is to turn off KSP if you aren't playing it.

This is an issue that takes particular circumstances to happen, so I wouldn't call it a memory leak or a bug. 

It's like when you have a bruise on your arm, you poke it, and say "it hurts when I do that" well, don't do it then! :D for you it's "the game slows to a crawl when I leave it on for many hours at a time" Well, don't do that then! :D 

 

No, what you do when you have a bruise, is get rid of what's causing the bruise in the first place.  Solve the cause, not the symptom.  Also, an issue like this is something most programmers would WANT.  Because I'm giving you outlier performance data you wouldn't otherwise get (long periods of time in a scene).

That being said, this doesn't seem like a memory leak.  I checked the ram for change in commit size, and I was running steady on what my program hoards for the mod count.  (112+, in case you're wondering.)

Either way, the problem may be a mod, it may be my drivers (just ran an update on my NVIDIA before this post).  Could be unity doesn't like running one scene a really long time.

 

Either way, I'm asking if anyone here has witnessed a problem of my description before, so I can help narrow down what actually causes it.  Then we can fix it instead of asking mom to kiss the owie every time.  I'm a data point.  I'm checking for additional data points from scatterer users.

 

 

And, also, unfortunately, I can't just turn KSP off in the middle of a 4 hour long flight that turns into a 7 hour long flight 2 hours in because of some unknown thing causing a slowdown.

 

 

EDIT: @blackrack

 

Would the shaders get modified in-flight from say, a day/night transition?  The problem only really seemed to start sliding into place after my flight passed the sunset terminator.

Edited by AdmiralTigerclaw
Link to comment
Share on other sites

4 minutes ago, AdmiralTigerclaw said:

EDIT: @blackrack

Would the shaders get modified in-flight from say, a day/night transition?  The problem only really seemed to start sliding into place after my flight passed the sunset terminator.

No they don't get changed. What could also help is to note the GPU usage and the CPU usage when this happens and compare it to when you just launched.

Link to comment
Share on other sites

3 hours ago, AdmiralTigerclaw said:

Is there anyone getting a gradual slowdown from extended time (several hours) spent in a single scene instance?

Yes, I reported this earlier. I narrowed it down to scatterer. However, I have not tried this in 0.0300. My findings were done with 1.2.2 and scatterer 0.0256 (I believe...newest stable anyway) being the only mod installed. The gradual slowdown started to appear after just 15-20 minutes. After a circumnavigation things were a slideshow on a 120fps capable rig. This being said, I know others who were not affected. 
-Running DX9, 16GB RAM, GTX1080, i7. My CPU and GPU usage were pretty much just idle at 25% ish and nothing noticeable in logs.

Link to comment
Share on other sites

3 hours ago, AdmiralTigerclaw said:

Either way, I'm asking if anyone here has witnessed a problem of my description before, so I can help narrow down what actually causes it.  Then we can fix it instead of asking mom to kiss the owie every time.  I'm a data point.  I'm checking for additional data points from scatterer users.

I just had this happen to me for the first time the other day, but it happened on a mission that lasted no longer than others I've flown in my Cessna-like aircraft. By the end of a flight just ~1.5hrs in length my clock was down to like 4s real time for every 1s game time. No obvious issues in the log. The flight prior to that I had nearly 3hrs on the mission clock but performance was just as good as when I started and it also was flown around KSC the same way this slowdown flight was flown. The only thing I changed since then was to install the back-ported newest version of Kopernicus. I also have an issue where when I save a named quicksave (Alt+F5) the camera switches to a hullcam view and if I Backspace out sometimes the camera gets screwed up and I can't zoom anymore in the regular view, or this time when I switched back to the hullcam views I was looking inside my aircraft parts.

So yea, that's all the data I have myself on an issue that sounds similar to yours. I did not have Scatterer installed during either of these flights

Link to comment
Share on other sites

3 hours ago, SkyKaptn said:

Yes, I reported this earlier. I narrowed it down to scatterer. However, I have not tried this in 0.0300. My findings were done with 1.2.2 and scatterer 0.0256 (I believe...newest stable anyway) being the only mod installed. The gradual slowdown started to appear after just 15-20 minutes. After a circumnavigation things were a slideshow on a 120fps capable rig. This being said, I know others who were not affected. 
-Running DX9, 16GB RAM, GTX1080, i7. My CPU and GPU usage were pretty much just idle at 25% ish and nothing noticeable in logs.

Happens to me. I just got home after a day out to find KSP still open at KSC and running at a noticeably lower speed.

I7 4790k 4.0GHz

Asus 1080 Strix (GTX 1080) GPU

16GB ram

However some streamers I watch have also noticed this slowdown, as they usually restart ksp halfway through.

Edited by Gameslinx
Link to comment
Share on other sites

3 hours ago, SkyKaptn said:

Yes, I reported this earlier. I narrowed it down to scatterer. However, I have not tried this in 0.0300. My findings were done with 1.2.2 and scatterer 0.0256 (I believe...newest stable anyway) being the only mod installed. The gradual slowdown started to appear after just 15-20 minutes. After a circumnavigation things were a slideshow on a 120fps capable rig. This being said, I know others who were not affected. 
-Running DX9, 16GB RAM, GTX1080, i7. My CPU and GPU usage were pretty much just idle at 25% ish and nothing noticeable in logs.

 

Hmmm....  I wonder if something in the NVIDIA drivers doesn't like Scatterer.  I'm running a much older GEForce 780, but it runs smooth for most everything.

I've got a log for my GFX card now after running a test for four hours idling in the space center.  I have a noticeable slowdown that cleared up when I loaded a vehicle, but looking through the logs, I spot nothing unusual in terms of expecting it to get cluttered over time.  If anything, the video card spun down into more of an idle state over time.

 

Almost makes me wonder if the problem is the card is somehow thinking its idle and spooling down, and the slowdown is the card processing the video data in an idle state.  With the scene loaded and on screen, I see no reason for it to just... stop.

 

EDIT: I just went into my NVIDIA settings and found 'Power Management Mode' which was set to 'optimal power'.  I'm going to run a test with that set to 'Prefer Maximum Performance' and see if that stays running smooth after a few hours.

Edited by AdmiralTigerclaw
Thought.
Link to comment
Share on other sites

1 hour ago, AdmiralTigerclaw said:

I'm going to run a test with that set to 'Prefer Maximum Performance' and see if that stays running smooth after a few hours.

Doesn't seem to make a difference for me, it's always been on PMP in my driver manager

Link to comment
Share on other sites

36 minutes ago, Gameslinx said:

Doesn't seem to make a difference for me, it's always been on PMP in my driver manager

 

I went a ahead and concluded my test over here.  I started to notice the slowdown kicking in, so that verifies it's not simply the settings on the card from at least two points now.

I'm running another test, having pulled EVE and Scatterer out.  I still have Kopernicus installed (I have it plugged in so I can set Kerbin's Atmosphere to an earthlike altitude scale.  Makes aircraft altitude performance easier to track).  So far, the KSC scene is still going smooth.  Even if midday is stuck as black as night.  (Probably my rescale dicking with things).

 

 

Link to comment
Share on other sites

On 6/1/2017 at 1:44 PM, Avera9eJoe said:

There's also an unrelated EVE-Scatterer integration bug I found were cloud layers and terminators change color correctly but the volumetric particles stay solid white but that's not related to Layer2D so I'll chat about that later on I think

I found out what this is - I was using your improved water pre-release and it seems that volumetric particles don't shift color at the terminators in the pre-release. The cloud texture does but not the volumetric particles. I don't know if you're aware or not but I thought it was worth a mention - 

 

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...