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

[quote name='direwolf']Anyone who have trouble getting Scatterer to work with RSS / Kopernicus can give my patched version a try. It fixes the celestial / transform naming mess by simply detecting the proper celestial body using both names defined in PlanetList.cfg and does the same with assets, like shaders and config. Should help with black sky and NullReference exceptions should be gone altogether for your bonus enjoyment.
As a disclaimer, I've only tested it on my setup: OSX 10.11, Stock KSP modded with 64bit UnityPlayer 4.6.4. Only Scatterer and RSS 10.4.1 installed with 8K textures. Feedback from 32bit and/or Windows / Linux host with and without RSS would be appreciated.

Without any further ado:

Pull request for the technically inclined: [URL]https://github.com/LGhassen/Scatterer/pull/5[/URL]
GameData snapshot: [URL]https://www.dropbox.com/s/pejxjr4rrnrfuo6/scatterer-0.191-rss-compat-c0a39c7.zip[/URL]

How it looks with 100% default configuration:

[URL]http://imgur.com/a/1NZLq[/URL]

Have fun![/QUOTE]

Great fix, solved the black sky issue for me, running OSX with same set up as you.

Only issue I have now is the black line flashing on the horizon.. I think I can see this on the KSC image that you uploaded aswell, Is this a default configuration issue with RSS? if so, does anyone know which parameter to change in the UI? Ive tried a few different things but no resolve.. Cheers

[COLOR=#333333]Setup: OSX 10.11, 64bit UnityPlayer 4.6.4. RSS 10.4.1 with Scatterer & EVE (latest)

[/COLOR]
Link to comment
Share on other sites

[quote name='Manwith Noname']KSP 32 on Win 8.1 x64 with DX9 (assuming that is still the default) rendering....is a no go sadly. The atmosphere doesn't load at all and I get lots of this in the logs....

[code]
[EXC 03:16:18.574] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[/code]

This was a completely vanilla install. I then threw Kopernicus 0.5.2 in just incase there was some dependency but the situation remained the same.[/QUOTE]

If I understand you correctly, you were not running RSS, you have just tried the patched Scatterer, right? The exception you got means that there were no suitable celestial bodies found to apply the atmosphere to, in this case I assume for Kerbin.

- How does your [code]GameData\scatterer\config\PlanetList.cfg[/code] looks like?
- Could you please post a longer snippet from the log around where that exception first appears in your log?
Link to comment
Share on other sites

[quote name='sjsninetrys']Only issue I have now is the black line flashing on the horizon.. I think I can see this on the KSC image that you uploaded aswell, Is this a default configuration issue with RSS? if so, does anyone know which parameter to change in the UI? Ive tried a few different things but no resolve..[/QUOTE]

Same here, yes. Unfortunately I'm just starting to learn how Scatterer does it's gfx magic (shaders and all) too, but if I'd have to guess I'd bet on a scaling problem with the atmosphere knowing how RSS redefines all celestial body sizes. [code]atmosphereGlobalScale[/code] maybe?
Let me know what you find, I'll look into it too :)
Link to comment
Share on other sites

[quote name='direwolf']Anyone who have trouble getting Scatterer to work with RSS / Kopernicus can give my patched version a try. It fixes the celestial / transform naming mess by simply detecting the proper celestial body using both names defined in PlanetList.cfg and does the same with assets, like shaders and config. Should help with black sky and NullReference exceptions should be gone altogether for your bonus enjoyment.
As a disclaimer, I've only tested it on my setup: OSX 10.11, Stock KSP modded with 64bit UnityPlayer 4.6.4. Only Scatterer and RSS 10.4.1 installed with 8K textures. Feedback from 32bit and/or Windows / Linux host with and without RSS would be appreciated.

Without any further ado:

Pull request for the technically inclined: [URL]https://github.com/LGhassen/Scatterer/pull/5[/URL]
GameData snapshot: [URL]https://www.dropbox.com/s/pejxjr4rrnrfuo6/scatterer-0.191-rss-compat-c0a39c7.zip[/URL]

How it looks with 100% default configuration:

[url]http://imgur.com/a/1NZLq[/url]

Have fun![/QUOTE]

Great, I just woke up and I'm pretty happy to see this. Taking a look at this now.


[quote name='sjsninetrys']Great fix, solved the black sky issue for me, running OSX with same set up as you.

Only issue I have now is the black line flashing on the horizon.. I think I can see this on the KSC image that you uploaded aswell, Is this a default configuration issue with RSS? if so, does anyone know which parameter to change in the UI? Ive tried a few different things but no resolve.. Cheers

[COLOR=#333333]Setup: OSX 10.11, 64bit UnityPlayer 4.6.4. RSS 10.4.1 with Scatterer & EVE (latest)

[/COLOR][/QUOTE]

Pretty sure that the black line is caused by the new depth buffer, I'll disable it for now. I'm currently testing direwolf's changes and will report back, will also forward this to Proot and pingopete for testing.
Link to comment
Share on other sites

[quote name='blackrack']Pretty sure that the black line is caused by the new depth buffer, I'll disable it for now. I'm currently testing direwolf's changes and will report back, will also forward this to Proot and pingopete for testing.[/QUOTE]

Excellent, I tried to figure this out but the only answer I could found was 'you need to learn modern 3d computer gfx / rendering theory' :D

So up next I'll fix some more bugs (got a 32bit Win VM going) and then I plan to consolidate plugin loading order / game event / scenery update related stuff as a groundwork to make it possible for other plugins to define their own Scatterer config, body list, etc.
I feel that the current PlanetList.cfg / Settings.cfg based stuff is pretty inconvenient, especially so because you can accidentally overwrite them easily from ingame.
Do you have anything on your mind regarding the above?
Link to comment
Share on other sites

Everything you added seems solid and runs well, I restored the default depth buffer and it got rid of the black horizon line you see on your screenshots, but it also restored the moire patterns and other artifacts, I'll get rid of these later or make the new depth buffer an option (high CPU usage when used with EVE mod). Tested with RSS and stock and everything seems to run well, though I never had issues with RSS compatibility or the black sky bug, so I'll need more people testing this one. I merged your changes but keep in mind I kept the new depth buffer in the github repository.

Here's the link: [URL="https://mega.nz/#!jc5RRTZR!KUuJOcqgy6NgudC68xUVks3NjhuV_CZXq0JO2EkG6_8"]https://mega.nz/#!jc5RRTZR!KUuJOcqgy6NgudC68xUVks3NjhuV_CZXq0JO2EkG6_8[/URL]

If on RSS, change planetsList to something like this

[CODE]scattererCelestialBodies
{
Item
{
celestialBodyName = Earth
transformName = Kerbin
loadDistance =50000000
unloadDistance = 100000000
}
Item
{
celestialBodyName = Mars
transformName = Mars
loadDistance = 50000000
unloadDistance = 100000000
}
Item
{
celestialBodyName = Venus
transformName = Venus
loadDistance = 50000000
unloadDistance = 100000000
}
}[/CODE]

And rename the folders Kerbin, Duna and Eve to Earth, Mars and Venus. This is just for testing, the scale for mapview will be off, Eve config won't look right on Venus. You can make a better config if you want or wait for "official" ones.


[quote name='direwolf']Excellent, I tried to figure this out but the only answer I could found was 'you need to learn modern 3d computer gfx / rendering theory' :D

So up next I'll fix some more bugs (got a 32bit Win VM going) and then I plan to consolidate plugin loading order / game event / scenery update related stuff as a groundwork to make it possible for other plugins to define their own Scatterer config, body list, etc.
I feel that the current PlanetList.cfg / Settings.cfg based stuff is pretty inconvenient, especially so because you can accidentally overwrite them easily from ingame.
Do you have anything on your mind regarding the above?[/QUOTE]

Not really no, I'm focusing more on adding graphical features and improving the shaders right now than on ease of use/user experience. Do you want to disable auto settings saving?

Also, if you feel like it, maybe take a look at the ocean branch :p Edited by blackrack
Link to comment
Share on other sites

[quote name='blackrack']Everything you added seems solid and runs well, I restored the default depth buffer and it got rid of the black horizon line you see on your screenshots, but it also restored the moire patterns and other artifacts, I'll get rid of these later or make the new depth buffer an option (high CPU usage when used with EVE mod). [/QUOTE]

One thing you could do is manually disable the depth buffer on the Camera when using a custom depth buffer.
Link to comment
Share on other sites

[quote name='blackrack']But if EVE is using the depth buffer, won't that break it?[/QUOTE]

Possibly... Though I don't expect it to given the results from earlier. Worst-case we loose the nice edges around where clouds meet geometry.
Link to comment
Share on other sites

[quote name='direwolf']If I understand you correctly, you were not running RSS, you have just tried the patched Scatterer, right?[/QUOTE]

Correct. Nothing else was added initially, just the patched scatterer. When It did not work I tried adding in Kopernicus to see if that altered anything, which it did not. Here is an excerpt from my log file when loading into the game...

[spoiler=Code here]
[code]
[WRN 03:22:22.487] [HighLogic]: =========================== Scene Change : From MAINMENU to SPACECENTER (Async) =====================
[LOG 03:22:22.936] AddonLoader: Instantiating addon 'AtmosphereFixer' from assembly 'Kopernicus'
[LOG 03:22:22.937] AddonLoader: Instantiating addon 'Core' from assembly 'scatterer'
[LOG 03:22:22.980] Sun (CelestialBody)
[EXC 03:22:22.993] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:22.998] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.107] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.226] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.229] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.234] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.246] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.266] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.279] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.297] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.313] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.329] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.434] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.501] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.506] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.512] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.529] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[EXC 03:22:23.546] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[LOG 03:22:23.923] AddonLoader: Instantiating addon 'AddScenarioModules' from assembly 'KSP'
[LOG 03:22:23.925] AddonLoader: Instantiating addon 'ContractDefs' from assembly 'KSP'
[LOG 03:22:23.942] AddonLoader: Instantiating addon 'CustomConfigsManager' from assembly 'ModuleManager'
[LOG 03:22:23.943] AddonLoader: Instantiating addon 'AtmosphereFixer' from assembly 'Kopernicus'
[LOG 03:22:23.944] AddonLoader: Instantiating addon 'Core' from assembly 'scatterer'
[LOG 03:22:25.233] [CustomConfigsManager] Setting moddeed physics as the active one
[LOG 03:22:25.235] PhysicsGlobals: Loading database
[LOG 03:22:26.036] Sun (CelestialBody)
[EXC 03:22:26.047] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.Single[CelestialBody] (IEnumerable`1 source, System.Func`2 predicate)
scatterer.Core.Update ()
[/code]
[/spoiler]

Planetlist.cfg was as it came in the zip, looking at it it, yeah, that's probably an issue ;)

Edit: I've grabbed the latest files Blackrack uploaded and will check that out shortly.

Sometime later edit: Installing Scatterer, then fix3.zip, then the DirewolfFixes.zip works well with Kopernicus and EVE. Sky is blue \o/ Edited by Manwith Noname
Link to comment
Share on other sites

[quote name='Manwith Noname']Sometime later edit: Installing Scatterer, then fix3.zip, then the DirewolfFixes.zip works well with Kopernicus and EVE. Sky is blue \o/[/QUOTE]
I already found DirewolfFixes.zip from later posts but i cant find that zip package called fix3.zip
Can someone tell me where i can find that or link it again. Thanks!
Link to comment
Share on other sites

[quote name='Murdox']I already found DirewolfFixes.zip from later posts but i cant find that zip package called fix3.zip
Can someone tell me where i can find that or link it again. Thanks![/QUOTE]

DirewolfFixes cancels out what the previous fixes do (custom depth buffer). I'll make a new release as soon as I'm sure it works well for everyone, and with RSS.

[quote name='SquaredSpekz']So do the other planets have Scatterer Effects by Default, or do we have to add them?[/QUOTE]

Read the thread, but they do.

[quote name='sashan']Is is possible to upload the mod somewhere else as well - KErbal Stuff is often buggy for me.[/QUOTE]

With next release I'll include mega links.
Link to comment
Share on other sites

Is there any way to fix kerbin from looking like it does in this screenshot? (notice the lines on the continent below) I am running scatterer 0.191 with Ubuntu 14.04 in Opengl with KSP in 64 bit mode. It looks fine except between the altitudes of around 60 and 160 km.


[img]http://i.imgur.com/FAh0EOQ.png[/img]
Link to comment
Share on other sites

[quote name='peachoftree']Is there any way to fix kerbin from looking like it does in this screenshot? (notice the lines on the continent below) I am running scatterer 0.191 with Ubuntu 14.04 in Opengl with KSP in 64 bit mode. It looks fine except between the altitudes of around 60 and 160 km.


[url]http://i.imgur.com/FAh0EOQ.png[/url][/QUOTE]

Go back a few pages, find a file called fixes3, it fixes that issue but comes with others, so it's your choice to make. It will be integrated in next release and made togglable.

Edited: Actually no, I think this is the file you want [URL="https://mega.nz/#!idYiECiR!EGIfls2jtkl5tLzTAi5Z2FMHk0spvmg6C7yrpT1atDQ"]https://mega.nz/#!idYiECiR!EGIfls2jtkl5tLzTAi5Z2FMHk0spvmg6C7yrpT1atDQ[/URL]
Link to comment
Share on other sites

[quote name='blackrack']DirewolfFixes cancels out what the previous fixes do (custom depth buffer).[/QUOTE]

Just to note, there are shader files in the fix3.zp that are not contained in your direwolffixes.zip. Without the fix3.zip, there is still something relating "Ignore projector" in some of the files that seems amiss and I get this...which I mentioned but never posted a screen of...

[URL]http://steamcommunity.com/sharedfiles/filedetails/?id=562349004[/URL]

The little black box moves in relation to the camera but also seems to occupy a point in space relative to it when rotating.

So, with fix3.zip and direwolffixes.zip, everything is nice (no black boxes) and I do not notice anything untoward, except maybe some "pulsing" when leaving the atmosphere.

Edit: So, personally, using DX9, I...

Install Scatterer 0.0191
Then Fix3.zip - [url]https://mega.nz/#!fQhiWL7S!sOG0rJu-W2HeT7LKaMYLzHZYLAchod0YwAeaXmfH9d0[/url]
Then, if you think you are going to use a planet pack (Kopernicus), throw in the DirewolfFixes.zip files - [url]https://mega.nz/#!jc5RRTZR!KUuJOcqgy6NgudC68xUVks3NjhuV_CZXq0JO2EkG6_8[/url] Edited by Manwith Noname
Link to comment
Share on other sites

I still have noire patterns and other artifacts on opengl.
That green line on the horizon is only present when looking into the sun direction, as the last shot demonstrates.
[imgur]sfZOS[/imgur]
Do you need logs?
Link to comment
Share on other sites

[quote name='sashan']I still have noire patterns and other artifacts on opengl.
That green line on the horizon is only present when looking into the sun direction, as the last shot demonstrates.
[url]http://imgur.com/a/sfZOS[/url]
Do you need logs?[/QUOTE]

If the moire patterns is there it means this is using direwolffixes.zip

I'm compiling a new release now that will have all of these options included.
Link to comment
Share on other sites

[quote name='blackrack']If the moire patterns is there it means this is using direwolffixes.zip

I'm compiling a new release now that will have all of these options included.[/QUOTE]

I've downloaded that release from kerbal stuff yesterday evening.
Link to comment
Share on other sites

[quote name='blackrack']The fix is literally the first post on this page.[/QUOTE]

Thx, will try it out.

By the way, sunset is somewhat weird because you can see stars through it. Or is it supposed to look like that from 5 km altitude?
[IMG]https://scontent-arn2-1.xx.fbcdn.net/hphotos-xfp1/t31.0-8/12232827_812031282252872_863728496992419365_o.jpg[/IMG]
Link to comment
Share on other sites

Just fixed the edge/shimmering issues of the new depth buffer. Also got rid of the old horizon break and other artifacts OpenGL has.

[IMG]http://i.imgur.com/xMfdyN6.jpg[/IMG]



I'll be cleaning this up and making a release soon. It looks like this may have some performance impact though, I will check again tomorrow, maybe I messed something up.

[quote name='sashan']Thx, will try it out.

By the way, sunset is somewhat weird because you can see stars through it. Or is it supposed to look like that from 5 km altitude?
[url]https://scontent-arn2-1.xx.fbcdn.net/hphotos-xfp1/t31.0-8/12232827_812031282252872_863728496992419365_o.jpg[/url][/QUOTE]

Scatterer isn't supposed to hide them, probably the additive blending makes them more visible also, nothing you can do there. Edited by blackrack
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...