-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Text render resolution #1132
Text render resolution #1132
Conversation
9440aab
to
cb46e92
Compare
cb46e92
to
86b3e90
Compare
Ideally we don't need to send the scale factor to the gpu. Thats extra data transfer that isn't required. I think we should do that work on the cpu if we can. |
I suppose the transformation matrix passed to the shader could be reworked to be in physical coordinates for text rendering. Is that what you are getting at? |
Not quite. One way to go about it is:
|
At least ... I think that would work? |
I tried that route initially, but couldn't get it to work. The details are a little fuzzy right now, but it came down to the scale affecting placement of the glyphs making it tricky to get the transform right. It should be possible, but I think it comes down to reproducing physical coordinates one way or another. I choose this rout since I figured it would be useful for sprite sheets to be able to scale the sprites similar to the same capability for non-sprite-sheet sprites. I choose to pass a scaling factor instead of an explicit size, which makes it inconsistent though. |
Yeah my only major hangup with this impl is the extra data passed to the shader. If you can eliminate that / use the existing shader without making changes to it, then the other details matter less to me. |
86b3e90
to
cfbff73
Compare
cfbff73
to
f089d8d
Compare
Nice! Glad this ended up being a relatively straightforward impl. I made a few small changes:
I think is is good to go, but feel free to comment on any of the changes. |
Thanks for cleaning it up. I had considered using the |
This patch changes the text glyph atlas to render at the displays physical resolution fixing scaling artifacts that exist when running at scaling factors other than 1. It addresses issue #1116.
It accomplishes this by adding a scaleing factor to the sprite sheet rendering pipeline. This is added via a new resource node, though it could also probably be merged into the existing
TextureAtlasSprite
resource node.This improves text quality, but there still appears to some glyph placement issues that could be resolved in this PR or another one.