Skip to content

Comments

Share scenes between subplots#973

Draft
Vipitis wants to merge 4 commits intofastplotlib:mainfrom
Vipitis:share-scene
Draft

Share scenes between subplots#973
Vipitis wants to merge 4 commits intofastplotlib:mainfrom
Vipitis:share-scene

Conversation

@Vipitis
Copy link

@Vipitis Vipitis commented Jan 12, 2026

Resolves #952

I followed the suggestion and mostly copied the code for controller_ids. And doing the scene creation further up (but hopefully not breaking existing functionality).

Here is the current state by modifying one of the controller examples, I will try to find time to add like a multi object tracking example instead.

bad_example.mp4

With the Axes from other subplots being part of the scene it's a bit awkward. Not sure how viable it is, but having a few parts of the scene be "per subplot" (axes, screen space text labels, LUT) while the rest is shared (meshes, images, materials, etc)?... Not sure what pygfx enables - but I will think about it and have a look.

draft as there is still a lot of stuff broken, I will hopefully find some more free time next weekend/monday.

@kushalkolar
Copy link
Member

kushalkolar commented Jan 13, 2026

A good start! The axes is funny 😂. Maybe an overlay render pass should be used for axes in orthographic projections, or have them fixed and intersect at the origin.

I think text is rendered fine, do you have an example where it's an issue? Also what do you mean by LUT here?

@Vipitis
Copy link
Author

Vipitis commented Jan 13, 2026

instead of calling it scene_ids it would also work as camera_ids (Or views). I will try mixing orthographic and perspective cameras in a 3D scene and show how that works and looks, especially with text.

A lookup table would essentially be like a color map, but for the camera instead of the data/material. So you can have different views onto the same data.

@kushalkolar
Copy link
Member

actually I think we can do an independent scene per-subplot which has 2 scenes, one has the rulers and another is identical between the "subplots that share a scene but have different cameras". I think that would be the easiest solution.

@Vipitis
Copy link
Author

Vipitis commented Feb 4, 2026

hey, I agree something like this would make most sense. Also had the idea of keeping one scene per plot but sharing graphics (including their world objects)... Not deep enough into pygfx to understand what's possible.

Sadly I am a bit low on free time recently and this dropped really far down on my priorities. I don't want to be a blocker or anything so feel free to do close/commit etc if you want to. It will probably remain stale from my side for a few more weeks.

@kushalkolar
Copy link
Member

No rush! I just came up with the idea because a user just asked me about a use case similar to this.

1 similar comment
@kushalkolar
Copy link
Member

No rush! I just came up with the idea because a user just asked me about a use case similar to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking example with detailed view

2 participants