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

1 hour ago, Chimer4 said:

Hi blackrack, just a quick one. It seems that the scattering effects hides the city lights from EVE on the night side of a planet in map view, but they are still visible from orbit. I couldn't see this mentioned in the know issues and couldn't see it in the most recent pages, so apologies if you already know about this

Can you post some screens?  Preferably before/after.

3 hours ago, Gaiiden said:

Blackrack do you plan to have the light reflect onto crafts as well?

Most likely not, the planetshine mod has been doing this for a while and looks like it does a very good job at it, besides, all the visual packs already include configs for it and everything. I'm suspecting however he didn't add planetshine effects to planets because the stock sky/atmo doesn't take them into account.

Link to comment
Share on other sites

4 minutes ago, blackrack said:

Most likely not, the planetshine mod has been doing this for a while and looks like it does a very good job at it, besides, all the visual packs already include configs for it and everything. I'm suspecting however he didn't add planetshine effects to planets because the stock sky/atmo doesn't take them into account.

4 hours ago, Gaiiden said:

Nice! Make sure @Valerian knows about this, as although his mod adds planetshine to crafts, he was also planning on doing it for planets as well. Blackrack do you plan to have the light reflect onto crafts as well?

Actually I already have everything necessary to make actual planetshine work, and I have already started to code it at an early stage in my experimental branch (on github), I don't think I need to do anything regarding stock shaders and skies/atmospheres to make it work properly. However I would be interested to know how to make sure that PlanetShine works properly with scatterer.

If you want to implement it yourself, go for it, because I don't know when I will have time to start working again on PlanetShine. You could even try to make it work in combination with the current PlanetShine, we could agree on some kind of API, feel free to suggest anything.

For determining the light color of other bodies, I strongly advise you to use the automatic determining that I use in my experimental version, which renders a view of a celestial body through a hidden camera on a tiny texture, and then gets the average color from it, without needing any config files for planet/moon colors.

The source code of the experimental version has been refactored a lot and is much cleaner than the master branch, so please only use the experimental branch if possible.

Link to comment
Share on other sites

42 minutes ago, Valerian said:

Actually I already have everything necessary to make actual planetshine work, and I have already started to code it at an early stage in my experimental branch (on github), I don't think I need to do anything regarding stock shaders and skies/atmospheres to make it work properly. However I would be interested to know how to make sure that PlanetShine works properly with scatterer.

If you want to implement it yourself, go for it, because I don't know when I will have time to start working again on PlanetShine. You could even try to make it work in combination with the current PlanetShine, we could agree on some kind of API, feel free to suggest anything.

For determining the light color of other bodies, I strongly advise you to use the automatic determining that I use in my experimental version, which renders a view of a celestial body through a hidden camera on a tiny texture, and then gets the average color from it, without needing any config files for planet/moon colors.

The source code of the experimental version has been refactored a lot and is much cleaner than the master branch, so please only use the experimental branch if possible.

I see, though I would personally leave it up to the user to finetune the actual color and set it to what they find visually pleasing, regardless of what the average color is. Especially since the scatterer atmosphere doesn't cooperate with additional cameras for now.

Do you also render this hidden camera every frame so you can also account for sunsets and dimming realistically?

Anyway, unless I missed something, in my last round of testing I saw that the stock sky doesn't work with additional lights. I will take a look at what you already have. My main goal is to add atmospheric scattering from light sources other than the sun but I figured it needed some kind of terrain lighting also. I haven't decided what I want to do yet but I will keep you updated.

Link to comment
Share on other sites

Just now, blackrack said:

I see, though I would personally leave it up to the user to finetune the actual color and set it to what they find visually pleasing, regardless of what the average color is. Especially since the scatterer atmosphere doesn't cooperate with additional cameras for now.

Do you also render this hidden camera every frame so you can also account for sunsets and dimming realistically?

Anyway, unless I missed something, in my last round of testing I saw that the stock sky doesn't work with additional lights. I will take a look at what you already have. My main goal is to add atmospheric scattering from light sources other than the sun but I figured it needed some kind of terrain lighting also. I haven't decided what I want to do yet but I will keep you updated.

Currently there is an option to fully override the automatic detection for a single celestial body, but I'm also planning in the future to add more fine tuning options per-body for the auto detection, such as intensity, hue, etc.

If I remember well, I render the camera on LateUpdate(), with a bit of frame skipping (optional), on a 32x32 px texture.

I didn't test it with scatterer.

I don't think the armosphere shader will work with anything else than the sun, I was only planning to make the terrain work, using a spotlight.

Link to comment
Share on other sites

3 minutes ago, Valerian said:

Currently there is an option to fully override the automatic detection for a single celestial body, but I'm also planning in the future to add more fine tuning options per-body for the auto detection, such as intensity, hue, etc.

If I remember well, I render the camera on LateUpdate(), with a bit of frame skipping (optional), on a 32x32 px texture.

I didn't test it with scatterer.

I don't think the armosphere shader will work with anything else than the sun, I was only planning to make the terrain work, using a spotlight.

Got it, any particular reason for picking a spotlight?

Link to comment
Share on other sites

14 minutes ago, blackrack said:

Got it, any particular reason for picking a spotlight?

Because a directional light will illuminate some unintended stuff obviously, and a point light as well.

The spotlight seems to best solution given what I can do (I know nothing about shaders), but it's far from perfect obviously, I would have to handle several special "collision" cases.

If you have a better solution to suggest I would be glad to hear about it!

The thing is that currently I can focus on the player vessel because it's on a different culling layer than the other stuff, but I don't know of any way that I can use to make a light apply to a specific celestial body, other than the spotlight.

Edited by Valerian
Link to comment
Share on other sites

16 minutes ago, Valerian said:

Because a directional light will illuminate some unintended stuff obviously, and a point light as well.

The spotlight seems to best solution given what I can do (I know nothing about shaders), but it's far from perfect obviously, I would have to handle several special "collision" cases.

If you have a better solution to suggest I would be glad to hear about it!

The thing is that currently I can focus on the player vessel because it's on a different culling layer than the other stuff, but I don't know of any way that I can use to make a light apply to a specific celestial body, other than the spotlight.

I'm afraid there isn't much we can do about this unless someone re-does the terrain and planet shaders or figures out how to make shaders that work in the same way, then we can build all sort of custom lighting into them without messing up anything else. For now I guess your spotlight method is the best way.

Link to comment
Share on other sites

On 2/3/2016 at 7:12 PM, blackrack said:

Yeah I see what you mean, this effect is simulated in Proland and is something I am shooting for

http://proland.imag.fr/gallery/terrains/image204.png

http://proland.imag.fr/gallery/edition/image390.png

However I can't really achieve it unless I can also modify the orginal terrain shaders to alter the lighting and build both the scattering and a HDR effect directly in them. The depth and extinction settings I have now don't really compare. The effect is still more or less just an overlay in the end.

You could also apply another material on top that performs secondary passes like my city lights shader does...

Link to comment
Share on other sites

28 minutes ago, TaintedLion said:

I'm not seeing scatter effects in the tracking station, and not in the map view either, unless I am controlling a craft in orbit around an atmospheric body.

Yep! Nothing out of the ordinary.

Link to comment
Share on other sites

Hi there blackrack, here are the screens you asked for of the city lights being hidden by scatterer. Noticed the first on my main 64bit install, but reproduced on a clean 32bit install with only EVE and scatterer

 

 

Link to comment
Share on other sites

13 hours ago, gkorgood said:

it's unfortunately bugged to hell, and I was only able to get it out to the ocean using hack grav AND hyperedit, and even then it crashed on physics load the next time I went back to it. I'll put it up on kerbalx if you really want, but I don't advise using this file.

Alright, if I COULD have the file I would really like it, I will probably modify it a lot but il be sure to credit you if I use it in a video or something!

Link to comment
Share on other sites

6 hours ago, Chimer4 said:

Hi there blackrack, here are the screens you asked for of the city lights being hidden by scatterer. Noticed the first on my main 64bit install, but reproduced on a clean 32bit install with only EVE and scatterer

I will take a look at it. Has this been happening for a while or only with the new version?

 

7 hours ago, TaintedLion said:

I'm not seeing scatter effects in the tracking station, and not in the map view either, unless I am controlling a craft in orbit around an atmospheric body.

They're disabled there, loading effects on all planets at once is very memory-heavy and takes a while.

Edited by blackrack
Link to comment
Share on other sites

10 hours ago, blackrack said:

I'm afraid there isn't much we can do about this unless someone re-does the terrain and planet shaders or figures out how to make shaders that work in the same way, then we can build all sort of custom lighting into them without messing up anything else. For now I guess your spotlight method is the best way.

does the new PBR lighting model discussed in this week's dev notes have anything to do with planet lighting or is that mainly for parts?

Link to comment
Share on other sites

8 hours ago, TaintedLion said:

I'm getting the stock ocean appearing through the waves on Laythe. I tried looking for the Compiled-OceanBack.shader and Compiled-SphereOcean.shader to delete them, but they don't exist in my GameData.

This still happens randomly because the stock ocean isn't cmpletely disabled but hidden. Rbray sent me a snippet that appears to fix this and also gives a small performance bump. It seems pretty stable so far, I will release it with next version.

Edited by blackrack
Link to comment
Share on other sites

20 hours ago, blackrack said:

This still happens randomly because the stock ocean isn't cmpletely disabled but hidden. Rbray sent me a snippet that appears to fix this and also gives a small performance bump. It seems pretty stable so far, I will release it with next version.

I don't suppose this fix might also fix EVE's cloud shadows on your 3D ocean waves?

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