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

Bryanv/webgl copies #10384

Merged
merged 8 commits into from Aug 12, 2020
Merged

Bryanv/webgl copies #10384

merged 8 commits into from Aug 12, 2020

Conversation

bryevdv
Copy link
Member

@bryevdv bryevdv commented Aug 7, 2020

This PR incidentally fixes #5589 but also makes a number of other incremental changes to webgl:

  • currently we always blit the GL canvas if "webgl" backend is specified, even if a glyph decides not to do any gl rendering. This makes blits contingent on actual gl draws having happened

  • no more coordinate transforms in webgl for now. All screen coords come from standard map_data as a result, several uneccessary array copies coudl be removed, also all the gorpy "linearity testing" and "baked offset" code was removed

  • The current code does not handle uniform/vector colors properly, deleted the optimization for that and now a full RGBA array is constructed for line and fill every time (this is the fix for Some WebGL not working on Safari #5589)

This version probably updates all the buffers more often than the previous code, but also reduces array copies. In my local testing performance was still very good. In any case things are now more correct/working.

Issues discovered

I noticed two issues that seem to exist already (checked 2.1.1), so no need to try and fix them now:

  • zooming in on circles with radius stop zooming properly at some point, and stay a fixed size

  • lines zoomed in look like garbage:

Screen Shot 2020-08-07 at 10 15 02 AM

@bryevdv
Copy link
Member Author

bryevdv commented Aug 7, 2020

FYI I think this would be good to get into 2.2 if possible, but I am not pressed about it.

As a next step I think I'd like to see about constructing typed RGBA arrays for colors in the regular map_data path, so that all color mapping can come out of the webgl code, and also those color buffers could just be passed directly as now with coordinates.

At that point I think the current webgl code will be stripped down enough that a migration to using ReGL can be contemplated, with the more careful buffer/uniform handling that I was prototyping outside Bokeh.

@bryevdv
Copy link
Member Author

bryevdv commented Aug 7, 2020

Looks like the webgl lines are slightly wider now, but only slightly. We're going ot have to re-do all the line algo anyway since it produces such bad results zoomed in so I am not going to worry about it.

@mattpap
Copy link
Contributor

mattpap commented Aug 10, 2020

I will review this in the evening or tomorrow morning.

@bryevdv
Copy link
Member Author

bryevdv commented Aug 10, 2020

Incidentally, here is the implementation of instanced line rendering wit ReGL, including caps and joins, that I intend to eventually follow:

https://wwwtyro.net/2019/11/18/instanced-lines.html

@bryevdv bryevdv added this to the 2.2 milestone Aug 12, 2020
@bryevdv bryevdv merged commit 33c2ffa into branch-2.2 Aug 12, 2020
@bryevdv bryevdv deleted the bryanv/webgl_copies branch Aug 12, 2020
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.

Some WebGL not working on Safari
2 participants