-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScaledSpace OnDemand Loading and Scatterer #244
Comments
Scatterer doesn't use the planet textures, but maybe on demand loading does something more, like mess with the celestialBody or the scaled transform? Edited: Actually maybe you destroy the scaled object's material? That would probably cause a nullref in scatterer, can you confirm if you do this? Would be an easy thing to fix on my side. |
@StollD have you confirmed the bug yourself? it wouldn't be the first time that people run a game with a gazillion mods, find a bug and then blame two random mods for those bugs |
Actually I haven't confirmed it, but since neither me nor blackrack were able to figure out why it could or would do that, I think it is safe to say that Kopernicus and scatterer aren't the cause of the problem. I will investigate this further as soon as I got time again (which is in one week) |
@StollD I tried to reproduce this today with Kopernicus 1.3.1-3 and scatterer and I couldn't, let me know when you have more information or still need help. |
I actually figured out what was happening yesterday. Because of something that scatterer is doing (I suspect the Post Processing mesh in front of the camera), OnBecameVisible and OnBecameInvisible aren't called on the script that Kopernicus attaches to the Scaled Space object. I solved this by calculating the on-screen position of the object and checking if it is inside of the bounds and bigger than 1px. |
It's plausible but that would also mean that the OnBecameVisible/Invisible callbacks are possibly doing something very expensive like raycasting to check for visibilty AND occlusion instead of just checking if the object is inside the camera frustum. I will try to find information on how these callbacks work but in any case good to know you have a workaround. |
So multiple persons on the Kopernicus discord told me that using ScaledSpace OnDemand-Loading messes up Scatterer. Since Kopernicus destroys the textures as soon as the planet doesn't get rendered anymore, I would assume that Scatterer tries to use the textures somewhere, when it is unloaded and therefore null. But I can't seem to figure out where it does that in the C# part of the code (I haven't looked through the shaders yet.)
@LGhassen any hints or ideas about this?
The text was updated successfully, but these errors were encountered: