shadowmage45 / TUFX

Textures Unlimited Special Effects
Other
23 stars 9 forks source link

Add atmospheric scattering effect #17

Open shadowmage45 opened 4 years ago

shadowmage45 commented 4 years ago

Will be based on Bruneton's Improved Scattering.

KSP Implementation TODO:

Known Issues & TODO (Shader and Effect Implementations):

Will also be investigating the inclusion of some built-in basic atmospheric scattering effects (very simple stuff). https://forum.unity.com/threads/vapor-volumetric-scattering-open-source.500634/ https://github.com/Scrawk/Brunetons-Improved-Atmospheric-Scattering https://github.com/Scrawk/Brunetons-Atmospheric-Scatter https://www.alanzucconi.com/2017/10/10/atmospheric-scattering-1/ https://davidson16807.github.io/tectonics.js//2019/03/24/fast-atmospheric-scattering.html https://www.alanzucconi.com/2019/09/13/believable-caustics-reflections/ https://github.com/GuitarBro/VolumeCloud/tree/StackV2 https://github.com/yangrc1234/VolumeCloud https://github.com/yangrc1234/AtmosphereScatter https://gamedev.stackexchange.com/questions/131978/shader-reconstructing-position-from-depth-in-vr-through-projection-matrix/140924#140924 https://forum.unity.com/threads/world-space-position-in-a-post-processing-shader.114392/ https://answers.unity.com/questions/1584649/how-do-you-port-old-shaders-to-hlsl-so-they-work-w.html https://forum.unity.com/threads/screen-space-multiple-scattering.446647/page-3#post-3316350 fix for world-space recomposition from fulscreen triangle bullshit https://grrava.blogspot.com/2018/08/more-foggy-adventures.html https://michaldrobot.com/2014/04/01/gcn-execution-patterns-in-full-screen-passes/ https://github.com/SlightlyMad/VolumetricLights -- volumetric shadows (light shadow map grab with command buffer IMPORTANT) https://catlikecoding.com/unity/tutorials/rendering/part-7/ -- shadow rendering https://www.shadertoy.com/view/ldSGzR -- screen-space bump mapping https://medium.com/@shahriyarshahrabi/custom-shadow-mapping-in-unity-c42a81e1bbf8 https://github.com/IRCSS/UnityRaymarching

shadowmage45 commented 4 years ago

Banding on horizon on occluding object is present in the reference/demo scene: image

Though, notably, not nearly as bad (likely due to the very small size of the sphere, compared to the enormous mountains and geometry I use for testing)...


Much of the banding appears to actually be caused by some of the 'shading' effects, and appears fairly appropriate in some setups: image


What is not known, however, is what causes the partial-transparency of the obstructing objects at some view angles and camera heights: image image


Or the issues with the fully-lit scene: image

Note the random 'pop-out' pixels on the band along the horizon. image

jrodrigv commented 4 years ago

Oh yeah. I don't have words...this is amazing. @shadowmage45 Do you have any PayPal or patreon account? I'd like to buy you a coffee or two :)

shadowmage45 commented 4 years ago

Thanks for the support and appreciation. Not sure that anything functional or usable will come out of all of this, mostly working on it for... fun? I guess; something 'new' to do, and some new horizons to explore. Likely will make it into the game at some point, but no promises, either towards the timing or if it will ever be included.

Donation button can be found at the bottom of the SSTU page, if interested ( https://forum.kerbalspaceprogram.com/index.php?/topic/117090-wip18x-sstulabs-low-part-count-solutions-orbiters-landers-lifters-dev-thread-11-18-18/ ). Back when I was doing Minecraft modding I looked into Patreon a bit, but wasn't too fond of their model (too much like a real job...).

Of course, with all that said, I love coffee :)