bevyengine / bevyengine/bevy

When using multiple canvas, an error is displayed

Open
#15,137 1 comment 0 reactions 0 assignees View on GitHub
A-Rendering A-Windowing C-Bug O-Web S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version
bevy: 0.14.2

When using multiple windows on the WEBGL platform, the rendering position of the non-main window is displayed incorrectly, but WEBGPU is normal

## What you did
my code :

let second_window = commands
.spawn((
Window {
title: "xxx".to_owned(),
canvas: Some(canvas_id),
transparent: true,
composite_alpha_mode: if adapter.backend == wgpu_types::Backend::Gl
{
bevy::window::CompositeAlphaMode::default()
} else {
bevy::window::CompositeAlphaMode::PreMultiplied
},
fit_canvas_to_parent: false,
..default()
},
))
.id();

let second_window_camera = commands
.spawn((
Camera3dBundle {
tonemapping: Tonemapping::None,
camera: Camera {
target: RenderTarget::Window(WindowRef::Entity(second_window)),
..default()
},
..default()
},
))
.id();

## What went wrong
The second window is not displayed on the canvas

![image](https://github.com/user-attachments/assets/b860fe14-aec7-41f5-ac24-b7bdcaf55f69)

Contributor guide

Open the contributing guide

Research direction

Start from the reported multiple-window setup using Window with a canvas and Camera targeting RenderTarget::Window(WindowRef::Entity(second_window)). Compare the WebGL path, including CompositeAlphaMode::default(), with the working WebGPU path. Done means the second window is displayed at the correct position on its canvas under WebGL without regressing WebGPU.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.