Fabricators-of-Create / Create

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

[Iris compatibility] Contraptions do not render properly when shader shadows are enabled #97

Closed AeiouEnigma closed 2 years ago

AeiouEnigma commented 2 years ago

Not sure of the best way to word the title. Some shaderpacks completely break contraption rendering. In some cases, this can be 'resolved' by disabling shadows if the shaderpack offers an option to do so.

AeiouEnigma commented 2 years ago

Complementary shaders is probably a good shaderpack to use for troubleshooting of this issue.

RedWideWeb commented 2 years ago

Complementary shaders is probably a good shaderpack to use for troubleshooting of this issue.

Definitely

sybershot commented 2 years ago

Can confirm the issue. Using any shaderpack with shadows enabled makes multiblock Entity contraptions disappear. Iris 1.2.0 allows turning all shadows off for the current shaderpack.

Mods used:

Shaderpacks tested:

sybershot commented 2 years ago

This behavior also applies to ponder mechanic. I did not create separate issues as they have common root cause.

mixolydianmel commented 2 years ago

I have done some more testing for this issue.

(1) Without Indium installed, the behaviour changes; Without shaders on, the shaft appears to rotate, but there is also a copy of it in the same location that does not. This is not the case for gearboxes, which seem to work fine without duplicate model components. 2022-01-27_12 54 56 2022-01-27_12 54 54 There is z-fighting on the ends of these that is not visible in the images.

(2) With the same configuration, turning shaders on results in the rotating copy of the shaft disappearing, leaving only the static copy. On a gearbox, this looks like the little rotating mini-shafts completely disappearing, but leaving the rest of the gearbox model present. 2022-01-27_12 55 02 This is a static shaft; it doesn't move.

(3) Once turning shaders off again, the rotating copies still are not present. This persists through block updates, unloading/loading the chunks, and logging out/into the world. The only way to get them to rotate again is to replace them. 2022-01-27_12 55 06 The same static shaft, but with shaders off. This persisted until a replacement of the block.

Additionally, updating a line of shafts does not result in them starting to turn; each shaft must be replaced individually.

Hope this helps!

mixolydianmel commented 2 years ago

I have also just tested this with sails.

Following the same process, I get:

Shaders off — 2022-01-27_13 08 26 Shaders on — 2022-01-27_13 08 33 Shaders off again — 2022-01-27_13 08 47

AeiouEnigma commented 2 years ago

Thank you for your testing, but I feel that we're at a point where we fully understand the nature of these issues. You don't have to keep testing 😄

mixolydianmel commented 2 years ago

Cool, just thought I'd post my findings :)

JieningYu commented 2 years ago

I have also just tested this with sails.

Following the same process, I get:

Shaders off — 2022-01-27_13 08 26 Shaders on — 2022-01-27_13 08 33 Shaders off again — 2022-01-27_13 08 47

Probably caused by this( https://github.com/Fabricators-of-Create/Create/issues/54 Try turning off flywheel backend by /flywheel backend off

mixolydianmel commented 2 years ago

Probably caused by this( #54 Try turning off flywheel backend by /flywheel backend off

This works with Indium, shafts and the head of the windmill bearing render!

The actual turning sails, however, still do not render with shaders.

JieningYu commented 2 years ago

Probably caused by this( #54 Try turning off flywheel backend by /flywheel backend off

This works with Indium, shafts and the head of the windmill bearing render!

The actual turning sails, however, still do not render with shaders.

Actually you can turn the shadows off in shaders settings(iris has shaders settings from 1.2.0) just like what the title pointed

IMS212 commented 2 years ago

My current suspicion is unfortunate timing between Iris and flywheel causing beginFrame’s info to get overridden with the shadow one, even during normal rendering.

IMS212 commented 2 years ago

The cause behind this has been found, and multiple ways of fixing it are being investigated.

DragonWoven commented 2 years ago

something I've seen that I don't thinks been mentioned is that, with shadows enable, moving contraptions don't simply not render they appear in the sky where your crosshair is

IMS212 commented 2 years ago

This is due to an overwrite of the render buffers, so yes, this is expected.

soup587 commented 2 years ago

Any news on a fix?

JieningYu commented 2 years ago

Any news on a fix?

There's a branch in iris github named"create"

soup587 commented 2 years ago

i think that was merged into the latest version but refabricated isn't working right now so

soup587 commented 2 years ago

now we wait for a 1.18.2 build

michlbro commented 2 years ago

i think that was merged into the latest version but refabricated isn't working right now so

The "fix" on the iris side has been merged into the latest version, however the fix for flywheel hasn't (The PR) - which kind of works. (Renders some shadows 👀 ).

sybershot commented 2 years ago

So, here we are once again... I'm currently testing build 495 with iris shaders installed. Moving multiblock contraptions still do not render, though, cast shadows. Turning off shadows in the pack's setting fixes the problen. Upd: This also applies to minecart contraptions. Side note: turning off indium causes visual glitches on the models with animation, such as cogwheels. Everything else seem to work properly, even the ponder scenes. Full mod list:

Shaderpack used: Sildur's Enhanced Default 1.131 (using default settings)

michlbro commented 2 years ago

If you check out the flywheel github page, you can check if they have merged the iris stuff that fixes this (PR). Currently I don’t think they have fully fixed it yet as they are still trying to resolve it.

weegeeluigi commented 2 years ago

Yep, can confirm shadows render but the contraptions will still render on crosshair in random locations.

IMS212 commented 2 years ago

This has been fixed on Iris’ side in the new commits, but there are new issues pertaining to rendering entities + contraptions in the same scene now.

IMS212 commented 2 years ago

2022-04-12_22 28 51 Iris 1.2.3 pre-alpha, with some support for contraptions: (Please do not report anything using this to the Iris support channel, but rather directly to me.) https://cdn.discordapp.com/attachments/774353381057495061/963536834758053972/iris-mc1.18.2-1.2.3-pre-6a7bd8b2-dirty.jar

weegeeluigi commented 2 years ago

Did a quick test, rendered pretty well I would say that 1.2.3 will be a nice update. Performance also matched so I would say it's looking good without sacrificing anything.

Keep up the great work!

IMS212 commented 2 years ago

Fixed in 1.2.3.