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

Fix LineSeries() drawing hairlines when scaled #167

Closed
fatcerberus opened this issue Jun 28, 2017 · 2 comments
Closed

Fix LineSeries() drawing hairlines when scaled #167

fatcerberus opened this issue Jun 28, 2017 · 2 comments
Milestone

Comments

@fatcerberus
Copy link
Member

LineSeries() is currently implemented as a line strip:
https://github.com/fatcerberus/minisphere/blob/v4.5.11/src/minisphere/vanilla.c#L2127-L2131

This method works well at 1x scale, but when the game window is zoomed, as sometimes happens with lower-resolution games or in fullscreen, the line segments become hairlines (thinner than a pixel) because the GPU only scales the vertices and not the line segments themselves.

Find a way to fix the implementation so that the lines have 1-pixel thickness, as those produced by Line(), preferably without producing visible "elbows" on translucent line strips.

@fatcerberus
Copy link
Member Author

PointSeries() is also affected by this, since it uses ALLEGRO_PRIM_POINT_LIST. Just like with lines, points get scaled merely by scaling the point's coordinates; the GPU will never light more than a single screen pixel for a given point, even with a scaling matrix in play.

Note that this bug doesn't affect Surface#lineSeries() or Surface#pointSeries() because scaling never comes into play.

@fatcerberus
Copy link
Member Author

This bug is fixed after changing to a new scaling algorithm (see 59b2556). The backbuffer is sized to the game resolution and scaled up on flip, so LineSeries() and PointSeries() now come out as they would in Sphere 1.x, regardless of the scale factor.

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

No branches or pull requests

1 participant