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

Experimental Progress Tracker #3817

Open
2 of 12 tasks
JasonGrace2282 opened this issue Jun 22, 2024 · 0 comments
Open
2 of 12 tasks

Experimental Progress Tracker #3817

JasonGrace2282 opened this issue Jun 22, 2024 · 0 comments
Assignees
Labels
breaking changes This PR introduces breaking changes help wanted We would appreciate help on this issue/PR opengl Concerning the OpenGL renderer. refactor Refactor or redesign of existing code tracking
Milestone

Comments

@JasonGrace2282
Copy link
Contributor

JasonGrace2282 commented Jun 22, 2024

Experimental Progress Tracking

Before merging into Main

Nice to have

The following would be nice to have, but could also be implemented in follow-up PRs to reduce the diff.

  • Add support for "exotic" stuff (Scene subclasses, ImageMobject, Meshes, etc.)
  • Support (of some kind) for sections in scenes
  • Double pass rendering to decouple Scene and Manager

Follow-Ups

  • Caching
  • Plugin Hooks

Timeline Goals

  • v0.20.0: Experimental should have most tests passing
  • v0.21.0: Experimental should be released, and the follow-ups should be in the process of being implemented.

But... Why?

Motivation

The current Manim codebase is very entangled. To give you a sense of what I mean, let's look at an example.
The renderer has access to a file writer. The Scene has access to the renderer, and as such indirectly to the file writer as well. But the renderer also has a reference to the scene. To make matters worse, at some points in time animations also have references to the scene (sometimes), and much more. This is an attempt to clean that up by introducing a Manager class whose sole job is to orchestrate communication between the Scene, FileWriter, and a Renderer.

Additionally, the current implementation of renderers (OpenGL mainly, but Cairo as well) in Manim is unmaintainable. The OpenGLMobject contains shaders inside itself! This means in the future if we ever want to allow more types of renderers (e.g. Metal for MacBooks), we'd have to create a third base Mobject, and a new Camera, which is just stupid. Instead, *Mobjects should be renderer independent, and all the renderer specific stuff should be inside a class implementing the RendererProtocol.

New Structure

image
Here you can see every class has its own responsibilities. The Camera is responsible for the FOV, the Scene for orchestrating animations, Mobjects have no dependency with the renderer, and the Renderer only cares about a SceneState, not the actual Scene.

@JasonGrace2282 JasonGrace2282 added this to the Refactor milestone Jun 22, 2024
@JasonGrace2282 JasonGrace2282 pinned this issue Jun 23, 2024
@JasonGrace2282 JasonGrace2282 added enhancement Additions and improvements in general help wanted We would appreciate help on this issue/PR breaking changes This PR introduces breaking changes opengl Concerning the OpenGL renderer. refactor Refactor or redesign of existing code and removed enhancement Additions and improvements in general labels Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking changes This PR introduces breaking changes help wanted We would appreciate help on this issue/PR opengl Concerning the OpenGL renderer. refactor Refactor or redesign of existing code tracking
Projects
Status: 🏗 In progress
Development

No branches or pull requests

2 participants