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

blazingly fast bordered text renderer ⚡ #347

Open
wants to merge 8 commits into
base: develop-v0
Choose a base branch
from

Conversation

RedthMC
Copy link
Contributor

@RedthMC RedthMC commented Jun 28, 2024

Description

blazingly fast bordered text renderer ⚡ by using cache
( only forge 1.8.9 and 1.12.2 yet )

@pauliesnug
Copy link
Member

@RedthMC i think this might already be a feature in polyui. if not maybe we should port it over somehow, because merging this would be silly only for it to get superseded in 5 seconds by twoconfig

@ImToggle
Copy link
Contributor

@pauliesnug but people are complaining that chatting and polynametag's full shadow are broken

@Wyvest
Copy link
Member

Wyvest commented Jun 28, 2024

@RedthMC i think this might already be a feature in polyui. if not maybe we should port it over somehow, because merging this would be silly only for it to get superseded in 5 seconds by twoconfig

it’s not…

@nextdayy
Copy link
Member

this seems to be a complete rewrite of the font renderer which will break any mod that mixins into it, meaning this is not great for compatibility.

  • this should be rewritten as a series of mixins into the font renderer so we don’t overwrite the entire thing.
  • could you please provide some evidence to show it actually is blazingly fast?

@ImToggle
Copy link
Contributor

@nextdayy
before
2024-06-28_16 13 56

after
2024-06-28_16 19 58

@RedthMC
Copy link
Contributor Author

RedthMC commented Jun 28, 2024

okay so
imma move shadow to patcher and keep the border

edit:
im just gonna add a option to toggle whether to use blazingly fast text renderer⚡

@nextdayy
Copy link
Member

as i said, this should be rewritten as a series of mixins into the functions, not a complete rewrite.
i know it may be more work, but in terms of quality, compatability, etc. this is pretty key.

@nextdayy
Copy link
Member

additionally, this is incompatible with minecraft 1.17+.

Copy link
Member

@Wyvest Wyvest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if this works with patcher optimized font renderer and SBA's chroma text

@Inject(method = "drawString(Ljava/lang/String;FFIZ)I", at = @At(value = "HEAD"), cancellable = true)
private void cachedShadow(String text, float x, float y, int color, boolean dropShadow, CallbackInfoReturnable<Integer> cir) {
if (Preferences.optimizedFontRenderer && dropShadow) {
cir.setReturnValue((int) BorderedTextRenderer.INSTANCE.drawString(text, x, y, color, TextRenderer.TextType.SHADOW));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not overwrite this whole method

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(value = FontRenderer.class)
public class FontRendererMixin {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transfer all of this to a patcher font renderer mixin as well

@ImToggle
Copy link
Contributor

check if this works with patcher optimized font renderer and SBA's chroma text

it doesnt work with pathcer optimized font renderer

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

Successfully merging this pull request may close these issues.

5 participants