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

Is anyone else getting this rough transition to scaled space textures once they pass 110km? I'm running this on Dx9, dunno if that makes a difference. If its just me I'll have to do some poking but thought I'd ask. Thanks :)

So, I just discovered that this harsh pop-in of the scaled space textures seems to be coming from WIP-EVE, not Scatterer. I don't know why I didn't notice it before now. Sorry about bothering you about this earlier :P

Link to comment
Share on other sites

I discovered the weirdest thing today. I was mucking around with HDR, trying to figure out how to get some realistic exposure and lighting going (this would allow to not being able to see the dark side of the mun through the atmo, and see a crescent instead, among other things). I enabled HDR on the scaled space camera, imported a tonemapper, disabled the built-in HDR in my shaders (only applies to scatterer effects) set everything up and fired up the game. I then decided to disable my atmo shaders and see what the stock sky would look like with HDR and tonemapping, just for giggles, and surprise surprise:

syNHQNd.jpg

This is what the stock sky looks like with just HDR and tonemapping, no scatterer effects involved. I thought this looked a suspicious lot like proper atmospheric scattering. I sped time up and it seems the sky doesn't change color at sunset so probably it's not a full implementation. Still I thought this looked a lot more pleasant than what the sky looks like by default, so I digged around a bit and I found this:

http://kerbalspace.tumblr.com/post/17827181033/the-story-of-ksp-ksp-04

And so it seems it's true, KSP has some form of atmospheric scattering implemented, but for some reason, one of the most crucial bits, HDR and tonemapping is disabled, leaving the stock sky "truncated" and weird. As a reminder, HDR rendering means rendering outside of the 0-1 range values, and then mapping everything back to 0-1 using math formulas that involve exposure and some such, this allows for some realistic lighting and camera effects. When HDR is disabled, effects that are designed to work with HDR just get their values cut off. I believe someone at SQUAD has some explaining to do.

Edited: I might make a separate mod out of this for people who don't like scatterer, it's stock, it was done by the official devs and I only need about 5 lines of code to get this enabled, should also improve the sky on other stock planets and on kopernicus planets/planet packs without needing to reconfigure anything.

Edited by blackrack
Link to comment
Share on other sites

I discovered the weirdest thing today. I was mucking around with HDR, trying to figure out how to get some realistic exposure and lighting going (this would allow to not being able to see the dark side of the mun through the atmo, and see a crescent instead, among other things). I enabled HDR on the scaled space camera, imported a tonemapper, disabled the built-in HDR in my shaders (only applies to scatterer effects) set everything up and fired up the game. I then decided to disable my atmo shaders and see what the stock sky would look like with HDR and tonemapping, just for giggles, and surprise surprise:

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

This is what the stock sky looks like with just HDR and tonemapping, no scatterer effects involved. I thought this looked a suspicious lot like proper atmospheric scattering. I sped time up and it seems the sky doesn't change color at sunset so probably it's not a full implementation. Still I thought this looked a lot more pleasant than what the sky looks like by default, so I digged around a bit and I found this:

http://kerbalspace.tumblr.com/post/17827181033/the-story-of-ksp-ksp-04

And so it seems it's true, KSP has some form of atmospheric scattering implemented, but for some reason, one of the most crucial bits, HDR and tonemapping is disabled, leaving the stock sky "truncated" and weird. As a reminder, HDR rendering means rendering outside of the 0-1 range values, and then mapping everything back to 0-1 using math formulas that involve exposure and some such, this allows for some realistic lighting and camera effects. When HDR is disabled, effects that are designed to work with HDR just get their values cut off. I believe someone at SQUAD has some explaining to do.

Edited: I might make a separate mod out of this for people who don't like scatterer, it's stock, it was done by the official devs and I only need about 5 lines of code to get this enabled, should also improve the sky on other stock planets and on kopernicus planets/planet packs.

Could you make a beta for this? Looks nice.
Link to comment
Share on other sites

I discovered the weirdest thing today. I was mucking around with HDR, trying to figure out how to get some realistic exposure and lighting going (this would allow to not being able to see the dark side of the mun through the atmo, and see a crescent instead, among other things). I enabled HDR on the scaled space camera, imported a tonemapper, disabled the built-in HDR in my shaders (only applies to scatterer effects) set everything up and fired up the game. I then decided to disable my atmo shaders and see what the stock sky would look like with HDR and tonemapping, just for giggles, and surprise surprise:

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

This is what the stock sky looks like with just HDR and tonemapping, no scatterer effects involved. I thought this looked a suspicious lot like proper atmospheric scattering. I sped time up and it seems the sky doesn't change color at sunset so probably it's not a full implementation. Still I thought this looked a lot more pleasant than what the sky looks like by default, so I digged around a bit and I found this:

http://kerbalspace.tumblr.com/post/17827181033/the-story-of-ksp-ksp-04

And so it seems it's true, KSP has some form of atmospheric scattering implemented, but for some reason, one of the most crucial bits, HDR and tonemapping is disabled, leaving the stock sky "truncated" and weird. As a reminder, HDR rendering means rendering outside of the 0-1 range values, and then mapping everything back to 0-1 using math formulas that involve exposure and some such, this allows for some realistic lighting and camera effects. When HDR is disabled, effects that are designed to work with HDR just get their values cut off. I believe someone at SQUAD has some explaining to do.

Edited: I might make a separate mod out of this for people who don't like scatterer, it's stock, it was done by the official devs and I only need about 5 lines of code to get this enabled, should also improve the sky on other stock planets and on kopernicus planets/planet packs without needing to reconfigure anything.

That's brilliant! Maybe reach out to the devs and see if they'd be receptive to putting it in 1.0.5 or 1.1? If it's just 5 lines of code and in the stock game already, I can't imagine why they wouldn't want to enable it.

Link to comment
Share on other sites

That's brilliant! Maybe reach out to the devs and see if they'd be receptive to putting it in 1.0.5 or 1.1? If it's just 5 lines of code and in the stock game already, I can't imagine why they wouldn't want to enable it.

They're planning on touching visual aspects after 1.1 :D

Link to comment
Share on other sites

Eh, it's not too bad I guess but it's nothing amazing.

Before:

XicDohd.jpg

After:

NhOgejl.jpg

Before:

0qjI8FU.jpg

After:

9JoNLNp.jpg

Seems to remove the banding and make the colors generally easier on the eyes but that's pretty much it. Back to scatterer I guess.

If anyone wants to try it: http://www.filedropper.com/skytonemapping

Source is included inside, license is do whatever you want.

Link to comment
Share on other sites

Eh, it's not too bad I guess but it's nothing amazing.

Before:

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

After:

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

Before:

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

After:

http://i.imgur.com/9JoNLNp.jpg

Seems to remove the banding and make the colors generally easier on the eyes but that's pretty much it. Back to scatterer I guess.

If anyone wants to try it: http://www.filedropper.com/skytonemapping

Source is included inside, license is do whatever you want.

Best license ever :D - Is this possible on other planets as well?

Link to comment
Share on other sites

Quick question: Is it legal if I extract kerbin's texture, do small modifications on it (mainly colors) and then re-distribute it with the mod?

Kerbins map is a flipped version of a royalty-free image (this one) and, given the popularity of planet texture packs (Mainly with UR, not TR, but 1, 2, 3, 4, 5, 6, 7 etc)... you'll be fine.

(links provided by Glyphs list of texture packs)

Edited by ObsessedWithKSP
Link to comment
Share on other sites

Quick question: Is it legal if I extract kerbin's texture, do small modifications on it (mainly colors) and then re-distribute it with the mod?

If you want you could use this version of kerbin. That album is outdated and the planets aren't shiny anymore. The planets are from endraxial's planet pack (An ancient mod which has been around about equal time to my resumed stay on the forums). He/she has since left the community though and left the upkeep of the pack to me. Feel free to use it as you wish.

Link to comment
Share on other sites

Quick question: Is it legal if I extract kerbin's texture, do small modifications on it (mainly colors) and then re-distribute it with the mod?

Yes, we (modder community collectively) have been doing that with Squad's textures since forever.

Link to comment
Share on other sites

Today I had the idea to look inside the space engine shaders for research purposes (which are conveniently shipped uncompiled in a .zip file renamed as .pak) and lo and behold, actual code from proland is in there: http://imgur.com/BIvueaP

This seems weird to me, I know space engine looks awesome but it also looks quite different from proland, mainly the sunsets aren't getting any special effects. I wonder if this is still used, and space engine computes parameters for generated planets on the fly or if these are remanants from some older version.

Anyway, I'll see what I can learn from this, what seems like a good idea for me right now is making a sunflare shader like the one space engine uses, I just think it's both beautiful and not too annoying http://i.imgur.com/HKrXfMX.png

There also seems to be an eclipse shader in there (and you know SE eclipses are beautiful http://img94.imageshack.us/img94/2482/kersolareclipse.jpg http://voksenlia.net/spaceengine/eclipse.jpg ), probably I won't be able to derive anything from it but we'll see.

Kerbins map is a flipped version of a royalty-free image (this one) and, given the popularity of planet texture packs (Mainly with UR, not TR, but 1, 2, 3, 4, 5, 6, 7 etc)... you'll be fine.

(links provided by Glyphs list of texture packs)

If you want you could use this version of kerbin. That album is outdated and the planets aren't shiny anymore. The planets are from endraxial's planet pack (An ancient mod which has been around about equal time to my resumed stay on the forums). He/she has since left the community though and left the upkeep of the pack to me. Feel free to use it as you wish.
Yes, we (modder community collectively) have been doing that with Squad's textures since forever.

Thanks everyone, I will probably use the texture Avera9eJoe provided for now. I know proot has an awesome 8k texture in the works but I wouldn't want to ruin the full effect of his upcoming KSPRC pack before he releases it officially :P

Edited by blackrack
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...