nmwsharp / polyscope

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

How to access polyscope framebuffer #203

Open xander-Ito-Low opened 1 year ago

xander-Ito-Low commented 1 year ago

Hi was wondering how to access the framebuffer in polyscope. Any advice would be helpful thank you.

nmwsharp commented 1 year ago

Officially, Polyscope does not provide this as part of its API. So if you do set it up, it is not guaranteed to be supported, and it make break at any time, etc.

With that disclaimer, if you want to hack on it the framebuffers are here https://github.com/nmwsharp/polyscope/blob/master/include/polyscope/render/engine.h#L503 (in our engine wrapper over openGL). The displayBuffer is what actually gets rendered to, UI and all, whereas the scene buffer is backed by a texture and just holds the 3D content of the scene; it only lazily gets updated when something changes.