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

When using multiple windows on webgl, an error is displayed #3916

Closed
zhuliang198754 opened this issue Sep 12, 2024 · 6 comments
Closed

When using multiple windows on webgl, an error is displayed #3916

zhuliang198754 opened this issue Sep 12, 2024 · 6 comments
Labels
B - bug Dang, that shouldn't have happened DS - web

Comments

@zhuliang198754
Copy link

Description

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

             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();

365890434-b860fe14-aec7-41f5-ac24-b7bdcaf55f69

Tested browsers

Chrome, Microsoft Edge

Tested devices

windows

Winit version

0.30

@zhuliang198754 zhuliang198754 added B - bug Dang, that shouldn't have happened DS - web labels Sep 12, 2024
@zhuliang198754 zhuliang198754 changed the title When using multiple windows - canvas, an error is displayed When using multiple windows on webgl, an error is displayed Sep 24, 2024
@zhuliang198754
Copy link
Author

I haven't found the problem yet, does anyone know the reason?

@daxpedda
Copy link
Member

daxpedda commented Oct 9, 2024

I'm unable to understand the bug report:

  • Where is the second "window" in the screenshot?
  • This is not the Bevy repository, it is Winit. However if a minimal reproducible example (even with Bevy) is given I'm willing to take a look.
  • "the rendering position of the non-main window is displayed incorrectly" what does that mean?
    • Do you mean its not rendered at the correct position?
    • How did you determine or set the position?
    • How is it incorrect?

I'm gonna go ahead and close this, but please tell us if you have any answers to these questions!

@daxpedda daxpedda closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2024
@zhuliang198754
Copy link
Author

zhuliang198754 commented Oct 10, 2024

I'm unable to understand the bug report:

  • Where is the second "window" in the screenshot?

  • This is not the Bevy repository, it is Winit. However if a minimal reproducible example (even with Bevy) is given I'm willing to take a look.

  • "the rendering position of the non-main window is displayed incorrectly" what does that mean?

    • Do you mean its not rendered at the correct position?
    • How did you determine or set the position?
    • How is it incorrect?

I'm gonna go ahead and close this, but please tell us if you have any answers to these questions!

@daxpedda

When more than two windows are instantiated and all windows are associated with canvas, the problem of display not being at the canvas position occurs.

@zhuliang198754
Copy link
Author

@daxpedda Only webgl is wrong

@daxpedda
Copy link
Member

the problem of display not being at the canvas position occurs.

What is a "display"?
Are you saying that what you draw is not drawn at the position of the canvas?


It would help if you try to answer the questions directly.

I did try this locally and everything seems to work correctly.
It might be an issue in Wgpu, see gfx-rs/wgpu#2343, I didn't try with Wgpu yet, but I will when I get to it.

@zhuliang198754
Copy link
Author

the problem of display not being at the canvas position occurs.

What is a "display"? Are you saying that what you draw is not drawn at the position of the canvas?

It would help if you try to answer the questions directly.

I did try this locally and everything seems to work correctly. It might be an issue in Wgpu, see gfx-rs/wgpu#2343, I didn't try with Wgpu yet, but I will when I get to it.

Thank you so much。It's the same situation gfx-rs/wgpu#2343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened DS - web
Development

No branches or pull requests

2 participants