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

7 hours ago, 아무생각 said:


How do you control the wind speed? please
3 hours ago, Beetlecat said:

Do you mean the speed/intensity of the waves? I don't think that's adjustable yet. Otherwise there's no simulated atmospheric wind.

Wind speed is an adjustable parameter which affects the waves size, it's configurable from the UI (alt-f11 -> ocean settings -> wind speed -> rebuild ocean) or from the ocean.cfg, so it's adjustable manually, in the future it will be dynamic. Simulated atmospheric wind is probably out of scope :p

 

Edited by blackrack
Link to comment
Share on other sites

In case it helps: this mod seems to work OK for me in KSP 1.11

I've briefly tested it, with the following list of things installed:

KSP 1.11.0.3045 win x64 (Steam)
Making History 1.11.0
Breaking Ground 1.6.0

Chatterer v0.9.99 - Keep talking!
Click Through Blocker 0.1.10.14
Docking Sounds!! 2.1.12.27690 (10/7/16)
E.V.E. Redux 1.11.1.1 (from blackrack) + Configs-1.2.2.1 (from WazWaz)
Final Frontier 1.10.0-3485 + KerbFleet Custom Ribbons 1.2.0
Kerbal Alarm Clock 3.13.0.0
Module Manager 4.1.4
PlanetShine v0.2.6.3
Rover Wheel Sounds (Revived) v1.8.1.11.20.19 (from DoctorDavinci, .dll overwritten with the one from MAFman)
Scatterer - atmospheric scattering 0.0722
Texture Replacer 4.3
ToolbarController 0.1.9.4
[x] Science! v5.26

The only detail I would mention is that, if played in 4k resolution (3804 x 2160), the UI for this mod is too tiny to see comfortably. It would be great if it could be scaled (maybe just the same as the UI Scale option from stock settings?). At any rate, thank you very much to the developer(s) of this mod!

Link to comment
Share on other sites

On 12/24/2020 at 10:04 PM, BlackEyedPhantom said:

How can i apply the godrays???

They are applied by default so you have nothing to do, unless you are using a config from a visual pack which disables them or disables long distance shadows.

35 minutes ago, eberkain said:

I had it happen again and got it on video.

Alright, I think it's an old shadow cascade not getting cleared if nothing is rendered to it. Will fix for next version.

Link to comment
Share on other sites

16 minutes ago, blackrack said:

Why does your album say "Parallax bugs" but you're posting it here?

Brain fart, I meant to write Scatterer bugs. But if I'm honest I guess the bug could be caused byParallax too, I figured you might have a better idea

Link to comment
Share on other sites

On 11/29/2020 at 4:00 PM, blackrack said:

This will be a long post so grab some snacks :)

I have been working on implementing a new godray technique:
q9f5E2q.jpg

nvYna3o.jpg

IkeSCsg.jpg

7M74m4f.jpg
 
Some of you might remember I used to have godrays in scatterer a while back, well that implementation was flawed and had many issues, here is a direct comparison between the old and new technique.

vd5JmIo.jpg
 
The old technique was only getting the "outer surface", and couldn't handle overlapping rays and get the real depth, it also often had gaps.

OzAKGdh.jpg

The new technique creates a light volume and handles overlapping rays and complex shapes, it uses shadow information so is directly tied to shadowmap resolution, shadow distance etc (now you understand why I was insisting on "fixing" shadows in the last update).

A4h6bqe.jpg

WbJLo5O.jpg

To put this new technique to the test, I built this huge monolith.

28kqkK3.jpg

I call this: "The Temple of Godrays"

cLUE9hf.jpg

I boosted scattering exposure a bit here, you can see light columns formed by the holes in the ceiling

4b7xgp3.jpg

As you can see, it's a true volumetric effect and not screen-space

4GuCFqz.jpg

With this new technique I'm also able to inject any information I want to create godrays, I'm currently adapting it to have EVE clouds cast godrays, although it still needs a lot of work:

R5GqHqp.jpg

Laythe's surface looking magical:

eMBktvv.jpg
PoshUniformErne-size_restricted.gif
webm: https://gfycat.com/poshuniformerne

I have to say though this looked simple to me going in, it's probably been one of the most complex features for me to implement and pretty much took everything I learned in the last few years about graphics programming and the unity engine to get it working.
These godrays will only work on Directx11 (they require the unified camera setup).


Moving on, a few versions back I added underwater caustics. The next logical step was to create underwater light rays:
0NYSE58.jpg

Short video: https://gfycat.com/sillypeskybaldeagle

These use a completely different technique from the godray technique used for terrain and clouds, more adapted for short distances and semi-transparencies.

Here the lightrays are derived directly from the caustics textures and config, you can follow any light ray to the matching caustic.

fHeDbOB.jpg

Here are some beauty shots, as you can probably see, this is inspired by subnautica.

qIyKH5I.jpg

R3ZlAIp.jpg

We can also do the same “temple test” as we did for godrays but underwater

CtNmuCi.jpg

nsimbyw.jpg

UrdEN94.jpg

 

Moving on, since the ocean shader was added, it has always looked nice, but any ships on the water surface were always static and not interacting with the waves, as if they were anchored in place.


Some will remember that I showed a prototype in 2016 were a ship was interacting with waves. Since the ocean was created and animated on the GPU, in the 2016 implementation I re-did all the ocean calculations on the CPU, so that the height info would be available on the CPU for physics, so it was slow (as it's a computationally heavy task that benefits from parallelization but that's the GPU's job) and had a very hefty CPU impact, moreover my knowledge was limited at the time, and the implementation was unstable and caused ships to disintegrate, often within seconds.
Well, here's the new version:

SplendidCelebratedDodobird-size_restrict
Webm: https://gfycat.com/splendidcelebrateddodobird

It appears stable even with multiple ships

EvilExcellentBobwhite-size_restricted.gi
Watch in HD: https://gfycat.com/evilexcellentbobwhite

Although it can of course destroy your ships if the waves are big.


Here is a boat caught in a massive storm (ridiculous buoyancy on the boat here):

ImaginaryJadedAfricanaugurbuzzard-size_r
Webm:  https://gfycat.com/imaginaryjadedafricanaugurbuzzard

What's impressive, this runs with nearly no performance impact. How can it run so well when the old version destroyed performance? There is a big trick here, can you tell what is going on?

Wave interactions will only work on Directx11, if you haven't guessed, the magic feature that makes this work is async GPU readback which is sadly not implemented by unity for OpenGL.

With this, there are other limitations like jittering and cutting that become apparent in the ocean shader when the waves are bigger (there was never a reason before to have big waves when vessels stayed "anchored"), as well as how static the ocean config is, in a future update I will work on making the ocean dynamic, I will start with a simple weather system so the waves can change dynamically, we'll see where this goes.

Gameplay-wise, it makes moving against the waves difficult, the water seems to slow down ships a lot on every impact, however reasonable/small waves are a pleasure to navigate. I'm also looking forward to see the first guy to stabilize a boat by moving fuel in between tanks with a kOS script. Vessel recovery can be an issue too, although I have workarounds to test.

Moving on, RSS/Rescale users will be happy to know that I’ve fixed this issue where scattering is cut off in the distance (without changing the clip planes)

zmM8wcI.jpg

You might still be able to spot a discrepancy where local terrain and scaled terrain meet, but it's a small one.
Using the same technique I’ve also fixed this issue where mountains might look overbright white when ascending to orbit

GSkiuNt.jpg

And for OpenGL users who must be feeling left out by now due to no godrays and wave interactions on Opengl, at least I have something for you. Since unity added compute shader support outside Directx11: Config tool builds for Linux and Mac:

https://github.com/LGhassen/Scatterer/releases/download/0.1-mac-conftool/ConfigToolLinux.zip

https://github.com/LGhassen/Scatterer/releases/download/0.1-mac-conftool/MacConfTool.app.zip


Also, actual documentation for scatterer is here on the wiki, although still a work in progress

7HNVqYF.jpg

https://github.com/LGhassen/Scatterer/wiki


With that said, I really love modding and exploring what can be done, I feel like I'm close to "finishing" Scatterer, but the topics involved are increasingly complex and time-consuming to work on.


As I want to continue modding, I decided to set up a Patreon, hoping to make modding more sustainable for me. This doesn't mean my mods will become paid, they will be available for everyone of course, however patrons will get early access to in-dev features and previews, and I get to spend more time doing what I love and adding new features everyone can enjoy, and finally finding the time to work on some things that I never could, and fixing the layer of jankiness around my old code (nevermind that scatterer was my first real programming project). I will be uploading a first build shortly, so stay tuned:

20TIHMv.png

Please consider supporting me there if you appreciate my work, and if you can't, that's alright too, releases will always be public.

Hi, is there some public release of you awesome scatterer configs? I wanna try to interactive water so far. (If there is send me link please)

Link to comment
Share on other sites

7 minutes ago, D0m1nu2 said:

Could you send me a link for it please.

:huh:

On 12/27/2020 at 8:40 PM, abbiii said:

Brain fart, I meant to write Scatterer bugs. But if I'm honest I guess the bug could be caused byParallax too, I figured you might have a better idea

I'm just going to say that doesn't look like a scatterer issue to me though, looks like some terrain tiles are not disabled in scaled space

Link to comment
Share on other sites

Long time KSP and Scatterer user...  But I'm having problems with cloud shadows (EVE) on oceans, hoping someone can offer some insight?  Thank you!

Ever since Scatterer introduced the ocean waves (awesome!) I've had an issue where cloud shadows (EVE) will not render on the ocean (land is fine) below a certain orbital altitude, approx 150k.

If I go into wireframe view, I can see that below 150k-ish a new set of (ocean?) wireframes is generated, and it looks like the shadows will not render on those wireframes. I'm super guessing that above 150k-ish the ocean is "flat" but when I move/zoom below 150k-ish the Scatterer wave effect kicks in using different meshes?

The last KSP version where cloud ocean shadows worked correctly for me was 1.7.3.  On 1.9, 1.10 and 1.11 their are no cloud shadows on the oceans below 150k-ish. (Above 150k-ish it looks beautiful!) I've tried Scatterer 0600, 0610, 0621, 0632 and 0722.  Ocean shadows work perfectly without Scatterer.

Wanted to ask before doing an actual bug report, hoping it might be something on my end regarding my graphics card settings or something, but I've tried everything.

Has anyone ever experienced this or have any ideas/suggestions?  Do ocean cloud shadows work fine at all altitudes for most everyone?

Thanks in advance!

Link to comment
Share on other sites

Another completely useless Bug report because i have no pictures or log file but im getting rainbow clouds with the new update. I reverted back to the old update and it seems to be working fine. sorry for a lack of info but thought about telling you too late.

Link to comment
Share on other sites

6 hours ago, Skarch said:

Long time KSP and Scatterer user...  But I'm having problems with cloud shadows (EVE) on oceans, hoping someone can offer some insight?  Thank you!

Ever since Scatterer introduced the ocean waves (awesome!) I've had an issue where cloud shadows (EVE) will not render on the ocean (land is fine) below a certain orbital altitude, approx 150k.

If I go into wireframe view, I can see that below 150k-ish a new set of (ocean?) wireframes is generated, and it looks like the shadows will not render on those wireframes. I'm super guessing that above 150k-ish the ocean is "flat" but when I move/zoom below 150k-ish the Scatterer wave effect kicks in using different meshes?

The last KSP version where cloud ocean shadows worked correctly for me was 1.7.3.  On 1.9, 1.10 and 1.11 their are no cloud shadows on the oceans below 150k-ish. (Above 150k-ish it looks beautiful!) I've tried Scatterer 0600, 0610, 0621, 0632 and 0722.  Ocean shadows work perfectly without Scatterer.

Wanted to ask before doing an actual bug report, hoping it might be something on my end regarding my graphics card settings or something, but I've tried everything.

Has anyone ever experienced this or have any ideas/suggestions?  Do ocean cloud shadows work fine at all altitudes for most everyone?

Thanks in advance!

Cloud shadows have never worked "correctly" with the scatterer ocean. If you go back to the old version you'll see they ignore any waves and render through in weird ways. They have to be integrated but I haven't done it yet.

57 minutes ago, kirmie44 said:

Another completely useless Bug report because i have no pictures or log file but im getting rainbow clouds with the new update. I reverted back to the old update and it seems to be working fine. sorry for a lack of info but thought about telling you too late.

I'm guessing you are using a visual pack, old scatterer configs have to be slightly adjusted due to changes in the cloud integration shading.

Link to comment
Share on other sites

1 hour ago, blackrack said:

I'm guessing you are using a visual pack, old scatterer configs have to be slightly adjusted due to changes in the cloud integration shading.

Ah, that explains it. I'm using Spectra which hasn't been updated yet. Thanks for the info!

Link to comment
Share on other sites

15 hours ago, blackrack said:

Cloud shadows have never worked "correctly" with the scatterer ocean. If you go back to the old version you'll see they ignore any waves and render through in weird ways. They have to be integrated but I haven't done it yet.

Hey, thanks for the reply!  Okay, I shall patiently look forward to the integration.  Thanks again!

Link to comment
Share on other sites

On 12/19/2020 at 11:21 AM, blackrack said:

So this is actually caused by godrays being passed a shadowmap resolution of 0, and the reason is these variables are missing from Spectra config, but the new version enables godrays by default if the config is missing. Either enable terrain shadows + the shadowmap resolution override, or disable godrays, that's it really.

So I have the same issue in 1.11 and I tried turning off godrays and it still spams the log file. 

p.jpeg?fv_content=true&size_mode=5

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