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

Fair enough, I understand now why this is not so simple. Thanks to the three of you for your answers.

Just a random though about the up and down for the sea. Is it possible to create an invisible object that will collide with the current ship ? Something small enough used only to push up a bit the current vessel ? And link it's coordinate with the higher wave below ? (Or the coordinate of what we see as a wave and is just an equation's representation without physical existence)

I think I will start to investigate on my own and try some stuff with unity (long road but, well, at least I won't bother anyone with stupid question like this one :D )

Edit : It seems that I'm again totally off subject : This seems to be a cleaner solution, just moving the object

Edited by Minarkhaios
Link to comment
Share on other sites

Fair enough, I understand now why this is not so simple. Thanks to the three of you for your answers.

Just a random though about the up and down for the sea. Is it possible to create an invisible object that will collide with the current ship ? Something small enough used only to push up a bit the current vessel ? And link it's coordinate with the higher wave below ? (Or the coordinate of what we see as a wave and is just an equation's representation without physical existence)

I think I will start to investigate on my own and try some stuff with unity (long road but, well, at least I won't bother anyone with stupid question like this one :D )

Edit : It seems that I'm again totally off subject : This seems to be a cleaner solution, just moving the object

Keep in mind that that object is contained entirely in the shader, to do something similar in KSP you'd have to either get the wave height and position information out of the shader (I think this isn't feasible or really tricky, maybe rbray could shine some light on this), or do all of the wave calculations outside of the shader so you have all the required data in your program to move the object up or down.

This could be feasible with the proland water shaders, I haven't looked much into it but the guy who ported proland to unity did something similar in one of his projects but it was dx11-only.

You can read about it here if you want http://scrawkblog.com/2013/06/04/ocean-with-brdf-lighting-in-unity/ scroll to the end for the waves thing.

Edited by blackrack
Link to comment
Share on other sites

Keep in mind that that object is contained entirely in the shader, to do something similar in KSP you'd have to either get the wave height and position information out of the shader (I think this isn't feasible or really tricky, maybe rbray could shine some light on this), or do all of the wave calculations outside of the shader so you have all the required data in your program to move the object up or down.

This could be feasible with the proland water shaders, I haven't looked much into it but the guy who ported proland to unity did something similar in one of his projects but it was dx11-only.

You could use compute shaders (or do something to a render/texture, and read from that). Those are the only real way to get stuff out of a shader. Might be easier to use the same computational method used in the shader for a single point (ship origin) to do the moving. Hehe, you might even be able to replace the shaders for the craft pards with one that relocates the vertices when within 'X' distance of the ocean :)

Link to comment
Share on other sites

This sounds really clever, but could this really work?

I see why not... You would want to pass in a vector to the shader every cycle, though all parts would get the same movement, regardless if attached to the same craft or not, so debris might look odd. You'd also want to do this to Kerbal shaders. Note that I mean to fully replace the shader, not use replacement shaders :) It would just be REALLY annoying to do this, as the shaders are all closed-source.

Link to comment
Share on other sites

Hehe, you might even be able to replace the shaders for the craft pards with one that relocates the vertices when within 'X' distance of the ocean :)

Would that alleviate extra lag too? I'm concerned about my FPS when looking at those waves. I'd install regardless of an impact haha. Too beautiful...

EDIT: Say you wouldn't have a need for a 'tester' would you Blackrack?

Link to comment
Share on other sites

I see why not... You would want to pass in a vector to the shader every cycle, though all parts would get the same movement, regardless if attached to the same craft or not, so debris might look odd. You'd also want to do this to Kerbal shaders. Note that I mean to fully replace the shader, not use replacement shaders :) It would just be REALLY annoying to do this, as the shaders are all closed-source.

Wouldn't it be easier to apply a small force to each part based on the same data ? something similar to the lifting bodies found in ferram mod ? (Or am I again understanding something wrong ?)

Link to comment
Share on other sites

Would that alleviate extra lag too? I'm concerned about my FPS when looking at those waves. I'd install regardless of an impact haha. Too beautiful...

EDIT: Say you wouldn't have a need for a 'tester' would you Blackrack?

What kind of GPU do you have? From my testing I'd say as long as you have a gtx 460 or better you shouldn't be getting any slowdowns from the water. Also, keep in mind the water is still broken in a really bad way and I'll just post it for everyone to test as soon as it works better. I've also started working on full EVE compatibility yesterday.

Edited by blackrack
Link to comment
Share on other sites

Update: 20-05-2015 - v0.0151 Pink objects quickfix (Please stop reporting this bug)

Could you please clarify the above statement in post #1? Does this mean this update fixes the bug, so stop reporting issues with older versions? Or, this fixes what you can right now and they have to live with the pink objects, if they still have them with this version?

Link to comment
Share on other sites

Could you please clarify the above statement in post #1? Does this mean this update fixes the bug, so stop reporting issues with older versions? Or, this fixes what you can right now and they have to live with the pink objects, if they still have them with this version?

This update fixes the bug, except for the pink box in the loading screen but that doesn't hurt the game.

Link to comment
Share on other sites

I've had that appear when I revert to launch only. OpenGL too.
Yup, that's how I produced them for the screenshot. Didn't notice if that's the only way, but you are probably correct, as I'm always doing simulated launches and revert. Edited by bgeery
Link to comment
Share on other sites

You could use compute shaders (or do something to a render/texture, and read from that).

With Unity 5.1 moving to unify the use of compute shader for DX11 and OpenGL that could be a solution at long term.

Link to comment
Share on other sites

Huh, 'cause I still have 'em. :( I'm special like that. OpenGL, GTX970

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

Yeah sorry, It removes the pink textures on gameobjects but some people do report a messed-up UI on OpenGL. What you could try is download the 0.014 version (go to the kerbalstuff link in the OP, click changelog and download 0.014) and copy the replacement shaders folder from 0.014 and drop it in your current version.

Link to comment
Share on other sites

That reflection works at high distances/map view? It's configurable?

The effect is close to perfection, but IMHO the reflection should be a bit wider.

One detail, Blackrack: would be possible to add a bit of blur at the horizon line to avoid that tiny line that cuts terrain and sky? Would be the perfect touch.

And one more thing... what you want before?:

to add the water shader or the multiplanet support? Would be perfect have an intermediate version, to experiment a bit more with the atmos before add oceans to the equation. I've created my first set of atmos in a friend's computer, but I still have some round patch artifacts at certain points (much, much less than before, anyway). But once you modify the altitude/density of the stock atmo, seems a bit hard to get a completely smooth result. Is there any tip/trick to get the perfect smooth?

Link to comment
Share on other sites

That reflection works at high distances/map view? It's configurable?

The effect is close to perfection, but IMHO the reflection should be a bit wider.

One detail, Blackrack: would be possible to add a bit of blur at the horizon line to avoid that tiny line that cuts terrain and sky? Would be the perfect touch.

And one more thing... what you want before?:

to add the water shader or the multiplanet support? Would be perfect have an intermediate version, to experiment a bit more with the atmos before add oceans to the equation. I've created my first set of atmos in a friend's computer, but I still have some round patch artifacts at certain points (much, much less than before, anyway). But once you modify the altitude/density of the stock atmo, seems a bit hard to get a completely smooth result. Is there any tip/trick to get the perfect smooth?

Once you get past a certain distance the effect is just this water color and reflection http://i.imgur.com/U7oD7Uh.jpg, no more waves are generated, this could be easily made to work at a high distance or in scaled space, in fact, this is what proland does to improve performance, once past a certain distance the water is disabled and the water color and sun reflection are rendered directly in the terrain shader.

I did some progress on the water shader but there is still a huge issue I haven't figured out and so I might take another break from it and do something else first. I've already started working on full EVE compatibility but haven't had that much free time to put into it yet. I've actually been putting off multiple planets because it's a bit of a "chore" to do and I wanted to do the fun stuff first, there's also that reflectedlight thing that should get rid of soupiness from orbit. To summarize I'll probably have full EVE compatibility ready this week-end or somewhere in the middle of next week and after that it's either fixing the water or adding multiple planets.

You're right about the blur at the horizon, I always see it happening in real-life and can never tell where the sea ends and the sky begins, especially if I'm looking at it from a mountain. I can see this being feasible in the postprocessing shader.

To get smooth results I always make sure to multiply the default Rt and RL values by the same coefficient, I basically don't change their ratios, and then I play with HR until it looks right, HM is more forgiving but generally gives a really cloudy/heavy atmosphere feel. Because the atmospheric model used in proland requires physical correctness, artistic control can be really limited but keeping the default ratios of Rt and RL generally results in good results, this is how I do it anyway.

Also, if you're getting the round patches past 200km, ignore these, these are caused by my "experimental" idea of changing the camera's clipping planes once they reach their limit and the way I do it right now is really messy, it doesn't mean your atmosphere isn't right and it'll probably work fine in future versions.

Edited by blackrack
Link to comment
Share on other sites

Could a script be set up to gently rock the capsule/boat/whatever when smashed down?

Could you add better splashes?

Cloud you add better sounds, and get rid of the loud-and-ugly-sounding "WHUMP" when you hit the water?

Could you add some nice noises of water lapping against the side of the craft?

Wonderful job on the water. It's coming along nice.

SmallFatFetus

Edited by SmallFatFetus
Link to comment
Share on other sites

Could a script be set up to gently rock the capsule/boat/whatever when smashed down?

Could you add better splashes?

Cloud you add better sounds, and get rid of the loud-and-ugly-sounding "WHUMP" when you hit the water?

Could you add some nice noises of water lapping against the side of the craft?

Wonderful job on the water. It's coming along nice.

SmallFatFetus

Pizzaoverhead (Your go-to sound guy) has a mod for that last one, but I think that the scope of this mod is just visual effects.

It doesn't actually sound too hard to make a small torque in the water that rocks your vessel back and forth when it's "Splashed Down", but I have no coding experience. I don't think it would add too much to your experience, though, and it does sound near-impossible to make it sync up with the waves.

The water sounds mod is here.

Edited by RyanRising
More specific. DISCLAIMER: It doesn't sound too hard, but it might be very, very difficult. I can't tell.
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...