-
-
Notifications
You must be signed in to change notification settings - Fork 235
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 is blurry #1240
Comments
Try swap the graphics backend to opengl-graphics: https://github.com/PistonDevelopers/opengl_graphics/blob/master/examples/text_test.rs |
I tried using opengl-graphics, but it didn't make a difference. You can have a look at my code here. The blurriness is more obvious with a light background, so finally I switched to a dark background. |
Yeah seeing this on macOS 10.14.6 on the retina screen. |
Same here. Could it be that it is not taking the pixel ratio of the screen when building the glyphs? Which might explain it being blurry on Retina screen? I don't have a non-retina screen to check that assumption though. I'm happy to look into it, would love some guidance as to where the glyphs are built. |
I believe you can fix the blur using a scale transform and larger test. Ideally this should be detected and handled by the text rendering. Ideas? |
I'm also interested in rendering sharp text. If someone finds a solution (on online guide) please post a it (or a link) here. |
I confirm that rendering twice the size but with Example of my code: let text_tr = context.transform.trans(10.0, 100.0).zoom(0.5);
text::Text::new_color([0.9, 0.9, 0.9, 1.0], 28)
.draw(
"Hello world!",
&mut self.glyphs,
&context.draw_state,
text_tr,
g2d,
)
.unwrap();
self.glyphs.factory.encoder.flush(device); |
I'd love to have sharp text. |
@ffactory-ofcl make sure you run in release mode when benchmarking. The performance in debug mode is unreliable. |
@bvssvni I know that it is but it shouldn't lag this bad. I only draw at most 50 polygons and 60 rectangles in any given frame. It's a simple tetris clone and before I updated from a few pistoncore packages to piston_window, everything was fine, even in debug. No need to benchmark either. Now, it's supposedly still OpenGL 3.2 but laggy. For now, I've started to port it to ggez instead of piston. |
I am developing a game in Piston and need to display text in order to show the score. I followed the instructions given here https://github.com/PistonDevelopers/piston-examples/blob/master/src/hello_world.rs and was able to render the text successfully, but it looks blurry. I have tried the solution provided here PistonDevelopers/piston_window#179, but it didn't work for me.
The text was updated successfully, but these errors were encountered: