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

Fabric Rendering API (FRAPI) is not supported, causing issues with some mods #5

Open
coderbot16 opened this issue Mar 16, 2020 · 24 comments
Assignees
Labels
A-mods Area: Mod compatibility P-high Priority: High S-nyi Status: Not yet implemented T-tracking Type: Tracking
Milestone

Comments

@coderbot16
Copy link
Contributor

The JAR declares that it contains a rendering plugin...

[17:10:40] [main/INFO]: [Indigo] Different rendering plugin detected; not applying Indigo.

However, Sodium does not currently register a renderer, causing mods to crash with a NullPointerException.

java.util.concurrent.CompletionException: java.lang.NullPointerException
	at Not Enough Crashes deobfuscated stack trace.(1.15.2+build.14) ~[?:?]
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) ~[?:1.8.0_242]
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) ~[?:1.8.0_242]
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1606) ~[?:1.8.0_242]
	at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1596) ~[?:1.8.0_242]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_242]
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_242]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_242]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) ~[?:1.8.0_242]
Caused by: java.lang.NullPointerException
	at net.dblsaiko.hctm.client.render.model.UnbakedWireModel.<init>(UnbakedWireModel.java:102) ~[2660aded-8ccb-49f1-8d34-a98c3def0742.jar:?]
	at net.dblsaiko.rswires.client.RSWiresClient$onInitializeClient$1.apply(RSWiresClient.java:22) ~[rswires-4.0.7-standalone.jar:?]
	at net.dblsaiko.rswires.client.RSWiresClient$onInitializeClient$1.apply(RSWiresClient.java:16) ~[rswires-4.0.7-standalone.jar:?]
	at net.fabricmc.fabric.impl.client.model.ModelLoadingRegistryImpl$LoaderInstance.lambda$new$0(ModelLoadingRegistryImpl.java:66) ~[de705b74-fc81-4d7f-97b0-98efe2a37168.jar:?]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_242]
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_242]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_242]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_242]
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_242]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_242]
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_242]
	at net.fabricmc.fabric.impl.client.model.ModelLoadingRegistryImpl$LoaderInstance.<init>(ModelLoadingRegistryImpl.java:66) ~[de705b74-fc81-4d7f-97b0-98efe2a37168.jar:?]
	at net.fabricmc.fabric.impl.client.model.ModelLoadingRegistryImpl$LoaderInstance.<init>(ModelLoadingRegistryImpl.java:54) ~[de705b74-fc81-4d7f-97b0-98efe2a37168.jar:?]
	at net.fabricmc.fabric.impl.client.model.ModelLoadingRegistryImpl.begin(ModelLoadingRegistryImpl.java:201) ~[de705b74-fc81-4d7f-97b0-98efe2a37168.jar:?]
	at net.minecraft.client.render.model.ModelLoader.handler$zkp000$addModelHook(ModelLoader:656) ~[?:?]
	at net.minecraft.client.render.model.ModelLoader.addModel(ModelLoader) ~[?:?]
	at net.minecraft.client.render.model.ModelLoader.<init>(ModelLoader:190) ~[?:?]
	at net.minecraft.client.render.model.BakedModelManager.prepare(BakedModelManager:50) ~[?:?]
	at net.minecraft.client.render.model.BakedModelManager.prepare(BakedModelManager:18) ~[?:?]
	at net.minecraft.resource.SinglePreparationResourceReloadListener.method_18791(SinglePreparationResourceReloadListener:11) ~[?:?]
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604) ~[?:1.8.0_242]
	... 5 more

Would it be possible to have a stub implementation of Renderer that throws a more descriptive error when trying to use its methods?

Thanks for developing this amazing mod!

@aqualxx
Copy link

aqualxx commented May 9, 2020

In the discord, it says that JellySquid is going to try and implement support for the fabric rendering API for the 0.1 release, so you will soon have mod compatibility when that happens :)

@jellysquid3 jellysquid3 added the S-nyi Status: Not yet implemented label May 16, 2020
@Sturmlilie
Copy link

@coderbot16 is this behavior specific to rswires? I don't get a crash with just Campanion, and I don't remember TechReborn crashing either (just fluid cells being invisible).

@coderbot16
Copy link
Contributor Author

Haven't tested with any of those mods, it is possible that it's just RSWires.

@Sturmlilie
Copy link

Sturmlilie commented Jun 28, 2020

Yeah, Campanion doesn't actually cause any calls into the renderer API from what I can see, which is strange. (I also don't yet know how fabric rendering works, so..)

@NeusFear
Copy link

Campanion does use the Fabric rendering api for rope bridges and things, here is an example:
https://github.com/TerraformersMC/Campanion/blob/1.16/src/main/java/com/terraformersmc/campanion/ropebridge/RopeBridgePlank.java

@Sturmlilie
Copy link

Sturmlilie commented Jun 28, 2020

@NeusFear Is there a reason you're referencing Indigo [1] directly instead of the registered renderer? This would both explain why I don't see any calls into my dummy renderer, and why Campanion doesn't crash when another renderer is registered.

[1] https://github.com/TerraformersMC/Campanion/blob/1.16/src/main/java/com/terraformersmc/campanion/ropebridge/RopeBridgePlank.java#L150

@NeusFear
Copy link

Going to ping @Wyn-Price I don't know the details of the rendering done.

@ghost
Copy link

ghost commented Jul 7, 2020

I haven't seen any null pointer exception, but I have noticed that TechReborn's fluid cells are completely invisible and any color rendering of FlowableFluid ends up having the same color as water (even when the sprite is already colored). What I mean by that is, I have several fluids which uses a colored sprite and then load it with all white color so I can display the color of the sprite. This works just fine without Sodium installed, but has the same color as water when Sodium is installed.

@Sturmlilie
Copy link

TechReborn too references Indigo directly instead of querying for the actual registered renderer. That's how they get around crashing.

@jellysquid3 jellysquid3 added this to the Release 0.2 milestone Jul 8, 2020
@jellysquid3 jellysquid3 changed the title NullPointerException with mods using the Fabric Rendering API Fabric Rendering API is not supported (yet) Jul 8, 2020
@jellysquid3 jellysquid3 pinned this issue Jul 8, 2020
@jellysquid3 jellysquid3 changed the title Fabric Rendering API is not supported (yet) Fabric Rendering API is not supported, causing issues with some mods Jul 25, 2020
@silversquirl
Copy link
Member

As far as I know, the plan is to eventually merge Indium into Sodium

spoorn added a commit to spoorn/SpoornLootIssues that referenced this issue Mar 15, 2021
The release version of Sodium is incompatible with the Fabric Rendering API: CaffeineMC/sodium-fabric#5.
The only way to get Sodium is to take it from the non-release 1.16.x-next branch: https://github.com/CaffeineMC/sodium-fabric, and use Indium: https://github.com/comp500/Indium.

These are modified versions of Sodium-1.16.x-next and Indium since at the time I pulled these, there were new commits conflicting between the 2.  I modified Indium to depend on a specific commit of Sodium.

These modified snapshots will be compatible with Spoorn's World: https://www.curseforge.com/minecraft/modpacks/spoorns-world
spoorn added a commit to spoorn/SpoornLootIssues that referenced this issue Mar 17, 2021
The release version of Sodium is incompatible with the Fabric Rendering API: CaffeineMC/sodium-fabric#5.
The only way to get Sodium is to take it from the non-release 1.16.x-next branch: https://github.com/CaffeineMC/sodium-fabric, and use Indium: https://github.com/comp500/Indium.

These are modified versions of Sodium-1.16.x-next and Indium since at the time I pulled these, there were new commits conflicting between the 2.  I modified Indium to depend on a specific commit of Sodium.

These modified snapshots will be compatible with Spoorn's World: https://www.curseforge.com/minecraft/modpacks/spoorns-world
 main
@srnyx

This comment has been minimized.

@DragonEggBedrockBreaking

This comment has been minimized.

@srnyx

This comment has been minimized.

@DragonEggBedrockBreaking

This comment has been minimized.

@CaffeineMC CaffeineMC locked as off-topic and limited conversation to collaborators Mar 24, 2021
@jellysquid3
Copy link
Member

jellysquid3 commented Mar 25, 2021

I have locked this issue because the conversation around it has almost entirely devolved into either users asking for progress updates or users incorrectly attributing unrelated issues with the lack of FRAPI support.

As of the time being: There is no ETA for when Fabric Render API support will be implemented. We originally gave an ETA that this would happen in the 0.2 series, but doing that has effectively held the project hostage and made it very difficult for us to break the ice with a new release, as support is still not here for it.

Sodium started out as my pet project, and while the community reception to it has been immense, I am still essentially the only contributor to this project who is pushing forward development with new features, optimizations, bug fixes, and improvements. My time for all this work has been paid, between donations and any other referral sources, at a rate significantly lower than even minimum wage, part-time jobs are offering around me right now.

Right now, whatever time is available for me to work on these projects is often being spent on other goals, such as improving hardware support and re-structuring the code with better abstractions and APIs, etc. This work has made it significantly easier for projects such as Indium and Iris to integrate with Sodium, and while it has brought the mod closer down the path of eventually supporting FRAPI, it isn't really something tangible in the hands of players today.

Summarily... It is difficult enough trying to implement a foreign API with such a large surface area into the project, and even more so when my time and energy has been stretched thin by a full-time job and such.

I would encourage those who are interested in seeing support for FRAPI in Sodium to either contribute upstream to the project or to build their own addons or forks (such as Indium) so we can better understand what work is ahead of us. This is not something I can do alone, and users pushing for me to implement (again, foreign APIs for their own interests) into what is basically a pet project is not a viable strategy.

@jellysquid3 jellysquid3 changed the title Fabric Rendering API is not supported, causing issues with some mods Fabric Rendering API (FRAPI) is not supported, causing issues with some mods Mar 25, 2021
@jellysquid3 jellysquid3 removed this from the Release 0.3 milestone Jun 18, 2021
@jellysquid3
Copy link
Member

Preliminary support now exists for fabric-rendering-data-attachment-v1 and fabric-rendering-fluids-v1 in the 1.17.x/dev branch.

This is not complete support for what people refer to as "FRAPI", but it's non-zero.

@jellysquid3
Copy link
Member

Sodium 0.3 is now released and contains support for the aforementioned features.

@jellysquid3
Copy link
Member

There is now experimental support for block rendering using FRAPI with 22d50ca.

@jellysquid3 jellysquid3 added A-mods Area: Mod compatibility T-tracking Type: Tracking labels Oct 10, 2021
embeddedt referenced this issue in embeddedt/embeddium Aug 28, 2023
Resolves #5
@jellysquid3 jellysquid3 added this to the Sodium 0.6 milestone Dec 30, 2023
@jellysquid3 jellysquid3 added the P-high Priority: High label Dec 30, 2023
SrRapero720 pushed a commit to ReplicatedStudios/sodium-fabric that referenced this issue Feb 19, 2024
@IMS212 IMS212 self-assigned this Apr 22, 2024
@jellysquid3 jellysquid3 unpinned this issue May 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-mods Area: Mod compatibility P-high Priority: High S-nyi Status: Not yet implemented T-tracking Type: Tracking
Development

No branches or pull requests