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

Daguerreo - Package setup #33

Open
2 of 5 tasks
Joery-M opened this issue May 7, 2024 · 0 comments · May be fixed by #338
Open
2 of 5 tasks

Daguerreo - Package setup #33

Joery-M opened this issue May 7, 2024 · 0 comments · May be fixed by #338
Assignees
Labels
Daguerreo Will affect Daguerreo

Comments

@Joery-M
Copy link
Owner

Joery-M commented May 7, 2024

Daguerreo is the name of the first renderer for Safelight.

Name

The name originates from Daguerreotype, which is the first publicly available photographic process, and since this is the first renderer for Safelight. I think it fits.

Technology

Daguerreo will use OffscreenCanvas and will be able to send the rendering context between effects to be processed.

Here's an example of a render process for a frame.

  1. Initial image is taken from the source effect.
  2. Rendering context is sent to the first effect.
  3. Rendering context is sent to the second effect.
  4. Image is sent to the screen.

Possible pain points:

  • Effects that affect how the resulting image is composited could be difficult. For example: blend modes.
  • Effects could scale the source in a way that clips out parts of the image.
  • Web workers could be used to render multiple frames at a time, but effects would have to manage state using transferables.
  • Switching to a different rendering engine in the future could be difficult, but that is not really relevant now.
  • Since VideoEncoder will be used, encoding will be limited to what the browser supports.

Remedies:

  • Blend modes could be built into Daguerreo, and always be available. at the moment I can't think of any other effects that affect compositing.
  • Effects can modify a DOMMatrix, which will transform the end result
  • The entire effect object would have to be executed inside workers, including their local state outside of properties.
  • Maybe WebAssembly could be used to port certain encoders to the browser, but I have zero experience with that.

Advantages:

  • By using regular canvas, it will be possible to switch to WebGL (or WebGPU) if performance seems to be an issue.
  • Using web workers is possible. And probably required.

Requirements:

  • A source effect that can interpret the data from Media file #287 and render it.
  • A difference between rendering to export and previewing needs to be able to be defined.
  • When rendering to export, a file needs to be produced, either by using the file system API and writing directly, or by writing chunks to IndexedDB. For in the future
  • Effects need to be able to set data for the next effect.
  • Current rendering state needs to be able to be serialized. Will have to be done externally to properly integrate things like property keyframes

Notes:

  • For now, web workers shouldn't be used. I need more experience with them.
  • Unless if performance is an issue, 2D context should be used for now. (Note: Firefox struggles a bit, so this decision should be reconsidered in the future)
@Joery-M Joery-M added the Daguerreo Will affect Daguerreo label May 7, 2024
@Joery-M Joery-M self-assigned this May 7, 2024
@Joery-M Joery-M added this to the Rendering and exporting milestone Sep 26, 2024
@Joery-M Joery-M linked a pull request Dec 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daguerreo Will affect Daguerreo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant