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

Stencil tests for GUI elements #1538

Open
3 tasks
heinezen opened this issue Sep 17, 2023 · 0 comments
Open
3 tasks

Stencil tests for GUI elements #1538

heinezen opened this issue Sep 17, 2023 · 0 comments
Labels
area: renderer Concerns our graphics renderer area: ui Related to the graphical user interface (Qt) improvement Enhancement of an existing component lang: c++ Done in C++ code

Comments

@heinezen
Copy link
Member

This could be a rather small optimization for the renderer. The idea is to save rendering time by not rendering pixels in the game world that would be hidden by GUI elements anyway. To do this, we would create a stencil mask from opaque elements in the GUI and apply this mask in all other render passes. Doing this allows the GPU to discard fragments masked by the stencil mask early and save some time during rendering as a result.

The time save depends on a few conditions. For example, the stencil test gets more effective if the GUI covers large parts of the screen and the elements don't change positions. However, this should be at least the case for the old AoE1/AoE2/SWGB GUIs.

Tasks:

  • Enable stencil tests in renderer
  • Create stencil mask from GUI texture
  • Upload stencil mask to renderer in other render stages (skybox, terrain, world, ....)
@heinezen heinezen added improvement Enhancement of an existing component area: renderer Concerns our graphics renderer lang: c++ Done in C++ code area: ui Related to the graphical user interface (Qt) labels Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: renderer Concerns our graphics renderer area: ui Related to the graphical user interface (Qt) improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects
Status: 🔖 TODO
Development

No branches or pull requests

1 participant