Hacker News new | ask | show | jobs
by blt 604 days ago
this looks similar to VisPy (https://vispy.org/), are there any major differences?
5 comments

From my experience with vispy, it is more limited than pygfx. I mean, you can always use gloo to get whatever you want but the "built ins" are much more limited than what pygfx seems to have. I really like vispy anyways, I think this seems like an evolution with some lessons learnt from vispy.
Pygfx uses webgpu while VisPy uses OpenGL.
This is indeed one of the major differences. Many of the problems that are plaguing Vispy are related to OpenGL. The use of wgpu solves many of them.

Also, wgpu forces you to prepare visualizations in pipeline objects, which at drawtime require just a few calls. In OpenGL there is way more work for each object being visualized at drawtime. This overhead is particularly bad on Python. So this particular advantage of wgpu is extra advantageous for Python.

From the same developer ;)
Oh thanks, I didn’t realize that. Having recently evaluated Vispy that really helps me place what this tool might be for
Seems this needs a newish graphics driver stack to work.
Apart from being based on wgpu, Pygfx also has a better design IMO. Korijn deserves the credit for this. It's inspired by ThreeJS, based on the idea to keep things modular.

We deliberately don't try to create an API that allows you to write visualizations with as few lines as possible. We focus on a flexible generic API instead, even if it's sometimes a bit verbose.

We leave it up to others to create higher level (domain specific) APIs. Fastplotlib is one example: https://github.com/fastplotlib/fastplotlib