BiggerSeries / Quartz

GNU Lesser General Public License v2.1
2 stars 1 forks source link

visual horros with Lodestone and Rubidium #12

Open CipherUnknown opened 1 year ago

CipherUnknown commented 1 year ago

When combining the mod with Rubidium and Lodestone (Malum's library mod) blocks flick between light and black colors, seemingly at random.

Minecraft version: 1.18.2 Forge version: 40.2.1 Rubidium Version: 0.5.5 Lodestone: 1.3 Phosphophyllite: 0.6.0-beta1.6 Quartz Version: 0.0.0-beta.1.4 with only these mods

image ^ This rapidly flicks between normal and completely black

Log: https://pastebin.com/WjWXWNVS (Same error for 28,000 lines)

RogueLogix commented 1 year ago

Try building a bigger reactors turbine with glass. If that fixes the visual issues while its in view, this is likely the same issue that was just patched in 1.19.

CipherUnknown commented 1 year ago

Did some testing around, building a turbine at first had no effect, and after a couple of seconds it seemed fixed. Found out that if was fixed as long as you hold any item in you hand. Holding nothing broke everything as usual.

Keeping the turbine built, kept the creative inventory open for maybe 2 minutes and after closing everything seemed, once again stable. Shortly after, everything back to black. Randomly breaking and fixing itself with the turbine built.

image

Again, only using the mentioned mods.

embeddedt commented 1 year ago

I looked into this briefly since I'm working on a more reliable Rubidium fork, but I don't think it's caused by Rubidium.

Please keep in mind I'm quite inexperienced with modern OpenGL, but I suspect either Lodestone or Quartz are tearing down their render state too aggressively and unbinding some buffer type that Sodium uses, but vanilla does not. This would explain why the issue isn't seen with the vanilla renderer.

In particular, the code here looks rather suspicious (it would be cleaner to save the old state and restore it, but I don't know how that affects performance). This issue can't be reproduced with Rubidium and only one of the mods at a time though, so it must be some type of interaction between their rendering hooks.

The issue on Lodestone's end has a pointer to what part of their rendering code is relevant, if anyone else happens across this and wants to dig in further.

embeddedt commented 1 year ago

I found a kludge to prevent the flickering, but I think the 1.18 version of Quartz has a flawed design: it calls many OpenGL methods directly and bypasses vanilla Minecraft's RenderSystem. RenderSystem caches OpenGL state to increase performance, but if any OpenGL state is changed behind its back and not restored to the exact same value, the cache will be out of sync and cause problems (in Sodium's case it causes rebinding of the lightmap to be skipped, since the cache believes it's already bound).

RogueLogix commented 1 year ago

bypassing the entirety of Mojang's OpenGL code is intentional, that said i wouldn't be surprised if there is a part of the state that is changed by Quartz in a way that normally is a non-issue, but does cause an issue in this case. if lodstone runs before quartz and changes state via RenderSystem to match what mojang will want later and quartz changes that, that is likely the cause.

it would be cleaner to save the old state and restore it, but I don't know how that affects performance

glGet* calls to save the state are generally quite expensive, as they may require a client to server thread sync, or worst case a sync to GPU, with a subsequent stall following that.

Cicopath commented 1 year ago

Is there any temporary solution to this issue?

I don't know by which mod end this issue is being caused, but I'm currently on version 1.18.2, and my world looks like... well, let the pictures explain themselves. I'm in F1 mode, but when I'm not in it, it looks as if some of the blocks are "z-fighting".

Minecraft version: 1.18.2 Forge: 40.2.10

Rubidium: 0.5.6 Rhino: 1802.2.21 build 255 Oculus: 1.6.4

Phosphophyllite: 0.6.0 beta 1.6 Quartz: 0.0.0 beta 1.4

Lodestone: 1.4.2

2023-10-09_23 40 06 2023-10-09_01 54 31

embeddedt commented 1 year ago

You can try using Embeddium instead of Rubidium.

RogueLogix commented 1 year ago

thread on discord where the issue is replicated on 1.19 as well. https://discord.com/channels/767811985844469810/1170452736916070521

RogueLogix commented 10 months ago

OpenGL state mismatch issue, as expected, updating state tracker fixed the issue. I'm going to leave this issue open until i backport to 1.18

Zelioth commented 6 months ago

Hey I am working on our mod pack for 1.19.2 I recently discovered a issue where when using the latest version of Embeddium and RogueLogix mods (Quartz, Bigger Reactor, Phosphophyllite) that there is some sort of visual bug that breaks all textures. I can't downgrade your mods because you've deleted versions in between so none match when downgrading to test and testing older versions of embeddium mods do not seem to fix it either.

The issue is when using embeddium with RogueLogix it breaks textures on 1.19.2 Forge 43.3.9.

This issue is within every version and fixes when removing one or the other but Friends United would like to use both. So what would you recommend for a fix? image

RogueLogix commented 6 months ago

can you provide exact versions of all four mods?

Zelioth commented 6 months ago

Well I have tested all open released that work together for your three mods. (There aren't many that work together with versions missing in between haha)

Bigger Reactors - biggerreactors-1.19.2-0.6.0-beta.6.4.jar quartz - quartz-1.19.2-0.1.0-beta.2.2.jar Phosphophyllite - phosphophyllite-1.19.2-0.6.0-beta.8.jar Embeddium - embeddium-0.3.18+mc1.19.2.jar

RogueLogix commented 6 months ago

oh, i never pushed this change to curseforge, that would explain that, lemme go ahead and do that

Zelioth commented 6 months ago

Please and thank you :D I really appreciate that. Always loved Bigger Reactors and I am trying to update our 1.19.2 Friends United pack and didn't want to without your mods as well :D

RogueLogix commented 6 months ago

1.19.2-0.1.0-beta.1.3 should be on curseforge soon (just need to wait for it to be built)

Zelioth commented 6 months ago

I can confirm that it is now fixed.

dddVolodyabbb commented 5 months ago

Hello. I want to report my problem. Lighting (for example: from torches) does not work with the "quartz" mod when shaders are enabled. Without shaders, the bug appears as black chest lids. I attached 2 screenshots with shaders turned on and off... with and without the "quartz" library.

Minecraft 1.20.1 Forge 47.3.1 Rubidium 0.7.1 Oculus 1.6.9 / Iris 1.6.9 Phosphophyllite 0.7.0-alpha.0.1 Quartz 0.2.0-alpha.0.1 Bigger Reactors 0.6.0 beta-10.4

2024-06-23_21-11-04 2024-06-23_21-12-18 2024-06-23_21-17-11 2024-06-23_21-17-38

I don’t understand programming and can’t help, but I don’t want to give up your mods.