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

5 minutes ago, blackrack said:

Who can guess what's going on here?

[...]

 

Looks like some inverted / incorrectly calculated normals.... and something else.  Perhaps an incorrect normalization of the normals in the shader?

From the looks of it I would also guess that you are trying to work on figuring out the shadows for the planetary rings, perhaps using the visible output of the shader as debugging for the ring-planet occlusion data.

Link to comment
Share on other sites

17 minutes ago, Shadowmage said:

Looks like some inverted / incorrectly calculated normals.... and something else.  Perhaps an incorrect normalization of the normals in the shader?

From the looks of it I would also guess that you are trying to work on figuring out the shadows for the planetary rings, perhaps using the visible output of the shader as debugging for the ring-planet occlusion data.

Close on the second line, trying to figure out shadows. What you're seeing on the planet is the UV coordinates (technically only one coordinate needed for the ring texture) of the point on the ring that that is casting the shadow on the planet, completely black areas on the planet are areas not receiving any ring shadows.

Map black to the right of say, a ring texture like this and white to the left, then take (1-alpha) and it should be good.

All that's left is to do a texture fetch, however it seems I can't grab the ring texture directly from the ring material itself. Getting a grey texture instead so might have to use C# reflection again. Will post more pics when I make more progress.

Edited by blackrack
Link to comment
Share on other sites

If the camera is on the backside of the rings relative to the sun (as I'm picturing it in order for the rings to cast that "white shadow" on the planet) wouldn't the rings be much harder to see, as we would be seeing the unlit side of all the objects in them? I thought I saw ring shader images in this thread once that showed this type of behavior.

Link to comment
Share on other sites

10 minutes ago, Errol said:

If the camera is on the backside of the rings relative to the sun (as I'm picturing it in order for the rings to cast that "white shadow" on the planet) wouldn't the rings be much harder to see, as we would be seeing the unlit side of all the objects in them? I thought I saw ring shader images in this thread once that showed this type of behavior.

I'm assuming the rings are not completely matte/opaque and instead made of small particles and/or ice. Therefore I added a bit of mie scattering when seen from the back and took some liberties with the shading relative to the light source. Will still adjust it later if it feels wrong.

Look here:

 

Edited by blackrack
Link to comment
Share on other sites

Oh man!

I'm not playing the experimental release because it is bugged for me with Galileo's SVE, but man, it will be nuts when we have all this wrapped up together! I play with axial tilt RSS style as well, so eclipses are far more rare. Pretty much the only thing I can think of that isn't in the game yet in some way is seasons for kerbin.  

Link to comment
Share on other sites

Just got ring shadows working, here is a quick image dump using saturn from @Galileo's SSRSS. Sorry for bad compression

 

KBEoIBt.jpg

EEG9EY9.jpg

p1Ubptu.jpg

EIZ0tNU.jpg

jADgyx4.jpg

vwZM1Dn.jpg

ZoG6pv3.jpg

jVa3bW1.jpg

 

The rings and the shadows are a bit aliased and a bit rough but I suspect mipmapping or manually doing something similar should fix it. Shadows are also a bit weak, may need to boost them a bit instead of just using the ring texture alpha value.

Also, I still need to fade the rings into fine particles/noise when zooming in on them.

Edited by blackrack
Link to comment
Share on other sites

2 hours ago, Li0n said:

Those last pics looks really amazing :confused:

I realize this "shadow rings" are still WIP but do they have a lot of impact on performance ?

They shouldn't, literally just a plane-ray intersection calculation and a texture fetch. But as always, it depends on your hardware. Should have about as much impact as the eclipses.

Edited by blackrack
Link to comment
Share on other sites

1 minute ago, blackrack said:

No they shouldn't, literally just a plane-ray intersection calculation and a texture fetch. But as always, it depends on your hardware. Should have about as much impact as the eclipses.

Now this is (amazing)² :)

Link to comment
Share on other sites

18 hours ago, Errol said:

Pretty much the only thing I can think of that isn't in the game yet in some way is seasons for kerbin.  

Yeah seasons might be a bit more complicated...

However I would like to know what kind of other shaders you guys would like to see in the game, eg other shaders for Kopernicus or stuff like that.

Link to comment
Share on other sites

10 minutes ago, blackrack said:

Yeah seasons might be a bit more complicated...

However I would like to know what kind of other shaders you guys would like to see in the game, eg other shaders for Kopernicus or stuff like that.

DOF would be the most noticeable and appreciated.. but it also probably comes with a big performance hit :(

Edited by Galileo
Link to comment
Share on other sites

DoF effects in games are usually quite bad. I don't know much about programming and shaders, but I am a professional photographer, so I can shed some light on this.

There are actually 4 variables that affect the length of the depth of field (how many things are in focus), and even more factors that go into determining the "quality of the bokeh" or how the out of focus areas look, I'm not going to focus on that though. I just want to talk about the length of the depth of field. So here are the four factors. Focal length, focal distance, size of images sensor area and aperture, also the effects are cumulative. Generally aperture is the primary variable for controlling DoF in photography, as it usually has the most immediately and profoundly noticeable effect on DoF (a smaller aperture gives a longer depth of field; this is a while a pin hole camera does not need a lens be able to produce a focused image, it has an infinitely small aperture, so it has an infinitely long DoF, or nearly at least). Focal length is "how far in you are zoomed" (longer focal length, or zoomed in further, gives a shorter depth of field). Focal distance is the distance the subject is from the camera (again, closer to the camera, shorter depth field). Size of the image on the sensor is pretty obvious (larger sensor, shorter DoF, which is why cheaper cameras with smaller sensors are better for landscape and worse for portraiture, they have longer DoF then their larger sensor brothers).

The thing is that KSP allows us to control focal length (FoV) and focal distance (camera zoom). So even though the "aperture" of the game camera never chances, and the image size on the "sensor" also never changes, since neither of them exist, we could still have a dynamic DoF with those other controls. 

No idea if a dynamic DoF is computationally feasible, or even necessary, but hey, there's some learning for you.

EDIT: Also, my vote for new shaders for the game: I would love to see something done with sky box shading of some kind. Specifically nebulae and other large and dim space objects being blocked from view by atmosphere on the night side (and of course also blocked during the day side), while being visible from orbit. I had the idea before that it could be done with two skyboxes, one covering the other one. The stars would be in behind, with gas clouds on the layer in front. Then the gas clouds can be faded in or out depending on how deep into the atmosphere you are. This would make the night sky from the surface look more realistic, less going on and more just pinpoint stars. 

Edited by Errol
Link to comment
Share on other sites

1 hour ago, blackrack said:

Hmm, I'm surprised by the number of people who actually want DoF, usually it's the first option I disable in any game.

I hate DoF and always disable it. Humans are no technical cameras - the stars are always sharp when the eyes focus further than 3 meters. There is no reason why someone whould like this option unless he's used to view the world through the eyes of a camera ... 

So I agree with you, DoF is completly unnatural and the first thing I disable in any game.

19 hours ago, blackrack said:

The rings and the shadows are a bit aliased and a bit rough but I suspect mipmapping or manually doing something similar should fix it. Shadows are also a bit weak, may need to boost them a bit instead of just using the ring texture alpha value.

Also, I still need to fade the rings into fine particles/noise when zooming in on them.

I think the images afre more than perfect - at least to me, I find them comppletly natural and they look like the Cassini images (org image from NASA):

7504_PIA21046_MAIN.jpg

Link to comment
Share on other sites

2 minutes ago, Tekener said:

I hate DoF and always disable it. Humans are no technical cameras - the stars are always sharp when the eyes focus further than 3 meters. There is no reason why someone whould like this option unless he's used to view the world through the eyes of a camera ... 

So I agree with you, DoF is completly unnatural and the first thing I disable in any game.

I agree with you, it's completely unnatural and I personally hate it. But you know what? Many people like their games to have a "cinematic" feel,like they're watching a movie. Just look at ENB presets for Skyrim on the Nexus...

Link to comment
Share on other sites

@TekenerI disagree, what you said only applies to being in deep space. What about those of us that are base building? Or doing submarines? Or flying atmospheric with multiple crafts simultaneously? The point is, it would be a very useful effect, especially for anyone doing youtube. This game has lots to look at and blur out into bokeh besides stars.

Link to comment
Share on other sites

Everything is always capable of be disabled with scatterer.  Why wouldn't dof? Those who want it,  keep it on.  If you don't want it,  disable it. I'm only assuming of course that it's toggle-able

Edited by Galileo
Link to comment
Share on other sites

Loving the ring shaders but as far as more visual work goes, I would prefer for the Module Manager config compatibility to be properly nailed down before moving forward with additional features.

Currently, if you remove all the Scatterer stock configs and textures and try to introduce a config for a body with the config files located outside of the Scatterer directory, it all falls down as for some reason it tries to default the config location path to the Duna folder in the Scatterer directory... which seems very weird.

To reproduce I install Scatterer on a vanilla build, delete the GameData/scatterer/config directory and then create a planetsList style config and an atmo config (with textures) for any body in GameData/*Test* directory. 

I know it might sound like I'm beating a dead horse here but its a real issue when trying to promote positive compatibility between visual packs without encroaching on Scatterer's main directory; but thats just me and I appreciate that it doesn't add a shiny new feature so its not a popular request.

Link to comment
Share on other sites

Hi,

Thank you for your awesome mod, 

however i have some issue and i don't found the solution, with scatterer installed i have a black sky on kerbin and when i open the map view kerbin is totally pink. 

I have the "console" of scatterer but it don't seems to work in game. 

i sought on google with keyword "black sky" or "pink kerbin" but i have not found anything, only one topic about black sky but the problem was different of mine. 

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