Description
A SceneX Volume rendered through the VisPy backend produces an entirely black RGB frame, while the equivalent Image path and the PyGFX Volume path render nonblank frames.
I encountered this while validating a Lodstone/SceneX streaming adapter, then reproduced it without Lodstone using a direct SceneX model.
Reproducer
import numpy as np
import scenex as snx
from scenex.utils.projections import zoom_to_fit
snx.use("vispy")
z, y, x = np.indices((16, 16, 16))
data = (((z - 7.5) ** 2 + (y - 7.5) ** 2 + (x - 7.5) ** 2) < 36).astype(np.uint8) * 255
volume = snx.Volume(data=data, clims=(0, 255), render_mode="mip")
view = snx.View(scene=snx.Scene(children=[volume]))
canvas = snx.Canvas(width=96, height=96, views=[view])
zoom_to_fit(view, type="orthographic", letterbox=True)
rendered = canvas.render()
print(rendered.shape, rendered[..., :3].max(), np.count_nonzero(rendered[..., :3]))
On macOS with current SceneX main (bc09fcf), VisPy + native Qt prints:
The 2x dimensions reflect device pixel ratio and are expected. The zero max/count are not.
The same streamed volume through SceneX/PyGFX produces a nonblank frame (max=255, 12,972 nonzero RGB components), and SceneX/VisPy renders a streamed 2-D Image nonblank. Qt's offscreen platform cannot create the VisPy OpenGL context, so this reproduction uses native macOS Qt.
Description
A SceneX
Volumerendered through the VisPy backend produces an entirely black RGB frame, while the equivalent Image path and the PyGFX Volume path render nonblank frames.I encountered this while validating a Lodstone/SceneX streaming adapter, then reproduced it without Lodstone using a direct SceneX model.
Reproducer
On macOS with current SceneX main (
bc09fcf), VisPy + native Qt prints:The 2x dimensions reflect device pixel ratio and are expected. The zero max/count are not.
The same streamed volume through SceneX/PyGFX produces a nonblank frame (
max=255, 12,972 nonzero RGB components), and SceneX/VisPy renders a streamed 2-D Image nonblank. Qt's offscreen platform cannot create the VisPy OpenGL context, so this reproduction uses native macOS Qt.