Skip to content
New issue

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

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

Already on GitHub? # to your account

Single-pass Compositing #2677

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Conversation

jellysquid3
Copy link
Member

@jellysquid3 jellysquid3 commented Aug 16, 2024

This is an early draft and should not be merged, as it currently breaks a few things and the code is very bad.

The idea of this pull request is to eliminate the overhead of rendering the vignette and the alpha blending of the entity outline buffer, which currently contributes to a significant amount of GPU time (sometimes 10%+ of the total frame time.)

We achieve this by creating a special compositing shader which blends these render targets in a single operation.

Additionally, some optimizations are made to how the main render target is configured. We don't need the alpha channel on the color attachment, and the depth texture can be converted to a depth buffer so that drivers are allowed to use specialized depth formats.

These patches, depending on the scene, can improve frame times by 5% to 15% on Intel Xe graphics under Linux. So it would seem a worthwhile investment to try and refine them further, since right now this is a fixed overhead that is always applied.

This is a very early revision of the idea. Some (most) things don't
work currently.
@jellysquid3 jellysquid3 added the T-enhancement Type: Enhancement label Aug 16, 2024
@jellysquid3
Copy link
Member Author

We might be able to pull out some parts of this into smaller pull requests, particularly the alpha-blending of the entity outline render target into the main render target.

@jellysquid3
Copy link
Member Author

Also, making this into something actually usable is not much of a priority for me right now. It will probably be revisited with Sodium 0.7 at the earliest, unless someone else decides to look into it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
T-enhancement Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant