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

i74iv3 said:
Have been looking for a while, no joy finding 0.14, where did you download it from?

You can still download it from Kerbalstuff directly [Defunct link removed by a moderator]

Edited by James Kerman
link removed
Link to comment
Share on other sites

I think I'm on to something (for real this time).

So basically, the current KSP postprocessing shader just takes the terrain color and adds some scattering on top of it. While the proland shaders approximate light reflected off the terrain then add that, as well as the scattering on top of the terrain color. If I can figure out a few things, I should be able to add the reflected light component, do a few adjustments and finally fix the postprocessing (and the foggy view from orbit) for good.

I did a few quick tests, here's what the proland shader looks like (ignore the water shader):

z7uK8x4.jpg

And here's what it looks like if I modify it to just add scattered light on top of terrain color (what scatterer does in KSP right now)

RZqZZr7.jpg

Same comparison from lower altitude:

zdfGGZq.jpg

0uDRdp8.jpg

You can tell the lower pics look very similar to scatterer at 100% opacity.

Old build, don't even know which. 0.90. Just loaded it up for the sunrise eclipse:

http://i.imgur.com/sd5dUiBl.png

How did you even get the eclipse? They're not supposed to work in scatterer except for when sometimes it glitches and you see an eclipse where there isn't one.

Edited by blackrack
Link to comment
Share on other sites

That is looking really good. I've been waiting at the edge of the pool till Scatterer plays nice with EVE but know that you have that working. I'm going to have to jump in. Thanks Blackrack keep up the phenomenal work!

Link to comment
Share on other sites

How did you even get the eclipse? They're not supposed to work in scatterer except for when sometimes it glitches and you see an eclipse where there isn't one.

Well, I did say I was on an old build in 0.90 - I'm not sure though of you mean eclipses never worked in scatterer or they shouldn't work under the more recent builds. Anyways, it could be thanks to the sun being so low in the atmosphere. You will notice that the sun rays are visible over the top portion of the sun only. I was pressing F1 a couple of times per second and this was the last image before the "full sun" came into effect, which shouldn't have happened so soon with the moon still obscuring about 1/4 of it. So I think it was the horizon somehow.

Link to comment
Share on other sites

it could be thanks to the sun being so low in the atmosphere.

Here's a better example of what I mean, in an image I posted a while ago:

5neEQU3l.png

Click to embiggen and take a very close look at the sun on the horizon. You can see a line at about the height of the tracking station roof, extending across the entire horizon running just below the rim of the communications dish to the right of the sun. Below that line things look slightly different

Link to comment
Share on other sites

Here's a better example of what I mean, in an image I posted a while ago:

https://i.imgur.com/5neEQU3l.png

Click to embiggen and take a very close look at the sun on the horizon. You can see a line at about the height of the tracking station roof, extending across the entire horizon running just below the rim of the communications dish to the right of the sun. Below that line things look slightly different

Huh. I can see that too.

I try with opengl, when it's better than DX11... With opengl i have atmo lines and pink pods, but with DX11 i have pink ocean, grey grass ground, and pink pods... but no lines in atmo.

OpenGl and DX11 are known to be incompatible with this mod. :)

EDIT: Wait. There aren't lines in the atmo in DX11 mode?? Blackrack was making a water shader a bit ago, and there is a fix for the pink pods (idk if it works for DX11). If the grey grass ground is fixable, I wonder if DX11 compatibility is possible... :L Totally theorizing here.

Edited by Avera9eJoe
Link to comment
Share on other sites

Can anybody familiar with shader code tell me what the following line does?

fn.xy = texTile(_Normals_Tile, IN.uv, _Normals_TileCoords, _Normals_TileSize).xy;

EDIT: Wait. There aren't lines in the atmo in DX11 mode?? Blackrack was making a water shader a bit ago, and there is a fix for the pink pods (idk if it works for DX11). If the grey grass ground is fixable, I wonder if DX11 compatibility is possible... :L Totally theorizing here.

Pink pods fix should work for all renderes. Full DX11 and OpenGL comaptibility should be possible, I just don't intend to work on it until I have the more important stuff worked out.

Edited: Anyone ever tried getting the scene normalmap in KSP?

Edited by blackrack
Link to comment
Share on other sites

Just sent you a PM.

I haven't seen the texTile function before... are you sure it isn't shipped with the proland stuff? It isn't a standard cg call, and I don't think it is from the unity cg include.

If I had to guess, given that it is using the _Normals, I would say it is getting the normal values (rg) from the normal map.

Link to comment
Share on other sites

Edited: Anyone ever tried getting the scene normalmap in KSP?

My expression just went from o-O -> O_O -> =D

Pink pods fix should work for all renderes. Full DX11 and OpenGL comaptibility should be possible, I just don't intend to work on it until I have the more important stuff worked out.
Link to comment
Share on other sites

Just sent you a PM.

I haven't seen the texTile function before... are you sure it isn't shipped with the proland stuff? It isn't a standard cg call, and I don't think it is from the unity cg include.

If I had to guess, given that it is using the _Normals, I would say it is getting the normal values (rg) from the normal map.

Thanks, you're right about texTile though, turns out it's included in proland. I'll try the method you sent me for getting the normalmap, I hope the precision will be enough.

Here's a better example of what I mean, in an image I posted a while ago:

https://i.imgur.com/5neEQU3l.png

Click to embiggen and take a very close look at the sun on the horizon. You can see a line at about the height of the tracking station roof, extending across the entire horizon running just below the rim of the communications dish to the right of the sun. Below that line things look slightly different

Unless you have the sky transparency set below 100% or you're setting a really high alpha cutoff this shouldn't happen in any of the old builds. In the new version it's not unlikely though, you can already see a similar picture I posted about 10 pages back

http://i.imgur.com/sPkqPMy.jpg

Edited: I guess since you're seeing clouds in an old build you already have transparency lowered so that explains it.

Edited by blackrack
Link to comment
Share on other sites

I was actually looking for the normalmap for the currently rendered scene. If you're familiar with the "toggle depth buffer" button in scatterer it's similar but it looks like this https://bitwisegames.files.wordpress.com/2011/04/thesphere-normals.png, it tells you which direction each surface is pointing. I need it to determine the reflected light correctly.

Don't worry though, rbray already sent me a way to do it.

Link to comment
Share on other sites

Hello! This mod is great!!

I play with this settings:

(For the pink textures, I was change no-PQS files in the ReplacementShaders folder)

_ D3DX11

_ KSP settings:

Video:

Res: 1650x1050

Fullscreen = True

Anti-Aliasing = x8

V Sync = Adaptative (Nvidia)

Pixel Light Count = 8

Shadows Cascades = 4

Scenery:

Terrain Detail = High

Scatter Density = 100%

Rendering:

Render Quality Level = Fantastic

Texture Quality = Full Res

with this visual mods:

_ EVE with RC settings and textures

_ Texture Replacer with RC settings and textures

_ Planet Shine

_ Distant Object

_ And sometime, Scatterer!!

and some other mods... (MechJeb, SoundtrackEditor, Chatterer, LanguagePatches)

My settings for Scatterer:

forceOFFaniso = False

extinctionCoeff = 10

atmosphereGlobalScale = 0.999 (for 1, I got a bug with ocean and grass)

postProcessingAlpha = 0.5

postProcessingScale = 1

postProcessDepth = 0.065

postProcessExposure = 0.18

m_HDRExposure = 0.2

alphaCutoff = 0.01

alphaGlobal = 0.9

Why "sometime" for Scatterer? For some issues when I leave atmosphere:

Between 20-200km:

72D3BFF7534C7E0B8063658C9318A7EBC9BE3421

Between 200-450km:

1D1FDA094AFA86C871E0B8E99641B3068479A51E

Up 500km:

A4508DF1DC350CFEDD155098C2AFC480F8B8DD90

F22E674AE9A76EF36527C510D4DD9359370E65D6

For this time, as proposed by Avera9eJoe, with a toggle mod option at altitude of 20-30km, "sometime" could be "everytime".

But, it would be nice if there is a better solution.

Link to comment
Share on other sites

Hey, experienced a little graphical bug when installing the new .015 update- A small purple glyph appears around the VAB, and several parts in the Editor windows, in several categories, also have their textures replaced by the same color purple- hadn't run into this with the previous update.

I've experienced this in both modded and stock version of the game, on my primary machine.

HfIAxvt.jpg

4mW365T.jpg

Link to comment
Share on other sites

Hey, experienced a little graphical bug when installing the new .015 update- A small purple glyph appears around the VAB, and several parts in the Editor windows, in several categories, also have their textures replaced by the same color purple- hadn't run into this with the previous update.

I've experienced this in both modded and stock version of the game, on my primary machine.

http://i.imgur.com/HfIAxvt.jpg

http://i.imgur.com/4mW365T.jpg

Merge the replacementshader folder from a previous release of Scatterer with the current release's replacementshader folder and that should fix it for now.

Link to comment
Share on other sites

TBH It sems to be necessary to post quick fixes to the front page for common bugs, and refresh the known issues list, so people dont post the same error, and wait for the same fixes over over and over again. I know that this should not be necessary, but this is really getting out of hand.

Link to comment
Share on other sites

TBH It sems to be necessary to post quick fixes to the front page for common bugs, and refresh the known issues list, so people dont post the same error, and wait for the same fixes over over and over again. I know that this should not be necessary, but this is really getting out of hand.

If only it were that simple. Instead of then posting the actual fix on every page, you're then left having to post "see the OP for the fix" every bloody page. And if we had stickies you'd still have to post "see stickies" every bloody page.

This is the Curse of Support - lazy users who can't be arsed to just read back a few posts.

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