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

WebGL support for HBar VBar and HexTile glyphs #12061

Merged
merged 4 commits into from
Mar 26, 2022

Conversation

ianthomas23
Copy link
Member

This PR adds support for WebGL rendering of HBar, VBar and HexTile glyphs.

HBar and VBar use QuadGL almost without any changes, so I have renamed QuadGL to LRTBGL as all 3 GlyphViews use the same left, right, top and bottom properties.

Most of the changes to support HexTileGL are to change the WebGL fragment shader to support hex glyphs of varying aspect ratio rather than the fixed aspect ratio that scatter(marker='hex', ...) uses.

I have extended the existing visual tests to include WebGL testing for those glyphs that we support so far, which includes circle and rect for completeness. There are quite a few visual tests for hex_tile and I have only altered the two that include hatch patterns as this is the easiest way to identify WebGL rendering vs canvas or SVG. Here is one of them:

HexTile_glyph__should_support_'flattop'_orientation_with_hatch_patterns

This work is part of the CZI round 3 extension.


if (this.glyph.model.orientation == "pointytop") {
this._angles!.set_from_scalar(0.5*Math.PI)
this._widths!.set_from_scalar(this.glyph.svy[0]*2)
Copy link
Member Author

Choose a reason for hiding this comment

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

Widths and heights are taken from HexTileView.svx and svy which are calculated in _get_unscaled_vertices(). I thought this better than recalculating the sizes here as well, although looking in the svx and svy arrays is not ideal.

@bryevdv
Copy link
Member

bryevdv commented Mar 25, 2022

@ianthomas23 this is great, my only comment is that rects do support rotation about their center, so perhaps the should_support_Rect test could exercise that as well.

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

Added rotation angle to should_support_Rect test.

@mattpap mattpap merged commit 415156e into branch-3.0 Mar 26, 2022
@mattpap mattpap deleted the ianthomas23/webgl_hbar_vbar_hextile branch March 26, 2022 13:02
ianthomas23 added a commit that referenced this pull request May 16, 2022
* Add WebGL HBar and VBar glyphs

* Add WebGL HexTile glyphs

* Visual test changes

* Include rotation in should_support_Rect test
@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.

3 participants