kliment / Printrun

Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software
GNU General Public License v3.0
2.36k stars 995 forks source link

Enable 3D operation for more drivers #1314

Open swiftgeek opened 1 year ago

swiftgeek commented 1 year ago

pyglet documentation (shadow_window)

Fixes/works around #1313 May need testing whether it negatively affects performance with other drivers (in significant way)

Tested with ~Intel mesa classic~ crocus, llvmpipe and softpipe, under kde x11 and weston with xwayland enabled.

rockstorm101 commented 1 year ago

Hi @DivingDuck, I've tested this and it does not seem to affect the 3D display on my machine though my specs are similar to @swiftgeek's. Could you have a look and see if it negatively affects Windows?

DivingDuck commented 1 year ago

Hi @rockstorm101, I've tested it as well with running two Fusion360 models, one is very complex (>4k bodies) and one is a more simple construction (145 bodies). I can't really say if it slows down the performance as I see Fusion sometimes slows a bit down and sometimes not. For the complex model it feels like it slows down a bit more. That tends me to think it is more a system related performance thing on my system, but who knows.

Maybe adding a toggle switch for this in options setup is a appropriate solution for dealing with it as the documentation says:

shadow_window

    By default, pyglet creates a hidden window with a GL context when pyglet.gl is imported. This 
allows resources to be loaded before the application window is created, and permits GL objects to 
be shared between windows even after they’ve been closed. You can disable the creation of the 
shadow window by setting this option to False.

    Some OpenGL driver implementations may not support shared OpenGL contexts and may 
require disabling the shadow window (and all resources must be loaded after the window using 
them was created). Recommended for advanced developers only.
    New in version 1.1.

https://pyglet.readthedocs.io/en/latest/programming_guide/options.html#module-pyglet

swiftgeek commented 1 year ago

I was thinking more about significant difference like 1.5/2x slower (or more), and not something that is hard to measure, since 3D is only is used for preview / tracking progress.