PyWavefront icon indicating copy to clipboard operation
PyWavefront copied to clipboard

Consider updating visualization

Open einarf opened this issue 7 years ago • 11 comments

Consider updating the visualization code to something more modern. Pyglet is pretty much locked to OpenGL 2.1 released in 2006. Today OpenGL 4.6 is the stable version. I would suggest using OpenGL 3.3 so we an at least visualize all different vertex formats. Most hardware today support his; even 5 year old onboard Intels.

I would suggest using ModernGL (https://github.com/cprogrammer1994/ModernGL) with PyQt5 as this also will align closer to users of this library (mainly coming from the Scientific Computing community).

einarf avatar Aug 28 '18 05:08 einarf

Would upgrading to a newer OpenGL require us to deprecate Pyglet support?

greenmoss avatar Aug 30 '18 00:08 greenmoss

Yep. It would mean replacing pyglet with something else. Pyglet doesn't support core profiles and are stuck on OpenGL 2.1 also using fixed pipeline. They are not planning to change this until pyglet version 2.x, that may never happen.

I have no idea if this causes any issues for anyone.

Replacement in packages would be

pip install PyQt5
pip install moderngl

.. instead of pyglet.

einarf avatar Aug 30 '18 00:08 einarf

That's unfortunate. So Pyglet is basically holding us back then 😢

I am guessing supporting both Pyglet and ModernGL would be extremely complex. Is this correct?

greenmoss avatar Aug 30 '18 00:08 greenmoss

I am guessing supporting both Pyglet and ModernGL would be extremely complex. Is this correct?

I don't think it's that hard to support both. Are there good reasons to keep the pyglet support?

einarf avatar Aug 30 '18 00:08 einarf

The only downside I can think of switching is forcing existing Pyglet users to make changes. Is that likely?

greenmoss avatar Aug 30 '18 01:08 greenmoss

We can just introduce a new module modern_visualization. In 3.0 we separated visualization into its own module visualization, so I guess this is pretty straight forward.

einarf avatar Aug 30 '18 02:08 einarf

That sounds like a good solution to me.

greenmoss avatar Aug 30 '18 02:08 greenmoss

The moderngl_window project is slowly shaping up. Will add new visualization module here when this is done. https://github.com/moderngl/moderngl_window

einarf avatar Mar 06 '19 10:03 einarf

Pyglet 1.4 is ready soon that will solve a lot of the limitations in 1.3. We'll probably still stick with pyglet backend for moderngl_window. It does support using pyglet directly or moderngl. This way we can support both 😄

einarf avatar Jun 10 '19 21:06 einarf

Note : Pyglet is moving from BitBucket to GitHub when 1.4 is released : https://github.com/pyglet/pyglet

einarf avatar Jun 14 '19 11:06 einarf

We also have pyglet2 coming in the near future using the programmable pipeline. That adds more complications because it's not compatible with pyglet 1.x

einarf avatar Oct 21 '19 21:10 einarf