Open sahlbergnielsen opened 8 months ago
Hey, thanks for opening this issue. This different appearance is probably due to a small inconsistency between Pyvista and VTK. Fortunately it can be fixed easily by just enabling depth peeling:
from pyvista_imgui import ImguiPlotter
import pyvista as pv
pl = ImguiPlotter()
sphere = pv.Sphere()
pl.add_mesh(sphere, render=False, opacity=0.5)
pl.view_isometric()
pl.enable_depth_peeling()
pl.show()
By default this is disabled for the default pyvista theme which is also re-used by this package, but the underlying VTK renderer still seems to enable it.
Great! Thanks a lot for the trick! Cool library you made!
For large meshes and with depth peeling enabled I notice that the framerate throttles and drops quite a bit every 1-2 second or so. This is the case both with the pyvista plotter and the imgui plotter
from pyvista_imgui import ImguiPlotter
from pyvista import examples
import pyvista as pv
nefertiti = examples.download_nefertiti()
pl = ImguiPlotter()
pl.add_mesh(nefertiti, opacity=0.5, color='lightgrey')
pl.view_isometric()
pl.enable_depth_peeling()
pl.show()
The same framerate drop is seen also when using the pyvista plotter
from pyvista_imgui import ImguiPlotter
from pyvista import examples
import pyvista as pv
example = examples.download_pump_bracket()
pl = pv.Plotter()
pl.add_mesh(example, opacity=0.5, color='lightgrey')
pl.view_isometric()
pl.enable_depth_peeling()
pl.show()
with no call to pl.enable_depth_peeling()
framerate is good and transparency works.
from pyvista_imgui import ImguiPlotter
from pyvista import examples
import pyvista as pv
example = examples.download_pump_bracket()
pl = pv.Plotter()
pl.add_mesh(example, opacity=0.5, color='lightgrey')
pl.view_isometric()
pl.show()
Unfortunately, I was not able to reproduce the problem. It could be a Windows-specific problem though. As it is happening with the regular Plotter es well, it is likely, that the issue lies deeper within the VTK stack.
Transparency in the
ImguiPlotter
shows up different than inPlotter
from pyvista