Skip to content

How to get a transparent Canvas? #29

@panxinmiao

Description

@panxinmiao

I want to render some scenes to the desktop using a transparent window. This requires setting the alpha_mode to premultiplied in the CanvasContext.config() method.

I have added a flag in the wgpu glfw backend code with a line like this:
glfw.window_hint(glfw.TRANSPARENT_FRAMEBUFFER, True).

However, the alpha_mode="premultiplied" setting in the CanvasContext.config() method still seems to be unavailable.

The capable_alpha_modes here are always ['opaque'].
https://github.com/pygfx/wgpu-py/blob/0cdef1deb7033a15adb646d4b151d6d97cef954c/wgpu/backends/wgpu_native/_api.py#L449-L454

Am I missing something? How can we get a canvas that supports alpha_mode="premultiplied"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions