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

Viewport windows: rendering issue when using transparent title bar color under macOS / Metal or Vulkan #7181

Closed
pthom opened this issue Dec 29, 2023 · 3 comments

Comments

@pthom
Copy link
Contributor

pthom commented Dec 29, 2023

Version/Branch of Dear ImGui:

Version: v1.90.0
Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: Metal or Vulkan + SDL or Glfw
Operating System: macOS

My Issue/Question:

Viewport windows' title may show rendering issues when the title bar color is partially transparent, when using Metal or Vulkan.

This happens on the docking branch, with viewports enabled, when a window is dragged out of the main window.

Stability is not affected, and a simple workaround is to not use transparent colors for the title bar.

Screenshots/Video

image

rendering issue

(link to giphy source if the above screenshot does not work)

Standalone, minimal, complete and verifiable example:

Add this:

    style.Colors[ImGuiCol_TitleBg].w = 0.5f;
    style.Colors[ImGuiCol_TitleBgActive].w = 0.5f;
    style.Colors[ImGuiCol_TitleBgCollapsed].w = 0.5f;

before the main loop inside examples/example_glfw_vulkan/main.cpp or examples/example_glfw_metal/main.mm

@PathogenDavid
Copy link
Contributor

This is half unimplemented feature half bug. The glitchiness you're seeing is the gabled stale contents of the back buffer.

The unimplemented feature is that transparency is not supported for secondary viewports. (It's a non-trivial problem, see #2766)

The bug is that the alpha isn't being ignored like it is for the window background or collapsed window title bar. I've submitted a fix here: #7184

@ocornut
Copy link
Owner

ocornut commented Dec 30, 2023

Fixed indeed, thank you David.

We set ImGuiViewportFlags_NoRendererClear to instruct backend that they can avoid clearing the framebuffer, and full-transparency support will not be able to set this flag but it's a nice little optimization for when we can.

@ocornut ocornut closed this as completed Dec 30, 2023
@pthom
Copy link
Contributor Author

pthom commented Dec 30, 2023

Many thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants