nmwsharp / polyscope

A C++ & Python viewer for 3D data like meshes and point clouds
https://polyscope.run
MIT License
1.76k stars 190 forks source link

Is it possible to provide a simple render mode? #245

Open mushroomfire opened 9 months ago

mushroomfire commented 9 months ago

Polyscope is an exceptional library. I intend to utilize it for visualizing a large number of points (>5,000,000). The default sphere mode is excessively slow on my computer, while the quad mode appears too flat. I would like to inquire if you could provide a mode that only displays the sphere with a minimum number of rendering operations, as it would be extremely beneficial.

mushroomfire commented 9 months ago

By the way, I use the Polyscope python library.

nmwsharp commented 5 months ago

Hi! Glad to hear you like the library.

It would be great to speed up the sphere point rendering operations. There are two main paths to doing this:

(a) Optimize the shader code around the ray-sphere intersection. It can probably be improved, I did not try to optimize it at all when writing it.

(b) Part of the reason sphere points are slow is because they write to the depth buffer, which disables early-z culling. In openGL 3.3 (which polyscope targets) there is no way around this. But more modern openGL does have a way to indicate you are only increasing the depth, and still enable z-culling in that case. We could detect when openGL > 3.3 is available and make use of this feature if so.

I don't have immediate plans to start working on either of those, but would be happy to accept a PR.