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

Position-aware Texture Hotswapping #2818

Open
sylv256 opened this issue Oct 17, 2024 · 7 comments
Open

Position-aware Texture Hotswapping #2818

sylv256 opened this issue Oct 17, 2024 · 7 comments
Labels
A-mods Area: Mod compatibility T-enhancement Type: Enhancement

Comments

@sylv256
Copy link

sylv256 commented Oct 17, 2024

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

@sylv256 sylv256 added S-needs-triage Status: Needs triage T-enhancement Type: Enhancement labels Oct 17, 2024
@douira
Copy link
Collaborator

douira commented Oct 17, 2024

Can you link the context on both the issues?

@sylv256
Copy link
Author

sylv256 commented Oct 17, 2024

Can you link the context on both the issues?

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

@sylv256
Copy link
Author

sylv256 commented Nov 12, 2024

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.

@sylv256 sylv256 changed the title Position-based Hotswapping Texture Atlas Position-aware Texture Hotswapping Nov 12, 2024
@jellysquid3
Copy link
Member

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.

@jellysquid3 jellysquid3 added A-mods Area: Mod compatibility and removed S-needs-triage Status: Needs triage labels Nov 12, 2024
@sylv256
Copy link
Author

sylv256 commented Nov 16, 2024

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.

@jellysquid3
Copy link
Member

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.

@sylv256
Copy link
Author

sylv256 commented Nov 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mods Area: Mod compatibility T-enhancement Type: Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants