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

Render layers to offscreen textures and composite them as a last step of rendering #39

Open
Kethku opened this issue Aug 13, 2024 · 0 comments

Comments

@Kethku
Copy link
Member

Kethku commented Aug 13, 2024

Doing this has a couple benefits:

  1. The textures can be retained and only rerendered if we detect that a layer has actually changed.
  2. Clip masks can be applied at the composite step rather than by primitive which may be faster
  3. Transparency effects like blurring can be done at composite time rather than by primitive which simplifies things and removes the need to copy to the offscreen texture between primitive draws.

To pull this off and get the full benefit we will need to track layer changes probably by diffing them or introducing a way to indicate whether a layer has actually changed at the api level. Text rendering will also have to change as we wont be able to composite directly and will have to store the text alphas separately using something like https://wgpu.rs/doc/wgpu/struct.Features.html#associatedconstant.MULTIVIEW.

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

No branches or pull requests

1 participant