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

3 hours ago, Epoxid said:

According to my testing, you can trade it for the floating tiles bug by going back to an older version and then turn off the ocean shader to remove the floating tiles :S See my previous post:

  • 320b (1st download link on SpaceDock): Sqrt-fix not working, always halo
  • 315 preview (2nd download from top on SpaceDock): Halo is always there, fix is not doing anything on or off
  • 275 preview (3rd download from top on SpaceDock): Fix Works: Halo is gone with alternate sqrt "off". This is the latest version where I can remove the halo using the sqrt-option.

Wow, thanks. I'll probably just keep it off, it's not all that critical, I'm only in the atmosphere briefly, anyway.

Link to comment
Share on other sites

On 11.11.2017 at 12:29 AM, blackrack said:

No one commented on whether or not my new dll fixes it so far

https://forum.kerbalspaceprogram.com/index.php?/topic/103963-wip12213-scatterer-atmospheric-scattering-v00320-0320b-06072017-water-refraction/&do=findComment&comment=3210887

Anyway, me I haven't been able to reproduce this bug myself in like a year.

Edited: I guess I should just release this as an update and watch if the daily "global warming xD" threads on the KSP subreddit disappear.

Hey @blackrack,

I tried it with my game with eve and rss installed and scatterer basically stops working and it goes back to the weird atmosphere before it. Before this I had the halo bug and I fixed it but this time the atmosphere started going black whenever I was viewing the KSC or launching a ship. Also this black "void" would absorb the entire screen at certain angles. The ship and the hud is still visible and so is the Sun and I still can fly the ship. But the background goes completely dark. I am using KSP for my physics essay which I need to be able to graduate, and it needs to be appealing. I would be extremely glad if you could look into it.

Thanks from now :)

Edited by scuderiacab
Link to comment
Share on other sites

On 15/11/2017 at 7:29 PM, Drew Kerman said:

@blackrack not sure how applicable this is, but it does mention unity and shaders so figured I'd share it here: https://www.alanzucconi.com/2017/10/10/shader-atmospheric-sphere/

original credit goes to Scott Manley, he retweeted this earlier today

I believe what we have npw in scatterer is more advanced than this.

On 16/11/2017 at 11:11 AM, Namelesswonder said:

I'm currently having a problem with oceans right now. It looks like the shoreline for some reason starts out in the ocean, and then when you move the camera or get closer the shoreline will then move into the position it should be in.

https://imgur.com/a/ja26J

I've tried increasing and decreasing the grid size and disabling refractions but it doesn't fix it, only completely disabling the ocean shader gets rid of the problem.

I show my mod list but it still happens even with scatterer being the only mod. Also have my graphics settings shown too. Scatterer settings are the stock configs.

Happens on 320b, as well as 321dev.

Not sure what to do to fix it.

This happens because of the new "water transparency" feature but I deemed it not very distracting or critical. i will fix it when I can however.

On 18/11/2017 at 1:48 PM, scuderiacab said:

Hey @blackrack,

I tried it with my game with eve and rss installed and scatterer basically stops working and it goes back to the weird atmosphere before it. Before this I had the halo bug and I fixed it but this time the atmosphere started going black whenever I was viewing the KSC or launching a ship. Also this black "void" would absorb the entire screen at certain angles. The ship and the hud is still visible and so is the Sun and I still can fly the ship. But the background goes completely dark. I am using KSP for my physics essay which I need to be able to graduate, and it needs to be appealing. I would be extremely glad if you could look into it.

Thanks from now :)

Well probably look at the log because something bad broke. it's probably not finding a specific file or something like a messed up config.

Link to comment
Share on other sites

6 hours ago, blackrack said:

I believe what we have npw in scatterer is more advanced than this.

This happens because of the new "water transparency" feature but I deemed it not very distracting or critical. i will fix it when I can however.

Well probably look at the log because something bad broke. it's probably not finding a specific file or something like a messed up config.

Here is my player.log file. This time the bug was a little bit different. Scatterer was partially working in the KSC rather than not at all, but it was absent while viewing Earth from the tracking station.

https://drive.google.com/open?id=1iU3imEBuh7HN6zButwN6YzcVMKiaRaH-

Link to comment
Share on other sites

Hi @blackrack I used the new DLL last night during my stream, I was not having a lot of issues with the old one, and did not encounter any problems so far with the new one, I did not spend long out of the editor but it looked ok

 

I have stuff like ground shadows, eclipses and god rays turned off, the gifs seem to be displaying weird on the forum

Edited by selfish_meme
Link to comment
Share on other sites

On 19/11/2017 at 9:34 PM, scuderiacab said:

Here is my player.log file. This time the bug was a little bit different. Scatterer was partially working in the KSC rather than not at all, but it was absent while viewing Earth from the tracking station.

https://drive.google.com/open?id=1iU3imEBuh7HN6zButwN6YzcVMKiaRaH-

 

From your log:

[Scatterer] No config file found, check your install

 

Link to comment
Share on other sites

2 hours ago, blackrack said:

From your log:


[Scatterer] No config file found, check your install

 

My install seems complete. It has one config, one shader file and the dll. Do I have to install something else? There is this scatterer-master download on GitHub that supposedly fixes the "black sky issue" but I couldn't get it to work either. I'm on Mac, would it change something? I downloaded the scatterer file from spacedock     (which says it's outdated btw) and changed the dll. with the one you have shared a while back to fix the halo issue. I know it's just more work for you but I would really appreciate it if you could help me out.:)

Thanks again @blackrack 

Link to comment
Share on other sites

10 minutes ago, scuderiacab said:

My install seems complete. It has one config, one shader file and the dll. Do I have to install something else? There is this scatterer-master download on GitHub that supposedly fixes the "black sky issue" but I couldn't get it to work either. I'm on Mac, would it change something? I downloaded the scatterer file from spacedock     (which says it's outdated btw) and changed the dll. with the one you have shared a while back to fix the halo issue. I know it's just more work for you but I would really appreciate it if you could help me out.:)

Thanks again @blackrack 

You should have multiple planet cfgs. Kerbin,Eve, etc..I would reinstall

Link to comment
Share on other sites

1 hour ago, scuderiacab said:

oh boy I have reinstalled it so many times my trash bin is full of scatterer files:) also i am using real solar system, if that changes anything

It makes a big difference. That some important info to leave out lol. Scatterer does not support RSS by default, only the stock system. You have to use a visual pack that has custom scatterer cfgs for RSS. Unfortunately, there aren’t any updated for the latest scatterer, so you would have to roll back to KSP 1.2.2 for them to work properly. 

Edited by Galileo
Link to comment
Share on other sites

Hi to all,

I am new to this one...Its a wonderfull mod but it kills my framerate .. i have installed from scratch KSP, EVE,SVE,PlanetShine,DistantObject,RentryParticleEffect and scatterer..

 When i am on Kerbin or near kerbin i am taking 10-11fps!!! If i remove the scatterer folder from gamedata i am back to my normal 60fps....

Here is my ksp.log...https://drive.google.com/file/d/1OYUx-5sYQj_iTOaPpTaIiiibRJLWxqbs/view?usp=sharing

If anyone can help i will be grateful

Edited by John341
Link to comment
Share on other sites

On 16.11.2017 at 11:11 AM, Namelesswonder said:

I'm currently having a problem with oceans right now. It looks like the shoreline for some reason starts out in the ocean, and then when you move the camera or get closer the shoreline will then move into the position it should be in.

https://imgur.com/a/ja26J

I've tried increasing and decreasing the grid size and disabling refractions but it doesn't fix it, only completely disabling the ocean shader gets rid of the problem.

I show my mod list but it still happens even with scatterer being the only mod. Also have my graphics settings shown too. Scatterer settings are the stock configs.

Happens on 320b, as well as 321dev.

Not sure what to do to fix it.

Hi, where did you find the 321dev? I would very much like to give that a test...

Link to comment
Share on other sites

Sorry to maybe mingle too much into the issue of the halo bug, but from studying the sources, I think the bug is solely contained within "AtmosphereScatterer.cginc"?

From line 171

#if (!defined(SHADER_API_D3D9) && !defined(DEFAULT_SQRT_ON))

I suppose that the fix is only doing something for non-DirectX 9 users and that there was a problem with a negative number being passed into the sqrt routine?

I noticed there are many instances in that file, where the custom SQRT function is not called, but still the system sqrt standard one. Would it be unwise to just redefine sqrt(x) as sqrt(abs(x)) globally?

I also noticed at some point you seem to have been using

return 1 / rsqrt (f);

as a fix? Did this not work either?

If you could kindly point me to a "how-to" on compiling the shaders, I would be very much willing to help debugging this...

Edited by Epoxid
Link to comment
Share on other sites

18 minutes ago, Epoxid said:

*snip*

As you're making a concerted effort and willingness to resolve this issue, I'll ping @blackrack here just to ensure that you get his attention. :wink: 

Also the latest dev build can be found here: https://forum.kerbalspaceprogram.com/index.php?/topic/103963-wip12213-scatterer-atmospheric-scattering-v00320-0320b-06072017-water-refraction/&page=270&tab=comments#comment-3210887

Link to comment
Share on other sites

Just to add a data point:

 

I've tried the experimental .dll and still get NullRef spam on

scatterer.RefractionCamera.OnPreCull ()

when switched to a craft on Minmus.

From the mods I'm running i think the relevant ones are EVE, Galileo's OPM and SVE.

Link to comment
Share on other sites

On 22/11/2017 at 7:26 PM, John341 said:

Hi to all,

I am new to this one...Its a wonderfull mod but it kills my framerate .. i have installed from scratch KSP, EVE,SVE,PlanetShine,DistantObject,RentryParticleEffect and scatterer..

 When i am on Kerbin or near kerbin i am taking 10-11fps!!! If i remove the scatterer folder from gamedata i am back to my normal 60fps....

Here is my ksp.log...https://drive.google.com/file/d/1OYUx-5sYQj_iTOaPpTaIiiibRJLWxqbs/view?usp=sharing

If anyone can help i will be grateful

I don't see anything wrong in the logs, what are your system specs?

7 hours ago, jinks said:

Just to add a data point:

 

I've tried the experimental .dll and still get NullRef spam on


scatterer.RefractionCamera.OnPreCull ()

when switched to a craft on Minmus.

From the mods I'm running i think the relevant ones are EVE, Galileo's OPM and SVE.

This is with v0.0321dev?

On 24/11/2017 at 12:27 AM, Epoxid said:

Sorry to maybe mingle too much into the issue of the halo bug, but from studying the sources, I think the bug is solely contained within "AtmosphereScatterer.cginc"?

From line 171

#if (!defined(SHADER_API_D3D9) && !defined(DEFAULT_SQRT_ON))

I suppose that the fix is only doing something for non-DirectX 9 users and that there was a problem with a negative number being passed into the sqrt routine?

I noticed there are many instances in that file, where the custom SQRT function is not called, but still the system sqrt standard one. Would it be unwise to just redefine sqrt(x) as sqrt(abs(x)) globally?

I also noticed at some point you seem to have been using

return 1 / rsqrt (f);

as a fix? Did this not work either?

If you could kindly point me to a "how-to" on compiling the shaders, I would be very much willing to help debugging this...

For how to complie the shaders: https://github.com/LGhassen/Scatterer/blob/master/scatterer/Shaders/readme.md.txt

The issue seems to happen for non-d3d9 users, at first I thought the issue was a negative value being passed but sqrt(abs(x)) didn't seem to fix anything. Then it seems if the value is close enough to zero the issue will happen anyway.

1/rsqrt(f) fixed it for some platforms but not others, I don't remember the exact details but I will try to test it again.

From my testing it is only an issue with deltaSq calculation, all the other calculations can use normal and sqrt and work fine.

Edited: On my system this doesn't seem to be reproducible on dx9, dx11 or openGl, with or without the SQRT fix, I'll fire up my old laptop and see if it's reproducible there.

Edited again: Seems like alternate shader SQRT is actually disabled in the shaders themselves at the moment (multi-compile line was commented out), re-enabling and re-investigating the issue.

Edited by blackrack
Link to comment
Share on other sites

7 minutes ago, maja said:

I'm getting null ref around Mun and on every scene change with dev version from November 4 and Ocean shaders enabled (see screenshot of my settings bellow) too.

Exact reproduction steps? Do you load a craft around mun? Do you fly it there?

Link to comment
Share on other sites

10 minutes ago, blackrack said:

Exact reproduction steps? Do you load a craft around mun? Do you fly it there?

It's weird. I'm getting full spam around and on the Mun in my main install with a lot of mods, but not in a clean install with SVE and scatterer only. In clean install it's only exception when switching scenes (tested right now).

Link to comment
Share on other sites

7 minutes ago, maja said:

It's weird. I'm getting full spam around and on the Mun in my main install with a lot of mods, but not in a clean install with SVE and scatterer only. In clean install it's only exception when switching scenes (tested right now).

Mod list then? Or maybe try to slowly narrow it down?

Link to comment
Share on other sites

On 25. 11. 2017 at 2:47 PM, blackrack said:

Mod list then? Or maybe try to slowly narrow it down?

It seems, that I have steps to reproduce it in KSP 1.3.1.

Mods:

  • SVE 1.2.7
  • EVE 1.2.2.1
  • scatterer - dev version from November 4 or version 0.0320b (it's the same with both versions)
  • Module Manager 2.8.1

Steps:

  • Ocean shaders on
  • Put simple craft into orbit of the Mun (for example. Mark1-2Pod)
  • Go back to Space Center
  • Return to the craft via Tracking Station
  • OnPreCull null ref spam

Hope this helps. If you need more info, let me know.

Edited by maja
Link to comment
Share on other sites

11 hours ago, blackrack said:

I don't see anything wrong in the logs, what are your system specs?

This is with v0.0321dev?

For how to complie the shaders: https://github.com/LGhassen/Scatterer/blob/master/scatterer/Shaders/readme.md.txt

The issue seems to happen for non-d3d9 users, at first I thought the issue was a negative value being passed but sqrt(abs(x)) didn't seem to fix anything. Then it seems if the value is close enough to zero the issue will happen anyway.

1/rsqrt(f) fixed it for some platforms but not others, I don't remember the exact details but I will try to test it again.

From my testing it is only an issue with deltaSq calculation, all the other calculations can use normal and sqrt and work fine.

Edited: On my system this doesn't seem to be reproducible on dx9, dx11 or openGl, with or without the SQRT fix, I'll fire up my old laptop and see if it's reproducible there.

Edited again: Seems like alternate shader SQRT is actually disabled in the shaders themselves at the moment (multi-compile line was commented out), re-enabling and re-investigating the issue.

Thank you blackrack for your time...

My pc specs are

OS: Windows 7 Service Pack 1 (6.1.7601) 64bit
CPU: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (8)
RAM: 16336
GPU: AMD Radeon R9 200 Series (3049MB)
SM: 30 (Direct3D 9.0c [aticfx64.dll 22.19.662.4])

I have try it in different resolutions but always i am taking 9-12 frames...even if i change the samples to 64 or 256 i am still taking the same framerate...if i remove scatterer i am at 60 fps.....

 

 

Link to comment
Share on other sites

14 minutes ago, John341 said:

Thank you blackrack for your time...

My pc specs are

OS: Windows 7 Service Pack 1 (6.1.7601) 64bit
CPU: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (8)
RAM: 16336
GPU: AMD Radeon R9 200 Series (3049MB)
SM: 30 (Direct3D 9.0c [aticfx64.dll 22.19.662.4])

I have try it in different resolutions but always i am taking 9-12 frames...even if i change the samples to 64 or 256 i am still taking the same framerate...if i remove scatterer i am at 60 fps.....

Try to keep the game running for a bit longer, change scenes a few times then send me a new log file. Also disable ocean refraction and see if it goes away.

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