Fabricators-of-Create / Create

[Fabric Mod] Building Tools and Aesthetic Technology
MIT License
834 stars 188 forks source link

Partial incompatibility with Sodium (Flywheel backend) #54

Closed AeiouEnigma closed 2 years ago

AeiouEnigma commented 2 years ago

Create's shafts, belts, crushing wheels, and probably more do not render at all while the Flywheel backend is enabled.

2021-12-24_20 57 54 2021-12-24_20 58 07

AeiouEnigma commented 2 years ago

Haven't found any issues at all with Sodium when Flywheel backend is disabled

Jozufozu commented 2 years ago

https://github.com/Jozufozu/sodium-forge/commit/9bcfbc28118fc35ee831a01eea7c59b55b94fd26 No doubt sodium's internals have changed, but this needs to be fixed on their end

AeiouEnigma commented 2 years ago

Jozufozu/sodium-forge@9bcfbc2 No doubt sodium's internals have changed, but this needs to be fixed on their end

@Jozufozu would I have your blessing in potentially adapting your linked code into a PR to sodium-fabric, in the event I get such a thing working right?

Jozufozu commented 2 years ago

Absolutely, ping me if you get it working and I'll help verify

AeiouEnigma commented 2 years ago

Okay it's not quite as plug-and-play as I was hoping. No improvement when flywheel backend is enabled, and making that change to sodium as-written also newly breaks things when flywheel backend is disabled

This task is officially beyond me lol

image

Oliver-makes-code commented 2 years ago

It seems to work fine with Indium 2021-12-30_22 25 31

AeiouEnigma commented 2 years ago

how

2021-12-30_23 29 45

AeiouEnigma commented 2 years ago

Could this be an nvidia issue?

Oliver-makes-code commented 2 years ago

Possibly, Sodium has had problems with driver-specific things in the past

Oliver-makes-code commented 2 years ago

Here's a small update: It fixes it, but only for a period of time, and then it spams the following error in the console:

[22:42:44] [Render thread/INFO]: OpenGL debug message: id=1282, source=API, type=ERROR, severity=HIGH, message='Error has been generated. GL error GL_INVALID_OPERATION in (null): (ID: 173538523) Generic error'
Oliver-makes-code commented 2 years ago

It occurs when chunks are reloaded after the blocks are placed

Oliver-makes-code commented 2 years ago

Gonna look into this to see what the cause is

Oliver-makes-code commented 2 years ago

It looks like that when a chunk reload is triggered via world reload, f3+a, or unloading a chunk, FlyWheel removes the models it needs to render, and Sodium's renderer doesn't call the methods that FlyWheel uses to put them back

Oliver-makes-code commented 2 years ago

ChunkRenderDispatcher$RenderChunk$RebuildTask$handleBlockEntity (ChunkBuilder$BuiltChunk$RebuildTask$addBlockEntity on yarn) isn't called on sodium's side, and that's what FlyWheel uses to re-add the BlockEntities.

plapl1 commented 2 years ago

Same issue exists on Canvas Renderer, unsure if I should create a new issue since it might be the same error causing it on both renderers.

Oliver-makes-code commented 2 years ago

As of the latest version, It straight up crashes during startup due to a mixin conflict with LevelRendererMixin and MixinWorldRenderer on Flywheel and Sodium respectively

AeiouEnigma commented 2 years ago

As of the latest version, It straight up crashes during startup due to a mixin conflict with LevelRendererMixin and MixinWorldRenderer on Flywheel and Sodium respectively

The crash will be fixed in the next Flywheel update.

RedWideWeb commented 2 years ago

Partially fixed in builds 343 and 344. Still crashes occasionally but it works now. World launches, belts and entities are rendered properly. Even Shaders are partially working. Great job, @AeiouEnigma

AeiouEnigma commented 2 years ago

Appreciate it, but truly the credit needs to go to Jozufozu and Pepper :)

I only took 2 minutes to merge the existing code from the forge version.

To avoid crashes, just make sure to set /flywheel backend off. Shaders seem to work fine with contraptions if you use Iris's new configuration menu to disable shader-based shadows, if the option exists for your particular shaderpack.

RedWideWeb commented 2 years ago

To avoid crashes, just make sure to set /flywheel backend off. Shaders seem to work fine with contraptions if you use Iris's new configuration menu to disable shader-based shadows, if the option exists for your particular shaderpack.

Will try that. Thanks!

RedWideWeb commented 2 years ago

Why is this issue still open?

AeiouEnigma commented 2 years ago

Why is this issue still open?

Because using Sodium, even with Indium installed, still results in severe rendering issues when the Flywheel backend is enabled.

DarianLStephens commented 2 years ago

I was trying it a few minutes ago, and everything looked how I'd expect coming from the Forge version.

RedWideWeb commented 2 years ago

Why is this issue still open?

Because using Sodium, even with Indium installed, still results in severe rendering issues when the Flywheel backend is enabled.

Yeah, I see. Okay

RedWideWeb commented 2 years ago

I was trying it a few minutes ago, and everything looked how I'd expect coming from the Forge version.

Have you disabled flywheel backend?

DarianLStephens commented 2 years ago

I haven't. Just installed the latest artifact and everything's peachy.

DarianLStephens commented 2 years ago

Screenshot for reference: 2022-01-21_10 27 14

RedWideWeb commented 2 years ago

Screenshot for reference: 2022-01-21_10 27 14

Flywheel: Off

DarianLStephens commented 2 years ago

Wait, is it off by default? I just noticed that text on the right, but I haven't run that /flywheel backend off command.

RedWideWeb commented 2 years ago

Wait, is it off by default? I just noticed that text on the right, but I haven't run that /flywheel backend off command.

Not sure. Maybe it should be Off

RedWideWeb commented 2 years ago

@AeiouEnigma should Flywheel be marked as Off in F3 menu

DarianLStephens commented 2 years ago

Running /flywheel backend batching crashed the game instantly. Running /flywheel backend instancing does the same.

I guess that means it was off the entire time and I just never noticed.

AeiouEnigma commented 2 years ago

Running /flywheel backend batching crashed the game instantly. Running /flywheel backend instancing does the same.

Known issue with Iris, though we haven't actually opened an Issue about that

RedWideWeb commented 2 years ago

Running /flywheel backend batching crashed the game instantly. Running /flywheel backend instancing does the same.

I guess that means it was off the entire time and I just never noticed.

For me it was instancing by default. So before I disabled it i ran just /flywheel backend and it printed default value which was instancing for me.

AeiouEnigma commented 2 years ago

Running the /flywheel backend instancing or /flywheel backend batching commands with sodium installed results in various blocks having messed up or non-existent rendering

DarianLStephens commented 2 years ago

Yeah, Iris does not like this. Turning shaders on made contraptions (the windmill) disappear, and turning them back off just crashed the game.

With Iris off, it's defaulting to Instancing, and I'm seeing the same issues as here. 2022-01-21_10 33 35

Batching just makes it all disappear: 2022-01-21_10 34 34

RedWideWeb commented 2 years ago

Yeah, Iris does not like this. Turning shaders on made contraptions (the windmill) disappear, and turning them back off just crashed the game.

With Iris off, it's defaulting to Instancing, and I'm seeing the same issues as here. 2022-01-21_10 33 35

For shaders disable Realtime shadows. This fixes the Windmills

AeiouEnigma commented 2 years ago

If the world loads while the flywheel backend is enabled, things will probably look just fine until the renderer reloads.

Contraptions not rendering with certain shaders enabled is another known issue. If the shaderpack has an option to disable shadows, that may 'fix' the problem.

DarianLStephens commented 2 years ago

Interestingly, newly-placed blocks seem to render just fine, but toggling Flywheel or using F3+A makes things disappear. 2022-01-21_10 37 10 2022-01-21_10 37 40

The cogwheel was even spinning.

DarianLStephens commented 2 years ago

More of things working after replacing the blocks manually. 2022-01-21_10 40 44

RedWideWeb commented 2 years ago

There are no shafts on the gearboxes

AeiouEnigma commented 2 years ago

Alright I appreciate it but you can both stop updating on every minor detail lol, the issue is known

RedWideWeb commented 2 years ago

Alright I appreciate it but you can both stop updating on every minor detail lol, the issue is known

Okay, sorry.

AeiouEnigma commented 2 years ago

No harm done 😄

PepperCode1 commented 2 years ago

This was fixed completely in Flywheel as of yesterday, and I am not aware of any issues with Create specifically, so I am closing this issue. If there are other problems please open a new one.