WebGL rendering of Ngon glyph#14044
Merged
ianthomas23 merged 2 commits intobranch-3.6from Aug 28, 2024
Merged
Conversation
ianthomas23
commented
Aug 27, 2024
|
|
||
| if (a_show < 0.5 || v_size.x < 0.0 || v_size.y < 0.0 || (v_size.x == 0.0 && v_size.y == 0.0) | ||
| #ifdef USE_NGON | ||
| || v_n < 3.0 |
Member
Author
There was a problem hiding this comment.
This line avoids attempting to render an Ngon with n<3. I have not added an explicit visual test for this.
Contributor
This should have been added in the original PR. In anycase, looks fine. In general, as long as the signature matches bokeh's Python API, then it should be fine. |
mattpap
approved these changes
Aug 27, 2024
Member
Yup I just forgot about it, thanks for adding @ianthomas23 ! |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This implements WebGL rendering of the new Ngon glyph.
Here is the new visual test image, you can tell by the hatching pattern that WebGL is used on the right:
In terms of implementation I have moved most of the existing
CircleGLinto its new base classRadialGLwhich is also the base class for the newNgonGLclass. For the GLSL shaders I have reused the existing marker shaders adding a new marker type"ngon". This allows us to reuse the hatching, line joins, etc. The only thing not supported is line dashes, which is not supported for any of the markers.For the new visual test I've had to add a new
Figure.ngonfunction toglyph_api.ts. I haven't done this before so I've copied, pasted and modified thecirclecode for this. Someone with more experience of this should probably check that I have done this correctly.