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

[1.16.5 - Compatibility Issue] Vivecraft Crash when using scanner #101

Open
Colin-J-Wood opened this issue Feb 21, 2022 · 11 comments
Open

Comments

@Colin-J-Wood
Copy link

Colin-J-Wood commented Feb 21, 2022

https://pastebin.com/0BjVRk4Y

game has trouble getting glstate from RenderSystem.multMatrix

@Colin-J-Wood Colin-J-Wood changed the title [1.16.5] Vivecraft Crash when using scanner [1.16.5 - Compatibility Issue] Vivecraft Crash when using scanner Feb 21, 2022
@fnuecke
Copy link
Member

fnuecke commented Apr 16, 2022

Does this also happen without optifine?

@Kaleidio
Copy link

Kaleidio commented Apr 18, 2022

It is impossible to run the mod without Optifine installed, as Vivecraft is specifically built to ship, auto install, and ultimately bakes in Optifine into itself. (due to a deal the devs made with sp618x several years ago)

Note that using this mod with Optifine on desktop by itself (no vivecraft, just optifine) does not crash in this manner. This crash only occurs with vivecraft's version of optifine (slightly modified to support vivecraft's shader edits)

Note again that Vivecraft has its own shader system which you will need to look at if you wish to fix support

@Kaleidio
Copy link

Might I suggest reaching out to the Vivecraft devs on their official discord to gather immediate help from them? they will provide information on their pipeline edits but they don't tend to directly contribute/assist

@Kaleidio
Copy link

This issue has been silent for a while so I guess I can clarify my answer.

No, it does not happen without optifine, but it also doesn't happen with it. it only happens with vivecraft.

@fnuecke
Copy link
Member

fnuecke commented Jun 27, 2022

Hey, sorry, forgot to reply. Took me a little too long for the "vive" part to click -- I'm afraid that's not something I have the time to dig into, how to make this work for both regular rendering and VR rendering. If someone else wants to make a PR to add support for that/fix it, I'd be happy to review/merge it.

@Kaleidio
Copy link

Kaleidio commented Jun 27, 2022

Techjar, one of the lead vivecraft devs, has reached out to me with what you will need to do to ScanManager in order to fix it, and I copy paste quote below

"it's expecting RenderWorldLastEvent to fire before RenderGameOverlayEvent
which is 100% not the case with vivecraft because we have to render the gui first so we can put it in the world
so projectionMatrix never gets set and it NPEs on the first frame that a world is loaded "

@Kaleidio
Copy link

Kaleidio commented Jun 27, 2022

furthermore, and more of a functional issue, is the idea being that you cannot render everything in the gui layer. you'd have to build glowing mesh as world mesh instead. even if this was working, everything would appear in the quad at the player's hand instead of in the world as the effect intended

so for now it might be best option to NOP it out if vivecraft is present, until a solution is devised to build the mesh in world instead of in gui.

@pikaro
Copy link

pikaro commented Apr 9, 2023

Can unfortunately confirm that what looks like the same error happens with Fabric 1.19.2, so it has nothing to do with Optifine.

[09/04/2023 20:15:41 pm] java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1159.method_22673()" because "$$0" is null
[09/04/2023 20:15:41 pm] 	at com.mojang.blaze3d.systems.RenderSystem.setProjectionMatrix(RenderSystem.java:1246)
[09/04/2023 20:15:41 pm] 	at li.cil.scannable.client.ScanManager.renderGui(ScanManager.java:257)
[09/04/2023 20:15:41 pm] 	at li.cil.scannable.client.fabric.ClientSetupFabric.lambda$onInitializeClient$2(ClientSetupFabric.java:20)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback.lambda$static$0(HudRenderCallback.java:27)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_329.handler$dke001$fabric-rendering-v1$render(class_329.java:5996)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_329.method_1753(class_329.java:393)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_757.redirect$hdj000$vivecraft$noGUIwithViewOnly(class_757.java:11477)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_757.method_3192(class_757.java:862)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.newRunTick(class_310.java:31028)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.handler$hcf000$vivecraft$replaceTick(class_310.java:30828)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.method_1523(class_310.java)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.method_1514(class_310.java:768)
[09/04/2023 20:15:41 pm] 	at net.minecraft.client.main.Main.method_44604(Main.java:244)
[09/04/2023 20:15:41 pm] 	at net.minecraft.client.main.Main.main(Main.java:51)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

@Kaleidio
Copy link

Kaleidio commented Apr 9, 2023

Can unfortunately confirm that what looks like the same error happens with Fabric 1.19.2, so it has nothing to do with Optifine.

[09/04/2023 20:15:41 pm] java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1159.method_22673()" because "$$0" is null
[09/04/2023 20:15:41 pm] 	at com.mojang.blaze3d.systems.RenderSystem.setProjectionMatrix(RenderSystem.java:1246)
[09/04/2023 20:15:41 pm] 	at li.cil.scannable.client.ScanManager.renderGui(ScanManager.java:257)
[09/04/2023 20:15:41 pm] 	at li.cil.scannable.client.fabric.ClientSetupFabric.lambda$onInitializeClient$2(ClientSetupFabric.java:20)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback.lambda$static$0(HudRenderCallback.java:27)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_329.handler$dke001$fabric-rendering-v1$render(class_329.java:5996)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_329.method_1753(class_329.java:393)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_757.redirect$hdj000$vivecraft$noGUIwithViewOnly(class_757.java:11477)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_757.method_3192(class_757.java:862)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.newRunTick(class_310.java:31028)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.handler$hcf000$vivecraft$replaceTick(class_310.java:30828)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.method_1523(class_310.java)
[09/04/2023 20:15:41 pm] 	at net.minecraft.class_310.method_1514(class_310.java:768)
[09/04/2023 20:15:41 pm] 	at net.minecraft.client.main.Main.method_44604(Main.java:244)
[09/04/2023 20:15:41 pm] 	at net.minecraft.client.main.Main.main(Main.java:51)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
[09/04/2023 20:15:41 pm] 	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

this is not the same crash, no. mine happens during gameplay. yours was during client loading. as noted by this line:

[09/04/2023 20:15:41 pm] at li.cil.scannable.client.fabric.ClientSetupFabric.lambda$onInitializeClient$2(ClientSetupFabric.java:20)

note how it says ClientSetup, and has nothing to do with MultiMatrixes.

I recommend opening a new issue for your own crash.

@pikaro
Copy link

pikaro commented Apr 9, 2023

No, that occurs in the exact moment I press the scan button. But yes, looks like I misinterpreted the Vivecraft devs' comments - but that also doesn't appear to match what you're describing now? "It NPEs on the first frame that a world is loaded" - wouldn't that happen on world load, not during gameplay?

@Kaleidio
Copy link

Kaleidio commented Apr 9, 2023

it seems that scannable fabric has renamed the method they use to ClientSetupFabric, and instead of being a setup system like I expected, it is called the first time the tool is used, rather than when the client world first loads. the name of this class changed since the 1.16.5 forge version this bug was originally reported on.

in 1.16.5, the method was called onPreRenderGameOverlay.. here in 1.19.2 fabric it seems to be a lambda called onInitializeClient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants