
Fade doesn't apply to cached (?) chunks
sisby-folk opened this issue · 12 comments
Hey there! Really enjoying the mod so far, we've been looking for a modern chunk fade mod for ages! ^^
I think I've found an issue with the way the mod interacts with chunks that have only recently been unloaded (I'm assuming they're cached)
It seems like the fadeCoeff is already 1 for these chunks, and there's nothing setting it back to 0 when they stop being rendered - so they appear without fading.
Here's a video of me (zoomed in) backtracking over chunks I just visited.
javaw_OC9zijnSwX.mp4
If my assumptions here are right, it sounds like there just needs to be some way to reset the fadeCoeff when the chunk stops being rendered.
If you can't reproduce anything, let me know and I'll bisect for incompatibilities.
It's problem in RenderRegion.removeChunk method, it's called but RenderRegion.arenas is null, however the RenderRegionArenas.delete wasn't called. I don't know is this a bug in sodium or not.
Hi! Probably that's because that RenderRegion wasn't fully unloaded, so my mod haven't reset fadeCoeff for chunks which were in that RenderRegion. I think I can fix this by injecting reset logic to RenderRegion.removeChunk() method
Seems to be partially fixed, but still possible to reproduce chunks appearing without fadein in some cases
(nb: after the delta-t and iris changes, the mod is working really well, definitely tossing it in our next modpack update)
javaw_dR6j01qvI2.mp4
Yeah, maybe I can find that piece of code that decides what chunks to render and mixin into it if possible. If it's not possible to mixin into it, probably I can copy that code and perform these checks myself.
But today I'll try to implement chunk animations and work on this issue afterwards.
Fade doesn't reset these chunks, because they aren't removed, only not rendered. I tried resetting non-rendered chunks, but this also resets fade for chunks behind you. I can't fix it now :(
hmm, I assume it'd be too hacky/unviable of a workaround to check the clients position and render distance relative to the chunk when it starts being rendered again?
Beyond that, I guess you'd need something exposed within sodium itself to know whether something is being rendered again due to camera movement or player movement - if that code is separate enough, you might be able to mix in to it, but I'm not sure.
This also an issue with Distant Horizons, but that would be difficult to be compatible with since (I think) it uses a custom renderer.
Have you made any progress with this @kerudion?
Not really, now I'm just looking at Sodium and Minecraft code and trying to find something useful for that issue