GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Reactive rendering · Issue #1018 · fastplotlib/fastplotlib

Reactive rendering #1018

New issue
Copy link
New issue
Copy link
Open
Open
Reactive rendering#1018
Copy link

Description

@kushalkolar
kushalkolar
opened on Mar 18, 2026
Issue body actions

Follow up from #1017 . Right now a subplot is rendered even if nothing has changed in it, this is expensive when we have lots of subplots and especially when we have lots of docks with the HistogramLUTTool next to images. I think we can implement reactive rendering like this:

  • Graphic has a method Graphic.flag_update() which is called whenever anything about a graphic changes. This just sets PlotArea.flag_update = True. PlotArea.render() does nothing if PlotArea.flag_update is False.
  • The camera also sets PlotArea.flag_update when its state changes, not entirely sure how to do that yet.

If we do use the plot area flag, if something about a graphic changes we should do the check only if it's False.

@clewis7 thoughts?

Activity

  1. kushalkolar commented on Mar 18, 2026

    @kushalkolar
    kushalkolar
    on Mar 18, 2026
    MemberAuthor
    More actions

    For buffers we can probably use this:

    https://github.com/pygfx/pygfx/blob/main/pygfx%2Fresources%2F_base.py#L21-L22

    Need to see if we can do a similar thing for uniforms on materials.

  2. kushalkolar commented on Mar 19, 2026

    @kushalkolar
    kushalkolar
    on Mar 19, 2026
    MemberAuthor
    More actions

    @almarklein quick question, is there a nice way to know if anything about a WorldObject has changed? The geo, a geo buffer, material, or a material prop?

  3. almarklein commented on Mar 27, 2026

    @almarklein
    almarklein
    on Mar 27, 2026
    Collaborator
    More actions

    Sorry, I missed this earlier. No, there's not a good way to do this currently. It would also be really hard to implement. A material does not know to what objects it is attached. So setting a prop on the material is not easily propated up the tree. It would be possible (with some changes in a few places) to traverse the tree and check for some sort of version number or dirty flag, but that traversal would be expensive.

  4. kushalkolar commented on Mar 27, 2026

    @kushalkolar
    kushalkolar
    on Mar 27, 2026
    MemberAuthor
    More actions

    Will think more about this. We might be able to get away with setting a flag when a graphic feature set_value is called, or when the material changes.

  5. almarklein commented on Mar 30, 2026

    @almarklein
    almarklein
    on Mar 30, 2026
    Collaborator
    More actions

    I think that could make sense. In PyGfx the separation in object / material / geometry works against us for this particular use-case. But in FPL the object model is simpler, which gives the opportunity to do this. If possible, you want to set a flag at the view/subplot/scene, to avoid iterating over possibly 1000ths objects at render-time.

  6. kushalkolar commented on Apr 13, 2026

    @kushalkolar
    kushalkolar
    on Apr 13, 2026
    MemberAuthor
    More actions

    Thanks Almar!

    Did some basic benchmarking and we definitely need reactive rendering, huge performance benefit. Double fps easily.

    wtf-reactive-epic-2026-04-13_17.23.05.mp4

    It needs the following:

    • meshes in underlay render pass should only have geometry for the frame so they can be drawn regardless of the subplot's dirty state
    • Need to allow flushing render with alpha blending, been playing around with this in the renderer will post on pygfx and probably do a PR. Overlay render pass should be flushed with this alpha blend. Overlay render pass also needs a settable dirty flag.
  7. kushalkolar commented on May 4, 2026

    @kushalkolar
    kushalkolar
    on May 4, 2026
    MemberAuthor
    More actions

    4am thoughts: I might be able to get away with just registering an event handler on all graphic features and having those set a flag. PlotArea uses this flag if the render_mode = "reactive". Should benchmark if firing graphic feature events at 60-100Hz across all these graphics is too much overhead.

  8. almarklein commented on May 14, 2026

    @almarklein
    almarklein
    on May 14, 2026
    Collaborator
    More actions

    Not sure if this fits, but I'd create a tiny object. Something like this:

    class UpdateFlag:
        is_set = False
       def set(self):
           self.is_set = True

    Have one of these for each view/canvas. Pass the object to each graphic, and make the graphic call flag.set() whenever anything changes.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.