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

3D line example broken on web #14353

Closed
ShadowMitia opened this issue Jul 16, 2024 · 2 comments · Fixed by #14402
Closed

3D line example broken on web #14353

ShadowMitia opened this issue Jul 16, 2024 · 2 comments · Fixed by #14402
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples O-Web Specific to web (WASM) builds

Comments

@ShadowMitia
Copy link
Contributor

ShadowMitia commented Jul 16, 2024

Bevy version

Bevy 0.14

What you did

Go to 3D lines example here: https://bevyengine.org/examples/3d-rendering/lines/

What went wrong

I only see the gray background and nothing else.

Console log shows a lot of things, I think the relevant part is:

ERROR Device::create_render_pipeline error: Features Features(POLYGON_MODE_LINE) are required but not enabled on the device log.target = "wgpu_core::device::global";
log.module_path = "wgpu_core::device::global";
log.file = "/Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-0.21.1/src/device/global.rs";
log.line = 1636; wasm_example.js:435:21
ERROR Handling wgpu errors as fatal by default log.target = "wgpu::backend::wgpu_core";
log.module_path = "wgpu::backend::wgpu_core";
log.file = "/Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs";
log.line = 2995;

I can provide more info if necessary.

Additional information

Using Firefox 128 on Linux desktop.
Also didn't work on Firefox 128 on Android.

@ShadowMitia ShadowMitia added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jul 16, 2024
@mockersf
Copy link
Member

the error is

wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `opaque_mesh_pipeline`
    Features Features(POLYGON_MODE_LINE) are required but not enabled on the device

this can't work in WebGL2, POLYGON_MODE_LINE is not supported there

@janhohenheim janhohenheim added C-Examples An addition or correction to our examples O-Web Specific to web (WASM) builds A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Jul 17, 2024
@mosure
Copy link

mosure commented Jul 18, 2024

I see these warnings when drawing line gizmos on WebGPU /w RenderLayer specified:

Attribute offset (12) with format VertexFormat::Float32x3 (size: 12) doesn't fit in the vertex buffer stride (12).
 - While validating attributes[0].
 - While validating buffers[1].
 - While validating vertex state.
 - While calling [Device].CreateRenderPipeline([RenderPipelineDescriptor "LineGizmo Pipeline"]).
[Invalid RenderPipeline "LineGizmo Pipeline"] is invalid.
 - While encoding [RenderPassEncoder "main_transparent_pass_3d"].SetPipeline([Invalid RenderPipeline "LineGizmo Pipeline"]).

e.g.

        app.insert_gizmo_config(
            EditorCameraGizmoConfigGroup,
            GizmoConfig {
                render_layers: EDITOR_CAMERA_RENDER_LAYER,
                ..default()
            },
        );

...

fn draw(mut gizmos: Gizmos<EditorCameraGizmoConfigGroup>) {
        ....
        gizmos.line(
            start,
            end,
            color,
        );
}

github-merge-queue bot pushed a commit that referenced this issue Jul 29, 2024
…14402)

Fixes #14353
Fixes #14371

---------

Signed-off-by: Sarthak Singh <[email protected]>
Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: BD103 <[email protected]>
mockersf pushed a commit that referenced this issue Aug 2, 2024
…14402)

Fixes #14353
Fixes #14371

---------

Signed-off-by: Sarthak Singh <[email protected]>
Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: BD103 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples O-Web Specific to web (WASM) builds
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants