Repository navigation
Conversation
astojilj
reviewed
Sep 26, 2019
| vec2 result = fract(value); | ||
| if (result.x > 0.5) result.x -= 1.0; | ||
| if (result.y > 0.5) result.y -= 1.0; | ||
| return result; |
Contributor
There was a problem hiding this comment.
Shorter way to write it return fract(value) - vec2(greaterThan(value, vec2(0.5)));. Shouldn't matter, though.
Member
Author
There was a problem hiding this comment.
I can try, but many OpenGL implementations I tested are very picky about subtle changes like this and perform rounding differently.
| v_tex = a_tex / u_texsize; | ||
| v_tex = a_tex; | ||
| if (u_crisp && (segment_angle + symbol_rotation == 0.0)) { | ||
| // move texture loopup to snap to the pixel grid |
| // move texture loopup to snap to the pixel grid | ||
| vec4 icon_pos = u_coord_matrix * vec4(projected_pos.xy / projected_pos.w, 0.0, 1.0); | ||
| v_tex += absfract((icon_pos.xy + 1.0) * u_canvas_size * vec2(1.0, -1.0) / 2.0); | ||
| v_tex += fract(a_offset / 32.0 * fontScale * u_device_pixel_ratio); |
Contributor
There was a problem hiding this comment.
Is there a need to multiply this by u_coord_matrix before fract, as it is in gl_Position calculation?
Member
Author
kkaefer
force-pushed
the
icon-scaling
branch
2 times, most recently
from
January 22, 2020 16:49
d65b1c4 to
8b30b46
Compare
|
Is this going to be fixed in release-c? Really looking for seing this fixed :) Thanks. |
Contributor
|
Closing this as stale |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #8730.
We're currently switching between pixel-grid aligned icons in a binary way. In a follow-up patch, we could implement a gradual switch by making
u_crispa float, and scaling it between 0 and 1 whenever the user interacts with the map.