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

Find cross-platform MSDF workaround #176

Closed
JujuAdams opened this issue Jan 5, 2021 · 11 comments
Closed

Find cross-platform MSDF workaround #176

JujuAdams opened this issue Jan 5, 2021 · 11 comments
Labels
bug 😅 Juju did a bad thing

Comments

@JujuAdams
Copy link
Owner

Mac unfortunately doesn't like the standard derivatives extension (at least not on our version of GLSL) so I need to find a workaround. Hopefully YYG provide us with a way to force the GLSL version + add extensions soon <_<

@JujuAdams JujuAdams added the bug 😅 Juju did a bad thing label Jan 5, 2021
@DragoniteSpam
Copy link

Get your shader stuff together, Yoyo >:(

@JujuAdams
Copy link
Owner Author

I belieeeeve I've found a solution for this, but YYG are apparently upgrading to Metal at some point in the future so I'll hold off on making Mac-related changes until the dust settles there.

@JujuAdams JujuAdams changed the title Find MSDF workaround for Mac Find cross-platform MSDF workaround Mar 15, 2021
@JujuAdams
Copy link
Owner Author

Bumped up the priority queue as this impacts more platforms than I was initially aware of.

@ZigZaggh
Copy link

Sounds great, I'm looking forward to be able to use Scribble with MSDF Fonts in my project, as this solves some annoying issues I have with scaling and the standard text rendering.

@JujuAdams
Copy link
Owner Author

JujuAdams commented Mar 16, 2021

Fix open for testing in 7.1.2pre002

@ZigZaggh
Copy link

So I have been testing with the new version, and I have done all the previous mentioned test both on Android and iOS, and so far everything looks good just as on Windows, so absolutely perfect 👍

Thank you so much for looking in to this issue so fast Juju, very much appreciated :)

A question regarding performance, I would love to use this in an app both for Android and iOS, and my question is regarding lower end devices mostly on Android, how is the MSDF font performance there, or is there not a difference to the "normal" way of drawing fonts?

@JujuAdams
Copy link
Owner Author

There's marginally more work being done for MSDF fonts, but they're basically the same speed as a standard font rendered through Scribble.

As for performance versus GM's native text drawing? I've not tested it recently. I'd imagine Scribble is slower for simple strings, but simple strings don't have all the fun bits that make Scribble useful!

@ZigZaggh
Copy link

Sounds good, I must admit I have not looked too deep in to Scribble, I just saw there where some shaders and thought of some lower end devices not being too happy about them, but I guess these are used to render the font initially and not draw the font in the end?

@JujuAdams
Copy link
Owner Author

Bulk of the shader burden is in the vertex shader so that's orders of magnitude less stressful than heavy fragment shaders. The work that's being done in there is for all the effects (rainbow, wave, typewriter easing etc.). MSDF fonts, like standard fonts, only require a single texture sample so memory bandwidth is rarely a problem.

GM dynamically builds vertex buffers every frame for every piece of text you render, but Scribble caches vertex buffers. This vertex buffer caching offsets the extra cost of running a custom shader.

@ZigZaggh
Copy link

Sounds great, thank you for the explanation, I'm looking very much forward to working with Scribble :)

@JujuAdams
Copy link
Owner Author

Implemented in v7.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 😅 Juju did a bad thing
Projects
None yet
Development

No branches or pull requests

3 participants