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

Double MSDF #5

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Double MSDF #5

wants to merge 8 commits into from

Conversation

ibesora
Copy link

@ibesora ibesora commented Sep 10, 2024

This implements VIZ-1182

I've added changes by commits:

  • First all the relevant MSDF code changes
  • Then a couple of test examples
  • Finally all the dist folder so we can use our fork directly
  • Subsequent commits are test fixes

Test plan:

  • Tests should pass

test/examples/msdf-icons.html Dismissed Show dismissed Hide dismissed
test/examples/msdf-icons.html Dismissed Show dismissed Hide dismissed
test/examples/msdf.html Dismissed Show dismissed Hide dismissed
test/examples/msdf.html Dismissed Show dismissed Hide dismissed
test/examples/msdf.html Dismissed Show dismissed Hide dismissed
float size = v_data1.y;
float fade_opacity = v_data1[2];

fragColor = u_is_text || !u_is_msdf ? renderText(u_is_text, fill_color, halo_color, opacity, halo_width, halo_blur, EDGE_GAMMA, tex, gamma_scale, size, fade_opacity) : renderMSDFIcon(fill_color, halo_color, opacity, EDGE_GAMMA, tex, gamma_scale, size, fade_opacity);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expressed concern about this branching logic in our 1:1, but I think since the input to the branch is a uniform the execution only ever has to follow one path and there ends up not being any efficiency hit.


float EDGE_GAMMA = 0.105 / u_device_pixel_ratio;
float screenPxRange(float fontScale) {
// WebGL1 doesn't support derivatives and we can't use version 300
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is a little confusing because it doesn't say why we'd want to support derivatives? i.e. what the preferred code would be and why it would be better

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

Successfully merging this pull request may close these issues.

2 participants