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

Unify WebGL markers and rects #12040

Merged
merged 3 commits into from
Mar 9, 2022
Merged

Conversation

ianthomas23
Copy link
Member

This PR unifies WebGL markers and rects as a rect is a square marker with a 2D size. It closed item 5 of #11369.

It simplifies the codebase as there is now just a single pair of shaders (marker.vert and marker.frag) for all constant-shape glyphs rather than there being separate ones for markers and rects. I have renamed the shaders marker.frag etc rather than markers.frag because the singular name is more appropriate as the equivalent typescript class is MarkerGL.

rect already had all visual properties except for line dashes. Now other markers have the same, particularly hatching and end caps, and I have rewritten many of the shader distance equations to fit in with the rect approach and also to make them more understandable/maintainable by using similar formulations of distances from straight lines defined by unit vectors and distances from the origin. This removes the last of the original WebGL code which had a different antialiasing formulation.

The only things missing from rects/markers now are:

  1. Line dashes, which needs to be correctly implemented for line first.
  2. Line joins (although rect already has them).

The WebGL baseline images remain the same for rect but are all different for other markers due to the changes in antialiasing and the underlying equations. There is one new visual test, for markers with hatching:
Marker_glyph__should_support_hatch

This work is part of the CZI round 3 extension.

@mattpap mattpap added this to the 3.0 milestone Mar 8, 2022
@ianthomas23
Copy link
Member Author

This is ready, apart from @mattpap's comment about the marker types in the test which I am inclined to leave as it is.

@mattpap mattpap merged commit 9f2a62c into branch-3.0 Mar 9, 2022
@mattpap mattpap deleted the ianthomas23/unify_marker_rect branch March 9, 2022 21:08
ianthomas23 added a commit that referenced this pull request May 16, 2022
* Unify markers and rects

* Baseline images

* Consistent code style
@ianthomas23 ianthomas23 modified the milestones: 3.0, 2.4.3 May 16, 2022
bryevdv pushed a commit that referenced this pull request May 16, 2022
* Fix webgl line NaN handling (#11829)

* Fix webgl line nan handling

* Add baseline images

* Support multiple marker types in WebGL scatter (#11840)

* Support multiple marker types in WebGL scatter

* Update macos/windows baseline images

* Changes following review

* Add docs about different render order

* Remove temporary webgl circle fix (#11849)

* Add regression test for updating webgl line (#11884)

* Add regression test for updating webgl line (issue #8346)

* Update macos and windows baseline images

* Unify WebGL markers and rects (#12040)

* Unify markers and rects

* Baseline images

* Consistent code style

* WebGL typescript refactor and add quad glyph (#12046)

* SingleMarkerGL for rect and quad

* MarkerGL inherits from BaseMarkerGL

* Better class hierarchy

* Test WebGL quad glyph

* Separate CircleGL class

* Avoid use of any

* Remove code duplication

* Implement WebGL marker line joins (#12055)

* Line joins for markers

* Use same antialiasing width for all webgl markers

* Correct size hints

* Baseline image changes

* Marker glyph should support line join test

* WebGL support for HBar VBar and HexTile glyphs (#12061)

* Add WebGL HBar and VBar glyphs

* Add WebGL HexTile glyphs

* Visual test changes

* Include rotation in should_support_Rect test

* Minor WebGL line refactor (#12120)

* Fix Wedge and AnnualWedge glyph hitboxes (#12071)

* Fix Wedge and AnnualWedge glyph hitboxes

* Hitbox tests for Wedge and AnnualWedge glyphs

Co-authored-by: Michael Brown <michael@msbrown.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants