Sodium Reloaded (Unofficial)

Sodium Reloaded (Unofficial)

0 Downloads

Position-aware Texture Hotswapping

sylv256 opened this issue ยท 7 comments

commented

Request Description

This is a feature that I'm using in Legacy Landscape. I don't think this is within the scope of an API (personally I'd mark it as wontfix), but I was told to put it in the issue tracker anyway.

Relevant Mixins

Mixin_DefaultChunkRenderer
Mixin_BlockRenderer
Accessor_TerrainRenderPass
I've recently changed how I achieve this. The relevant mixins are as follows:
Mixin_BlockRenderer
This is a vanilla mixin to allow falling back to regular textures:
Mixin_TextureAtlas

commented

Can you link the context on both the issues?

I've added links to the relevant mixins in both issues.

commented

Can you link the context on both the issues?

commented

Are you able to use the Fabric Rendering APIs to implement your hook without mixins? It should provide a QuadTransform that your mod can register to intercept the quads being sent to the renderer.

I'm on NeoForge, but I'll look into it with FFAPI eventually.

commented

Sodium does support the Fabric Rendering APIs even for NeoForge mods, but yeah, it's kind of difficult to make use in practice since that means your mod will have a dependency on the Forge-port Fabric API, which isn't even available for Minecraft 1.21.3.

commented

At that point I think it should just be ported to the Sodium API since Forgified FAPI already isn't very reliable version-wise.

commented

I recently changed how this is done. Now, instead of changing the texture atlas (which is highly error-prone), I swap the UVs in BlockRenderer#processQuad.

commented

Are you able to use the Fabric Rendering APIs to implement your hook without mixins? It should provide a QuadTransform that your mod can register to intercept the quads being sent to the renderer.