Skip to content
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

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

Open
kotmatross28729 opened this issue Nov 27, 2022 · 24 comments
Labels
lighting engine Issue regarding the lighting engine overhaul (the Phosphor backport)

Comments

@kotmatross28729
Copy link

kotmatross28729 commented Nov 27, 2022

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
Copy link
Collaborator

makamys commented Nov 27, 2022

Does the 1st issue only happen with OptiFine?

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

@kotmatross28729
Copy link
Author

no, it's the same with dynamic light

@kotmatross28729
Copy link
Author

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)

2022-12-21.20-55-18_Trim.mp4

@makamys makamys changed the title Strange water with ArchaicFix Dynamic Lights causes past versions of blocks to flicker Jan 2, 2023
@makamys
Copy link
Collaborator

makamys commented Jan 2, 2023

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
Copy link
Author

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
Copy link
Collaborator

makamys commented Jan 2, 2023

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.

@makamys makamys changed the title Dynamic Lights causes past versions of blocks to flicker Dynamic Lights with Phosphor backport causes past versions of blocks to flicker Jan 2, 2023
@makamys makamys added the lighting engine Issue regarding the lighting engine overhaul (the Phosphor backport) label Jan 2, 2023
@MagmaBro123
Copy link

Really hope this is fixed. Been a massive pain.

@embeddedt
Copy link
Owner

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

@MagmaBro123
Copy link

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

@makamys
Copy link
Collaborator

makamys commented Jan 6, 2023

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
Copy link
Owner

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
Copy link

calreveraster commented Apr 30, 2023

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
Copy link

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
Copy link
Author

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
Copy link

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
Copy link
Author

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

@MagmaBro123
Copy link

MagmaBro123 commented Jun 14, 2023

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

Other mods don't fix this.

@calreveraster
Copy link

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
Copy link

MerrittK commented Feb 1, 2024

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

@kotmatross28729
Copy link
Author

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
Copy link
Collaborator

makamys commented Mar 9, 2024

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
Copy link
Author

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:

  • The problem with the MC-129 fix is ​​most noticeable, as the flickering blocks remain until block updating is stopped, or the chunk is reloaded with F3+A.

  • The problem with the dynamic lights itselves is less noticeable, since it don't always appear, and this flickering seems to be a one-time flicker (appears only once and then disappears), and it's visible for about 1 tick.

@MerrittK
Copy link

How do you use the JVM flag?

@kotmatross28729
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lighting engine Issue regarding the lighting engine overhaul (the Phosphor backport)
Projects
None yet
Development

No branches or pull requests

6 participants