Skip to content

Double MSDF#5

Open
ibesora wants to merge 8 commits intomainfrom
ib/final-double-msdf
Open

Double MSDF#5
ibesora wants to merge 8 commits intomainfrom
ib/final-double-msdf

Conversation

@ibesora
Copy link
Copy Markdown

@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

@ibesora ibesora requested a review from ChrisLoer as a code owner September 10, 2024 10:11

sizeSlider.oninput = function () {
updateMap();
document.getElementById("sizeOut").innerHTML = `size: ${document.getElementById("size").value}`;

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML

[DOM text](1) is reinterpreted as HTML without escaping meta-characters.

haloWidthSlider.oninput = function () {
updateMap();
document.getElementById("haloWidthOut").innerHTML = `halo: ${document.getElementById("haloWidth").value}`;

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML

[DOM text](1) is reinterpreted as HTML without escaping meta-characters.
Comment thread test/examples/msdf.html

sizeSlider.oninput = function () {
updateMap();
document.getElementById("sizeOut").innerHTML = `size: ${document.getElementById("size").value}`;

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML

[DOM text](1) is reinterpreted as HTML without escaping meta-characters.
Comment thread test/examples/msdf.html

haloWidthSlider.oninput = function () {
updateMap();
document.getElementById("haloWidthOut").innerHTML = `halo: ${document.getElementById("haloWidth").value}`;

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML

[DOM text](1) is reinterpreted as HTML without escaping meta-characters.
Comment thread test/examples/msdf.html

weightSlider.oninput = function () {
updateMap();
document.getElementById("weightOut").innerHTML = `weight: ${document.getElementById("weight").value}`;

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML

[DOM text](1) is reinterpreted as HTML without escaping meta-characters.
@ibesora ibesora force-pushed the ib/final-double-msdf branch from 379ecef to 80e83db Compare September 10, 2024 14:47
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
Copy Markdown
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
Copy Markdown
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.

3 participants