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

  On 4/7/2016 at 4:43 PM, blackrack said:

Great, btw this image http://i.imgur.com/S8t9AxB.jpg makes me think that we could come up with some kind of fake "light scattering inside the clouds" effect, I've seen a paper on the subject, I will have to dig it up.

Expand  

Maybe a use for Command buffers? XD

EDIT: Actually, yeah... render a light sphere for each cloud into a render texture to use as a light map. Then pass that into the shader for the particles.

Edited by rbray89
Link to comment
Share on other sites

  On 4/7/2016 at 5:18 PM, rbray89 said:

Maybe a use for Command buffers? XD

EDIT: Actually, yeah... render a light sphere for each cloud into a render texture to use as a light map. Then pass that into the shader for the particles.

Expand  

So I was getting some abysmal performance with the particles, what with the added scattering and the sheer number of particles, I decided to drop alpha blending, enable z-writing and z-testing and use the old discard/alpha-testing method to see if it would help with performance.

Instead I got these cartoony clouds:

 

And the funny thing is, even the way they move is cartoony.

 

Edited: if anyone wants to try it https://www.reddit.com/r/KerbalSpaceProgram/comments/4dsoo4/eve_clouds_fluffy_cartoon_edition/d1u1y1m

Edited by blackrack
Link to comment
Share on other sites

  On 4/7/2016 at 7:23 PM, blackrack said:

And the funny thing is, even the way they move is fitting:

 

Expand  

Hehe, that's awesome! if KSP had the flat artstyle this would be perfect for it :)
Yeah, you don't want to do hardly anything in the fragment shader there... can you do everything in the vertex shader and just use a singular point for the entire particle (similar to what I do for alpha/color)? Should be close enough.

Edited by rbray89
Link to comment
Share on other sites

  On 4/7/2016 at 7:46 PM, rbray89 said:

Hehe, that's awesome! if KSP had the flat artstyle this would be perfect for it :)
Yeah, you don't want to do hardly anything in the fragment shader there... can you do everything in the vertex shader and just use a singular point for the entire particle (similar to what I do for alpha/color)? Should be close enough.

Expand  

I will try it, that should definitely ease up on the performance.

Link to comment
Share on other sites

  On 4/7/2016 at 7:23 PM, blackrack said:

So I was getting some abysmal performance with the particles, what with the added scattering and the sheer number of particles, I decided to drop alpha blending, enable z-writing and z-testing and use the old discard/alpha-testing method to see if it would help with performance.

Instead I got these cartoony clouds:

 

And the funny thing is, even the way they move is cartoony.

 

Expand  

I don't even care how cartoony it looks, just seeing somewhat dynamic shading onto particles makes me excited AF!!

Link to comment
Share on other sites

  On 4/7/2016 at 7:46 PM, rbray89 said:

Hehe, that's awesome! if KSP had the flat artstyle this would be perfect for it :)
Yeah, you don't want to do hardly anything in the fragment shader there... can you do everything in the vertex shader and just use a singular point for the entire particle (similar to what I do for alpha/color)? Should be close enough.

Expand  

Ok this works performance-wise but I can sort of see why it would be limiting in the shading. Btw one quick question, I thought you were using a bunch of camera-facing quads but from the results I'm seeing it looks like it's acting as a singluar point (like you mentioned), what's happening exactly? Does the interpolation over a quad not happen the way I'd imagine it (ie interpolate smoothly across the surface) or am I missing something else?

And btw are the particles and their positions/distribution generated on the GPU?

Edited by blackrack
Link to comment
Share on other sites

  On 4/7/2016 at 8:18 PM, blackrack said:

Ok this works performance-wise but I can sort of see why it would be limiting in the shading. Btw one quick question, I thought you were using a bunch of camera-facing quads but from the results I'm seeing it looks like it's acting as a singluar point (like you mentioned), what's happening exactly? Does the interpolation over a quad not happen the way I'd imagine it (ie interpolate smoothly across the surface) or am I missing something else?

And btw are the particles and their positions/distribution generated on the GPU?

Expand  

Ah, yeah... so the quad vertexes are moved to face the camera in the shader. The particle is moved, sized, and rotated from via the perlin noise generator. Three textures are used in such a way that they appear as three separate sides.

Link to comment
Share on other sites

  On 4/7/2016 at 8:37 PM, rbray89 said:

Ah, yeah... so the quad vertexes are moved to face the camera in the shader. The particle is moved, sized, and rotated from via the perlin noise generator. Three textures are used in such a way that they appear as three separate sides.

Expand  

I see. Btw I found that paper, http://www.markmark.net/PDFs/RTCloudsForGames_HarrisGDC2002.pdf haven't read it yet so not sure if it's any good and though it's more than a decade old the images they include look good so it might be cool.

It comes with demos and source-code http://www.markmark.net/SkyWorks/ both are missing but the waybackMachine has them archived https://web.archive.org/web/20060209071205/http://www.markmark.net/SkyWorks/

Edited by blackrack
Link to comment
Share on other sites

I don't know if this was brought up before, but is it possible to add global lighting for planet reflections at night time? Like Planetshine, but for the surface, at night, with brightly lit planet/moon above? Also, is it possible to change the brightness level for planets in the sky at night? For example, in this screen shot, Jool should probably be as bright as it is from space.

 

3F7bIK2.jpg 

Link to comment
Share on other sites

  On 4/8/2016 at 1:22 PM, SketchBot said:

Happens to me all the time. I only have kerbal engineer and scatterer. I don't have a graphics card though (running the igp). Might that cause the issue?

Expand  

I tested with an igp and didn't have that issue so I'm inclined to say no.

 

  On 4/8/2016 at 12:41 AM, quantumpion said:

I don't know if this was brought up before, but is it possible to add global lighting for planet reflections at night time? Like Planetshine, but for the surface, at night, with brightly lit planet/moon above? Also, is it possible to change the brightness level for planets in the sky at night? For example, in this screen shot, Jool should probably be as bright as it is from space. 

Expand  

Not possible at the moment unless you set the extinction to zero. Adaptive/dynamic exposure might be added at some point though.

For planetshine it's a planned feature and I already worked on it a bit but won't be back to it for a while, see here:

http://forum.kerbalspaceprogram.com/index.php?/topic/103963-wip11-scatterer-atmospheric-scattering-v00242-05042016-11-compatible-faster-loading/&do=findComment&comment=2364508

http://forum.kerbalspaceprogram.com/index.php?/topic/103963-wip11-scatterer-atmospheric-scattering-v00242-05042016-11-compatible-faster-loading/&do=findComment&comment=2364554

http://forum.kerbalspaceprogram.com/index.php?/topic/103963-wip11-scatterer-atmospheric-scattering-v00242-05042016-11-compatible-faster-loading/&do=findComment&comment=2402734

Link to comment
Share on other sites

  On 2/21/2016 at 3:02 AM, blackrack said:

Don't really know how to fix that one.

That would be asking too much.

Expand  

Thanks for the reply, since then the problem disappeared. I had to reinstall my windows, and I installed the newest Crimson drivers. And I haven't seen the issue appear since. But that was before the 1.1 prerelease. There's no problem with this, other than the black "lines" on the horizon. But that's not bad at all.

But thank you very much for your reply. I appreciate it.

Link to comment
Share on other sites

  On 4/8/2016 at 5:26 PM, Imasundaj said:

Thanks for the reply, since then the problem disappeared. I had to reinstall my windows, and I installed the newest Crimson drivers. And I haven't seen the issue appear since. But that was before the 1.1 prerelease. There's no problem with this, other than the black "lines" on the horizon. But that's not bad at all.

But thank you very much for your reply. I appreciate it.

Expand  

I fixed the black horizon line a day or two ago:  https://mega.nz/#!iUJiBQTQ!4bYUYDj_vFb8t-H_8WWxMSnU9BAkjI6q74aTj2bX6ak

 

  On 4/8/2016 at 3:00 PM, sebastien1214 said:

Hello, where can we found the add-on for the v1.0.5 of KSP ?

Expand  

In the OP or press "changelog" on spacedock.

Edited by blackrack
Link to comment
Share on other sites

  On 4/8/2016 at 11:31 PM, Svm420 said:

Whats wrong with this one ThomasP already made? Just curious why Blackrack needs to reinvent the wheel so to speak.

Expand  

Blackracks flare is different, Unlike the default flare system that Thomas made, The flares in blackracks system scale properly and get smaller and smaller with distance, Plus the flare is stored in PNG format, making it easier to edit.

Link to comment
Share on other sites

  On 4/8/2016 at 11:35 PM, daniel l. said:

Blackracks flare is different, Unlike the default flare system that Thomas made, The flares in blackracks system scale properly and get smaller and smaller with distance, Plus the flare is stored in PNG format, making it easier to edit.

Expand  

I can't agree.
I love the possibilities with Blackrack's flare and I'm using it right now, but still needs to be tweaked a bit more (no hurry btw, is not urgent): the ghost remains always at the same size and the flare glows over the sun's surface in close-ups (which is 100% realistic for a regular camera or the human eye, but in that way you can't enjoy that taste to the cinematic suns or the telescopic images -like in stock, where you can see the surface of the sun-).

 

 

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