Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework postprocessor handling in GLMakie #4689

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Dec 24, 2024

Description

This pr aims to rework and streamline postprocesser handling. I would like to implement a system similar to Nodes in Blender or Unreal Blueprints to handle the render pipeline. I.e. describe the various operations in render_frame() (z sorting, rendering plots, running postprocessors) as Nodes with connectable inputs and outputs. These nodes and edges should be free of OpenGL, i.e. an abstraction of what the backend is doing. Resolving them should produce a set of necessary buffers for data transfer and a pipeline of backend tasks to run in render_frame.

TODO/Plans/Changes:

  • extract OpenGL parts of GLFramebuffer and move them to GLAbstraction
  • rework PostProcessor type to better represent a renderloop task (generic abstract type with specialized implementations, try using dispatched function)
  • add task for rendering
  • add task for z sorting
  • maybe add task for setup!()
  • switch to one GLFramebuffer per task (as needed) instead of one global framebuffer
  • if needed, implement GLFence for synching between framebuffers
  • add a FramebufferFactory which holds onto all attachments, adds new ones as required and distributes them to postprocessors
  • create and connect abstract RenderPipeline prototype
  • Makie render pipeline: add optional requirements to BufferFormat (e.g. clamping, filter, mipmap, multisample?)
  • Makie render pipeline: cleanup is_compatible_with() (only used symmetrical variant)
  • cleanup old GLAbstraction.Framebuffer
  • derive fragment_output from gl-render pipeline (i.e. base shader outputs off the relevant framebuffer)
  • reconsider/cleanup:
    • frame setup!()
    • fxaa/ssao render stage
    • handling of colorbuffer, depthbuffer, picking (i.e. hardcoded names?)
  • more directly integrate Makie Renderpipeline with Screen()
  • improve usability of Makie render pipeline

Note: I started with this on #4150 and figured these changes can be done independently and are probably also useful independently. There is still some code related to that pr in here (e.g. glscene mentions) and I will probably make some decisions with that pr in mind.
Note 2: I'm mainly creating a pr for this now to get a benchmark and test history going.

Type of change

Delete options that do not apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

... or maybe just internal rework for now?

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@MakieBot
Copy link
Collaborator

MakieBot commented Dec 24, 2024

Benchmark Results

SHA: 84872f2cc5588a2ac62b41052cc18c9fe4795743

Warning

These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking.

GLMakie
CairoMakie
WGLMakie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Work in progress
Development

Successfully merging this pull request may close these issues.

2 participants