Chunks fade in

Chunks fade in

2M Downloads

Fade doesn't apply to cached (?) chunks

sisby-folk opened this issue · 12 comments

commented

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.

commented

That's very strange, I'll try do debug more to find the source of issue

commented

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.

commented

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

commented

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
commented

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.

commented

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 :(

commented

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.

commented

This also an issue with Distant Horizons, but that would be difficult to be compatible with since (I think) it uses a custom renderer.

commented

I can reproduce this issue, both with cached chunks and Distant Horizons chunks.

commented

Have you made any progress with this @kerudion?

commented

Not really, now I'm just looking at Sodium and Minecraft code and trying to find something useful for that issue

commented

I've changed how fade values are stored in new 1.20.1 version and this issue disappeared. Also I'll port these changes to 1.20, 1.19.x and 1.18.x versions, so I hope that it'll be fixed once and for all.