Skip to content

Transparent windows on wayland must be pre-multiplied after transfer-function encoding #19797

Open
@mahkoh

Description

@mahkoh

Bevy version

0.17

What you did

Run the transparent_window example.

What went wrong

There is fringing where the bevy logo is translucent.

Additional information

Wayland assumes that pre-multiplication is performed after transfer-function encoding. There is no way to achieve this in Vulkan with built-in functionality, therefore I think the simplest solution to achieve this is as follows:

  1. Keep everything else as is.
  2. Immediately before presentation, run the following compute shader on the swapchain image:
    1. Apply the sRGB EOTF
    2. Unpremultiply
    3. Apply the sRGB OETF
    4. Premultiply

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WindowingPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorO-LinuxSpecific to the Linux desktop operating systemO-VulkanSpecific to the Vulkan render APIS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions