vega / vega-webgl-renderer

WebGL renderer for Vega.
https://vega.github.io/vega-webgl-renderer
BSD 3-Clause "New" or "Revised" License
43 stars 4 forks source link

Consider writing this with two.js #4

Open domoritz opened 6 years ago

domoritz commented 6 years ago

https://github.com/jonobr1/two.js looks like it has a nice renderer abstraction that could be used to build a renderer for WebGL as well. Since this also implements SVG and Canvas, we could compare the performance easily. One downside is that this may be quite slow compared to writing webgl by hand.

jeffbaumes commented 6 years ago

I'm very open to the idea, or whoever wants to run with this idea or try other new things. Especially considering that development has stalled for a long time now (is not tested against current Vega, etc.).

Though I agree, you probably can't beat custom shaders. I have already done some shader tweaking for performance, but am by no means a full expert and more could be done. I believe the main rationale of having a WebGL renderer at all is to get performance boosts when needed, which has been done in at least one example (the "scale" example interacts a bit faster in WebGL compared to Canvas, and SVG hangs). The other potential benefit is enabling 3D vis, which I'm interested in, but 3D has limited appeal within the data visualization community, and research suggests it is not often helpful.

amitkaps commented 6 years ago

Another option is to use luma.gl which is used for deck.gl and kepler.gl by the Uber team. http://uber.github.io/luma.gl/#/

No expert in WebGL, but looks at the ability to handle large datasets in kepler.gl is a good indicator. Also, I saw that plotly.js is also thinking about writing their WebGL rendering using it.

ricardoekm commented 4 years ago

+1 for luma.gl or deck.gl

domoritz commented 4 years ago

@ricardoekm Why do you think we should use those? Would you want to take a stab at writing a WebGL renderer?

ricardoekm commented 4 years ago

To be honest I can't do a fair comparison to two.js, because I've never used it.

About Luma.gl, is a framework that makes writing WebGL less painful. It automatically polyfill to WebGL 2 to WebGL 1 in older browsers/Safari, and keeps all WebGL power (you can mix WebGL code with high-level abstractions provided by Luma). It has a nice and concise set of APIs and good documentation.

Deck.gl provides visualization support classes, many of them Geo focused, but they're extending to different kinds of visualization (Microsoft Sand Dance, for instance, is based on Deck.gl)

I wonder if there's demand for this kind of renderer in Vega. WebGL shines in use cases where it's useful to draw hundreds of thousands of points (e.g. geo applications, big scatter plots). Most Vega visualizations seem to be summarizations/aggregations.

If we conclude there's demand I would be definitely interest in simplifying and updating the current renderer, perhaps with Luma.gl.

Thoughts?

domoritz commented 4 years ago

I've had many people ask for faster renderers. I also think that once the renderer becomes faster, we will see more raw plots (it's a chicken and egg problem).

ricardoekm commented 4 years ago

Makes sense. I'll give it a try.

aerlaut commented 2 years ago

@ricardoekm have you made any progress? I'm interested in having a WebGL renderer for Vega.