embeddedt / ArchaicFix

Swiss army knife of bugfixes and performance improvements for MC 1.7.10
Other
68 stars 12 forks source link

Dynamic Lights with Phosphor backport causes past versions of blocks to flicker #57

Open kotmatross28729 opened 2 years ago

kotmatross28729 commented 2 years ago

How to reproduce: If you spill water, remove the source, then 2 options:

1: if you have optifine, you need to turn on the dynamic light and take any object that is a light source, you will see that the water will flicker when you move, although it is not there (works with any liquids)

2: very rarely, if you break, put blocks, the same thing will happen as in 1, but less noticeably and very quickly.

note: manipulations with disableBlockingChunkUpdates and enableThreadedChunkUpdates (turn on, off) don't help

makamys commented 2 years ago

Does the 1st issue only happen with OptiFine?

The 2nd one sounds like a duplicate of #19.

kotmatross28729 commented 2 years ago

no, it's the same with dynamic light

kotmatross28729 commented 1 year ago

I was able to reproduce with a TNT block, apparently, this happens very rarely with all blocks, but always with liquids. (this does not happen if dynamic lighting is disabled)

https://user-images.githubusercontent.com/110309314/208972638-d5336de3-74ed-46b8-8b34-844beb237d6b.mp4

makamys commented 1 year ago

A user on Discord also reported what appears to be the same issue:

Not sure if AF is the cause or if its my GPU hating AF, but if Dynlights is active at all while moving, weird flickering of chunks likes to happen. Usually happens in areas that have had any types of edits in them. (blocks being broken or placed)

https://cdn.discordapp.com/attachments/993717703032447016/1050943346773868634/javaw_kfahbwNq7Y_1.mp4

I was able to reproduce the issue (using water) with everything in AF's config disabled, so the incompatibility is with one of the mandatory tweaks.

kotmatross28729 commented 1 year ago

Is this fixable or do It need to completely rewrite the code of something? This is easy to reproduce with blocks, if you break them very often and immediately place them in, as I understand it, any liquids are updated very often, and this flickering is connected precisely with updating blocks

makamys commented 1 year ago

I compiled a version of the mod that has the lighting engine disabled (that is, all mixins in the package archaicfix.mixins.*.lighting), and the issue went away. So the problem is in that part of the mod. That's all I can say.

MagmaBro123 commented 1 year ago

Really hope this is fixed. Been a massive pain.

embeddedt commented 1 year ago

I am pretty sure it's not an issue with the standalone Dynamic Lights mod. Not sure if that works alongside OptiFine.

MagmaBro123 commented 1 year ago

It does iirc, they have an override option in.. 1.12 I think.

makamys commented 1 year ago

I am pretty sure it's not an issue with the standalone Dynamic Lights mod

It is, it's what I tested with.

We could always add an option to disable the lighting engine part of the mod if this proves too difficult to fix properly.

embeddedt commented 1 year ago

We could always add an option to disable the lighting engine part of the mod if this proves too difficult to fix properly.

This has been added and will be in the next release.

calreveraster commented 1 year ago

Just throwing out there that as of version 0.5.0 this is still happening, even with the lighting engine disabled in config - but as far as I can tell, it only happens with water. It is worse with dynamic lights from OptiFine enabled, but will still (extremely rarely) happen without it.

The easiest way to reproduce the issue (without dynamic lights) is to spill water, then break the source block - then spill water in the same spot a second time, and youll see it occur in spaces that the water will be occupying once it's completely propagated.

I've tested it with every option in the config disabled.

Edit: It also does seem to occasionally happen to slopes from carpenter's blocks, if that helps.

If needed I'll see if I can grab some videos a bit later - at work at the moment so I can't really sit down and capture anything.

calreveraster commented 1 year ago

Another update:

hodgepodge, tentatively, fixes the issue. I assume it's the openGL state error fixes that they have in the mod. I'd encourage anyone with the issue to drop hodgepodge into the pack and see if it persists, or if it's just me.

kotmatross28729 commented 1 year ago

Another update: hodgepodge, tentatively, fixes the issue. I assume it's the openGL state error fixes that they have in the mod. I'd encourage anyone with the issue to drop hodgepodge into the pack and see if it persists, or if it's just me.

I have hodgepodge in my pack but still have this error

calreveraster commented 1 year ago

Another update: hodgepodge, tentatively, fixes the issue. I assume it's the openGL state error fixes that they have in the mod. I'd encourage anyone with the issue to drop hodgepodge into the pack and see if it persists, or if it's just me.

I have hodgepodge in my pack but still have this error

What other mods are you using that impact rendering?

my current layout is optifine(with shaders)+archaicfix+hodgepodge+falsetweaks

I used fastcraft for years, but with the updates to these mods (and it's issues with shaders) I've found I no longer need it

kotmatross28729 commented 1 year ago

Exactly the same, + FlyingCullers (not sure, but maybe CoreTweaks and bugtorch do something too)

MagmaBro123 commented 1 year ago

AF on its own, with Dynamic Lights, (besides UniMixins) both with no config changes causes this issue.

Other mods don't fix this.

calreveraster commented 1 year ago

Just a small update - still happening on 0.6.1 - and it appears Magma was correct, hodgepodge is not fixing the problem. It just seems to be very intermittent for me, and for a while I didnt notice it, but I'm noticing it again. Sorry for the false positive on that one.

MerrittK commented 10 months ago

Exists in pack without dynamic lights, but with false tweaks.

kotmatross28729 commented 9 months ago

Another update: this doesn't seem to be related to the phosphor backport at all, I just cut out everything related to phosphor from ArchaicFix, but the bug is still there. And, by the way, I found the real reason - this is MixinWorldRenderer, which should fix MC-129. Compiling without it solves the problem. This also explains why turning off everything in the config doesn't affect this, as far as I can see, MixinWorldRenderer is controlled by an environment variable.

To be more specific, this is this part:

    @Inject(method = "markDirty", at = @At("TAIL"))
    private void forceRender(CallbackInfo ci) {
        for(int i = 0; i < this.skipRenderPass.length; i++) {
            this.skipRenderPass[i] = false;
        }
    }

I don't know what to do with this, but in general it's not related to lighting at all (I don't know what exactly MC-129 is, but it doesn't really look like a lighting bug or something like that)

makamys commented 9 months ago

It's known that the MC-129 fix causes flickering issues (which is why I added the flag to disable it), but afaik it's a separate issue from the dynamic lights one, they just have extremely similar symptoms.

MC-129 refers to this issue on Mojira, and the fix for it was implemented following this comment.

kotmatross28729 commented 9 months ago

Well, if the MC-129 fix is ​​known to cause the most significant flickering, might it be worth adding it to the config instead of using System.getProperty? Also, it seems that the problem with dynamic lights is not related to ArchaicFix, as it can be reproduced without it (ArchaicFix).

I can also say that they have slightly different behavior:

MerrittK commented 8 months ago

How do you use the JVM flag?

kotmatross28729 commented 8 months ago

How do you use the JVM flag?

You can add archaicFix.disableMC129 to the environment variables with the true value , or you can add -DarchaicFix.disableMC129=true to the java arguments in your launcher