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

Since this mod is constantly worked on and yet still has to get a version that is stable and or fully working how you implement one of those amazing update check tool into it ... like e.g. CKAN?

Other than this ... keep up the amazing work .. and thank you for making this mod.

Link to comment
Share on other sites

I Tried it in 1.0 It works but it has some artefacts. It seems that the atmosphere cut straight to black ( space ) around 30K or a bit higher. The loading is a Pink Square thing.

Havent seen the pink loading thingy myself, but the sky turning black? /check

230exf.png

Mine already starts going black at around 6000m for some reason :huh:

Besides that, it looks absolutely gorgeous. :D

Link to comment
Share on other sites

So apparently, the atmosphere looking too thick from orbit is a bug that found it's way in (among many other bugs) when I ported the shaders to dx9.

We all just dismissed it as the atmosphere being too dense because we thought it made sense.

This is how the shader is supposed to look from orbit:

vNm4ECO.jpg

This is how it looks right now:

KflP0DZ.jpg

I haven't found the cause of it yet but when this is done the view from orbit should be way way better.

Hey! Blackrack! I featured Scatterer in my 2 Minute Mods series. Hope you like the video, and please feel free to share around, use, and so on.

Great video, keep it up.

Some screenshots from tonight. I mostly avoided taking screenshots of areas with high mountains because aside from those it looks fantastic at all altitudes I was playing at tonight. I'm running PlanetShine and a SweetFX config to brighten up the game a bit from its normally strange dark lighting.

http://imgur.com/a/Yea5d

This is one of my favorite mods in development right now. I can't give OP enough praise for how much better this makes the game look.

I'll make a higher atmsphere for the next version, hopefully when/after I fix this bug.

Since this mod is constantly worked on and yet still has to get a version that is stable and or fully working how you implement one of those amazing update check tool into it ... like e.g. CKAN?

Other than this ... keep up the amazing work .. and thank you for making this mod.

I'll look into one of these for the next version.

Link to comment
Share on other sites

Following closely. Keep up the amazing work, blackrack! Finally, KSP is starting to resemble the KSP of my daydreams.

Speaking of this I had a dream a few days ago before 1.0 dropped where I walked up next to the cockpit of a plane. It ended up being the Mk2 inline. As I walked closed I realized that I could see inside the cockpit and then I woke up with the idea that KSP 1.0 had transparent windows that you could see in to from outside... ;.;

Link to comment
Share on other sites

So, the water almost works.

0AyPUBJ.jpg

But the problem is, it moves up slightly whenever the camera moves up

17RFsFx.jpg

It doesn't follow the camera closely, just nudges slightly up with it but it's still enough to flood everything and create a jarring effect.

7t6VJjw.jpg

I'm pretty bad at math, so I think the problem lies in this part with all the transformation matrices https://github.com/blackrack/Scatterer/blob/master/scatterer/Ocean/OceanNode.cs#L262 (lines 262-383)

If anyone could review the code I'd be grateful, I've been stuck on this for a bit. If you want to try compiling/debugging yourself just compile and drop the .dll inside this build, http://wikisend.com/download/915958/scatterer.zip it has all the ocean shaders and the stuff necessary to run.

Edited by blackrack
Link to comment
Share on other sites

So, the water almost works.

http://i.imgur.com/0AyPUBJ.jpg

But the problem is, it moves up slightly whenever the camera moves up

http://i.imgur.com/17RFsFx.jpg

It doesn't follow the camera closely, just nudges slightly up with it but it's still enough to flood everything and create a jarring effect.

http://i.imgur.com/7t6VJjw.jpg

I'm pretty bad at math, so I think the problem lies in this part with all the transformation matrices https://github.com/blackrack/Scatterer/blob/master/scatterer/Ocean/OceanNode.cs#L262 (lines 262-383)

If anyone could review the code I'd be grateful, I've been stuck on this for a bit. If you want to try compiling/debugging yourself just compile and drop the .dll inside this build, http://wikisend.com/download/915958/scatterer.zip it has all the ocean shaders and the stuff necessary to run.

this doesn't seem right: Looks like you need a cameraToLocal or WorldToOcean instead.


// compute ctoo = cameraToOcean transform
// also should be correct
Matrix4x4d cameraToOcean = localToOcean * cameraToWorld;

- - - Updated - - -

Oh... Once you get everything working, reference shader params by their ID, not their name. Otherwise it has to do string lookups, and can add a good bit of processing time.

Link to comment
Share on other sites

gotta say this is the #1 thread I look forward to checking in on everytime I stop by these days. Keep up the good work and post plenty of pics

Same! I always save it for last, because it's the one that I'm looking forward to the pictures in the most.

Link to comment
Share on other sites

this doesn't seem right: Looks like you need a cameraToLocal or WorldToOcean instead.


// compute ctoo = cameraToOcean transform
// also should be correct
Matrix4x4d cameraToOcean = localToOcean * cameraToWorld;

- - - Updated - - -

Oh... Once you get everything working, reference shader params by their ID, not their name. Otherwise it has to do string lookups, and can add a good bit of processing time.

I think you're right (and I hope you are, for my sanity), I'm going to try a using a WorldToOcean now.

Link to comment
Share on other sites

Firstly, Proot, you sir are a bad man :D

Onto bus i ness..

Not sure if this helps or hinders but I was messing around with my son today, I walk away from the computer and my KSP looks like this.

screenshot0_zpsymj3ei2q.png

All kinds of pretty.

He takes a screenshot of launch to show me.

screenshot2_zpsz7ncndnk.png

All looks good.

Then whilst making a cuppa tea he does something and takes a screeny for me.

screenshot3_zpswgmppu8k.png

Clouds?

screenshot4_zps8dlvbahe.png

screenshot5_zpskxgepdvl.png

screenshot6_zpsifthqst4.png

screenshot7_zpsoylpomjw.png

screenshot1_zpsotjzr5y9.png

I have no idea what he did, neither does he.

I know that they are not perfect but I have never had clouds with Scatterer before.

Link to comment
Share on other sites

I don't usually check up on mods every three hours, but I'm incredibly interested in where this is going. Without a doubt, this is the coolest new mod in the works. That water is gorgeous and I can't wait for the next update!

Link to comment
Share on other sites

Firstly, Proot, you sir are a bad man :D

Onto bus i ness..

Not sure if this helps or hinders but I was messing around with my son today, I walk away from the computer and my KSP looks like this.

http://i8.photobucket.com/albums/a27/OrkHarrid/screenshot0_zpsymj3ei2q.png

All kinds of pretty.

He takes a screenshot of launch to show me.

http://i8.photobucket.com/albums/a27/OrkHarrid/screenshot2_zpsz7ncndnk.png

All looks good.

Then whilst making a cuppa tea he does something and takes a screeny for me.

http://i8.photobucket.com/albums/a27/OrkHarrid/screenshot3_zpswgmppu8k.png

Clouds?

http://i8.photobucket.com/albums/a27/OrkHarrid/screenshot4_zps8dlvbahe.png

http://i8.photobucket.com/albums/a27/OrkHarrid/screenshot5_zpskxgepdvl.png

http://i8.photobucket.com/albums/a27/OrkHarrid/screenshot6_zpsifthqst4.png

http://i8.photobucket.com/albums/a27/OrkHarrid/screenshot7_zpsoylpomjw.png

http://i8.photobucket.com/albums/a27/OrkHarrid/screenshot1_zpsotjzr5y9.png

I have no idea what he did, neither does he.

I know that they are not perfect but I have never had clouds with Scatterer before.

I got something similar since a little time. If is not a new atmo config (like in my case -these are my latest tests-) your son probably have touched the menu transparency. ;)

My test atmo is pretty higher than the default ("finish" at 15000m limit at 69000m), and still you can see some mountains piercing the sky. I like that effect (pretty realistic for me), but I'm still working to tune it and, of course, to get a much more credible atmo overall.

xXDO7nM.jpg

NwL4Le2.jpg

Link to comment
Share on other sites

I hope so too! I really want to see those oceans!

Well, I tried it yesterday and... it didn't work. Since local space in the context of the shader refers to space relative to the planet, I figured the localToWorld matrix is kerbin's localToWorld matrix. After that, I just did

camToLocal = cameraToWorld * localToWorld.Inverse();

I also tried adjusting few other things since that's bound to throw everything off but couldn't figure out what's wrong. I have to admit that when stuff gets too "matrix-y" I have trouble imagining it and getting an intuitive understanding of it, so I'm not the best guy for the job.

I'm giving it another try now, I'll try and re-understand how the whole thing works from the ground up.

This thread is so much fun to watch :). I just wanted to say that. Nothing like two modders working together to get a common collaborative goal.
I don't usually check up on mods every three hours, but I'm incredibly interested in where this is going. Without a doubt, this is the coolest new mod in the works. That water is gorgeous and I can't wait for the next update!

I'm glad you guys are enjoying this. Unfortunately, I have to say that development is going to slow down a LOT, mainly because I'm going to be working a job from 9am to 5pm starting next monday, so I won't have half as much free time as I used to. That kind of sucks.

I got something similar since a little time. If is not a new atmo config (like in my case -these are my latest tests-) your son probably have touched the menu transparency. ;)

My test atmo is pretty higher than the default ("finish" at 15000m limit at 69000m), and still you can see some mountains piercing the sky. I like that effect (pretty realistic for me), but I'm still working to tune it and, of course, to get a much more credible atmo overall.

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

For a second there I thought I walked into the space engine thread. That image is simply amazing.

Link to comment
Share on other sites

So it seems I've sort of found the issue, debugging the vector from camera to local, it seems it's magnitude starts at 600 000 (kerbin's radius) and gets smaller with altitude, which should be the opposite. Curiously, the only way I find to fix it was to inverse the cameraToWorld matrix, but that throws off all of the evctor directions, I remember reading somewhere that cameras have a flipped z axis or soemthing like that, could this have any relation to it?

Link to comment
Share on other sites

Well, I tried it yesterday and... it didn't work. Since local space in the context of the shader refers to space relative to the planet, I figured the localToWorld matrix is kerbin's localToWorld matrix. After that, I just did

camToLocal = cameraToWorld * localToWorld.Inverse();

Don't think that works... Pretty sure it should be localToWorld.Inverse()*cameraToWorld. Remember that the order is inverted for matrix multiplication.

Also, I'd probably convert the oceanToLocal to oceanToWorld rather than the change the camera matrix so you don't have to perform an inverse matrix calculation.

Link to comment
Share on other sites

Don't think that works... Pretty sure it should be localToWorld.Inverse()*cameraToWorld. Remember that the order is inverted for matrix multiplication.

Also, I'd probably convert the oceanToLocal to oceanToWorld rather than the change the camera matrix so you don't have to perform an inverse matrix calculation.

Well I did that, so first the ocean still flooded in the same way but went black, I figured I had to remove the rotation from the localToWorld matrix I pulled from kerbin, since that's how it's done in proland, so I keep only the translation. So now the cameraToLocal should be the same as worldToLocal but translated to be relative to the planet's origin, I put it back in, the ocean works like it used to (moves up and down with the camera).

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