-
Notifications
You must be signed in to change notification settings - Fork 73
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
Render glyphs with GLSL for hinting + anti-aliasing? #162
Comments
The rendering of the text itself happens in the No, it's not SDF of any kind. I'm using the text rendering facilities of CanvasRenderingContext2D. However, Primrose doesn't use SDF for lack of trying SDF. There are a number of reasons why this is doesn't really work out:
|
I'm guessing one of the major use cases for Primrose is (as I'm using it) rendering a text editor in XR, where pixels are jenky and ginormous. Displays were of course all 100% jenk in the 90s and a couple techniques from that era might be of interest:
To apply these you have to know where the pixel grid is relative to what you're rendering, which really calls for a pixel shader in the webgl context. IMO, applying both of them can significantly boost text readability in XR, I've been playing with the very cool https://github.com/astiopin/webgl_fonts as a starting point.
Is that something you might be interested in for Primrose? Could you suggest where in the primrose source this might make sense to play with? So far I haven't narrowed down on where in the source glyph rendering is done, guessing its SDF or one of the variants? Obviously this would change how the rendering was done, passing a text buffer with layout coordinates to a GL shader rather than SDF glyph textures with coordinates....
The text was updated successfully, but these errors were encountered: