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

4 hours ago, DrPastah said:

How do I optimize terrain shadows? I think that's the issue as my FPS goes up when I'm high above Kerbin. I don't understand the settings.

The only setting affecting shadow performance is in the game settings under "shadow quality" and "shadow cascades". The settings in scatterer are for fixing artifacts.

You can do what Agustin said, that's it really, other settings don't affect performance.

Link to comment
Share on other sites

Hello everyone,

if the current "Draw atmo on top of EVE clouds(old cloud shading, use with EVE 7-4)" was removed to allow for improvements to the scaled space shaders and a more coherent look throughout (only the new EVE integration would be left) as well as fixes to atmosphere draw orders and to streamline development, would this be an issue?

Link to comment
Share on other sites

4 hours ago, blackrack said:

Hello everyone,

if the current "Draw atmo on top of EVE clouds(old cloud shading, use with EVE 7-4)" was removed to allow for improvements to the scaled space shaders and a more coherent look throughout (only the new EVE integration would be left) as well as fixes to atmosphere draw orders and to streamline development, would this be an issue?

Nope, I’m all for progression. Having to continue to develop for an older plugin will just continue to slow development. 

Edited by Galileo
Link to comment
Share on other sites

@blackrack is there anyway you can make the map view match the configPoint with the highest altitude by default instead of us having to try an match it up manually? I hate getting a body to look good, but then I forget to adjust the map view and have to spend more time on that.

Edited by Galileo
Link to comment
Share on other sites

7 minutes ago, Galileo said:

@blackrack is there anyway you can make the map view match the configPoint instead by default instead of us having to try an match it up manually? I hate getting a body to look good, but then I forget to adjust the map view and have to spend more time on that.

I can add a "copy settings from top node" button I guess, just make sure to remind me If I forget :P

Link to comment
Share on other sites

2 hours ago, blackrack said:

Hello everyone,

if the current "Draw atmo on top of EVE clouds(old cloud shading, use with EVE 7-4)" was removed to allow for improvements to the scaled space shaders and a more coherent look throughout (only the new EVE integration would be left) as well as fixes to atmosphere draw orders and to streamline development, would this be an issue?

Absolutely not an issue. EVE 7-4 should not be used, its archaic and if its holding back potential development of this plugin then that is pretty sad to be honest.

Link to comment
Share on other sites

22 hours ago, Galileo said:

@blackrack is there anyway you can make the map view match the configPoint with the highest altitude by default instead of us having to try an match it up manually? I hate getting a body to look good, but then I forget to adjust the map view and have to spend more time on that.

what is that?

Link to comment
Share on other sites

On 11/27/2017 at 12:38 PM, blackrack said:

scaled space shaders and a more coherent look throughout (only the new EVE integration would be left) as well as fixes to atmosphere draw orders and to streamline development, would this be an issue?

While I have absolutely nothing against dropping of legacy EVE support (yay for progress) -- I'm curious if the changes to the Scatterer shaders will have any impact on the ability to capture the visuals in standard cameras (e.g. TextureReplacer / TexturesUnlimited)?

Currently I'm able to capture the standard (non-scaled space) atmosphere scattering properly during cubemap creation (e.g. while on the surface/in the atmo) -- but the scaled space scatter appears to be done as a post-process effect rather than as a rendered mesh (e.g. no atmosphere/scattering in reflections when on-orbit).  Is this still the case / changing at all?

(On that note, I would love for there to be a method to properly capture the post-process effects (ocean/scaled-space scatter) in cubemap reflection cameras; could possibly put together a PR if there was interest in such a feature/support)

 

Link to comment
Share on other sites

6 hours ago, Shadowmage said:

(On that note, I would love for there to be a method to properly capture the post-process effects (ocean/scaled-space scatter) in cubemap reflection cameras; could possibly put together a PR if there was interest in such a feature/support)

The RPM / MAS cameras show visual errors with scatterer / EVE currently.  I've blindly poked at the problem with a sharp stick several times, but it keeps resurfacing.  If this PR was general enough to work for non-cubemap-reflection cameras, I would be extremely happy.

Link to comment
Share on other sites

15 minutes ago, MOARdV said:

The RPM / MAS cameras show visual errors with scatterer / EVE currently.  I've blindly poked at the problem with a sharp stick several times, but it keeps resurfacing.  If this PR was general enough to work for non-cubemap-reflection cameras, I would be extremely happy.

Well, currently if you give your camera the same name as the Texture Replacer camera -- it will should remove the visual artifacts ( name:  TRReflectionCamera  ).  This is some code built-into Scatterer that disables the post-processing anytime a camera with that specific name is doing any rendering, and it works great so far from my interactions with it.

But it does this by disabling post processing for those cameras -- which, by its nature, precludes any potential to use the effects from that post-processing (god-ray-shadows, ocean surfaces, probably more I haven't poked at).

If I've read the Scatterer code correctly -- it might be possible to properly setup the post-processing effects so that they are applied to the cubemap/other cameras properly.  I say -might-, because I'm not sure how resource/computation the setup is for the different camera location/perspectives/frustum setups.  Potentially it could be 'as simple' as pushing a camera location, orientation and near/far clip data into the post-processing setup.

Link to comment
Share on other sites

1 hour ago, MOARdV said:

[...snip...] problems with EVE currently.

This is actually a second problem that I had to find a solution for -- EVE by default writes '0' into the alpha channel of anything underneath a 'cloud shadow'.  Basically you have to add a full-screen post-process filter to fix the alpha channel.  -- https://github.com/shadowmage45/TexturesUnlimited/blob/master/CustomShaders/SSTU-SetAlpha.shader -- https://github.com/shadowmage45/TexturesUnlimited/blob/master/Plugin/SSTUTools/KSPShaderTools/Addon/ReflectionManager.cs#L265 --  https://github.com/shadowmage45/TexturesUnlimited/blob/master/Plugin/SSTUTools/KSPShaderTools/Addon/ReflectionManager.cs#L756-L791

(Apologies for the semi-off-topic stuff....)

Link to comment
Share on other sites

@blackrack I've been trying to use some of JadeofMaar's lensflares for a mod that adds a number of new stars. Well what happened is that I ended up running out of RAM almost with only two stars after testing his lensflares. I'm not certain entirely what is going wrong but I did use the stock scatterer lensflares without issue.

Link to comment
Share on other sites

17 minutes ago, Tynton said:

@blackrack I've been trying to use some of JadeofMaar's lensflares for a mod that adds a number of new stars. Well what happened is that I ended up running out of RAM almost with only two stars after testing his lensflares. I'm not certain entirely what is going wrong but I did use the stock scatterer lensflares without issue.

His textures are 5k textures. That may be an issue for your system. I would bring it up with @JadeOfMaar on his thread. I would have logs ready so he can get a look at your specs

Edited by Galileo
Link to comment
Share on other sites

i have lots of these:
[EXC 18:15:14.273] NullReferenceException
    scatterer.DisableEffectsForTextureReplacer.OnPreCull ()
    UnityEngine.Camera:RenderToCubemap(RenderTexture, Int32)
    KSPShaderTools.ReflectionManager:renderCubeFace(RenderTexture, Int32, Vector3, Int32, Single, Single)
    KSPShaderTools.ReflectionManager:renderFace(RenderTexture, Int32, Vector3)
    KSPShaderTools.ReflectionManager:updateReflections(Boolean)
    KSPShaderTools.ReflectionManager:Update()

KSP.log:

https://www.dropbox.com/s/py8hy3j7hozherp/KSP LOG AGUSTIN.rar?dl=0

1A4HGFv.png

Edited by Agustin
Link to comment
Share on other sites

16 minutes ago, Agustin said:

i have lots of these:
[EXC 18:15:14.273] NullReferenceException
    scatterer.DisableEffectsForTextureReplacer.OnPreCull ()
    UnityEngine.Camera:RenderToCubemap(RenderTexture, Int32)
    KSPShaderTools.ReflectionManager:renderCubeFace(RenderTexture, Int32, Vector3, Int32, Single, Single)
    KSPShaderTools.ReflectionManager:renderFace(RenderTexture, Int32, Vector3)
    KSPShaderTools.ReflectionManager:updateReflections(Boolean)
    KSPShaderTools.ReflectionManager:Update()

KSP.log:

https://www.dropbox.com/s/py8hy3j7hozherp/KSP LOG AGUSTIN.rar?dl=0

I see that you have TextureReplacerReplaced v0.5.1.0. Try to update to the latest version (v0.5.3) and if this isn't help, then try to narrow it to the lowest number of mods to replicate this exception. I have the latest scatterer, SVE and TRR and don't have this issue.

Link to comment
Share on other sites

21 minutes ago, Galileo said:

Agustin, it may also be Texures Unlimited since it’s deals with A LOT of reflections....

Except that in this case the error is occurring from inside of Scatterer specific code, being called through standard Unity methods.

Something in the Scatterer code is not checking its references properly in that function (  scatterer.DisableEffectsForTextureReplacer.OnPreCull ()  ).  It is not a function that TU is calling, but is one of the Unity callbacks that has been built into scatterer code, which Unity calls whenever any camera renders anything (I have zero control over that function from TU end of things).  Nor is TU at any point touching anything in Scatterer ( there is no code-side interaction between the two ).

I''m more than happy to try and help track down what is going on, but it is not something that I will be able to fix.

Link to comment
Share on other sites

I updated Texture Replacer Replaced and it still happens anyway. I'll try to do some testing and come back but I have this err logs for quite some time now... Sometimes it gets worse, sometimes it doesn't... Now I am playing and the ALT+F12 windoes is full of red messages saying exception null reference.

In kspx64 folder there are these as well... This last time more than before...

NullReferenceException
  at (wrapper managed-to-native) UnityEngine.Renderer:set_enabled (bool)
  at scatterer.DisableEffectsForTextureReplacer.OnPreCull () [0x00000] in <filename unknown>:0
UnityEngine.Camera:Internal_RenderToCubemapRT(RenderTexture, Int32)
UnityEngine.Camera:RenderToCubemap(RenderTexture, Int32)
KSPShaderTools.ReflectionManager:renderCubeFace(RenderTexture, Int32, Vector3, Int32, Single, Single)
KSPShaderTools.ReflectionManager:renderFace(RenderTexture, Int32, Vector3)
KSPShaderTools.ReflectionManager:updateReflections(Boolean)
KSPShaderTools.ReflectionManager:Update()


(Filename:  Line: -1)

Edited by Agustin
Link to comment
Share on other sites

1 hour ago, maja said:

@Augustin narrow it down to least amount of mods needed to reproduce this error. It will help track down this bug.

I am trying but it's difficult. Recently I launched a rocket and everything was okay. Then I reverted to the VAB and launched again, and full of constant nullreference messages. I reverted back and launched again(exact thing I did before, seconds after launchnig) and the errors were not there anymore. Maybe I am in space and it starts to happen again with no aparent reason...

Next time it happens I will save and try to make it reproducable or something

Edited by Agustin
Link to comment
Share on other sites

@Agustin The error is not caused by TextureReplacer, but is being triggered by TexturesUnlimited; the code with the error would appear to be in the Scatterer code that disables scatterer for reflection cameras  (I say appear, as sometimes the root cause of a problem can be not what it would seem).  The solution will likely have to come on the Scatterer end of things, though I won't know more until I can setup the Scatterer repo/build environment and dig in for some testing.

(I am quite curious why I have not seen any of these problems during my debug/testing?  Are you using DX9 by chance? )

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