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

Odd gizmo line thickness depending on camera angle #9409

Closed
rparrett opened this issue Aug 10, 2023 · 1 comment
Closed

Odd gizmo line thickness depending on camera angle #9409

rparrett opened this issue Aug 10, 2023 · 1 comment
Labels
A-Gizmos Visual editor and debug gizmos C-Bug An unexpected or incorrect behavior

Comments

@rparrett
Copy link
Contributor

rparrett commented Aug 10, 2023

Bevy version

Tested 0.11, 0.11.1, and current main.

Relevant system information

AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
SystemInfo { os: "MacOS 13.4.1 ", kernel: "22.5.0", cpu: "Apple M1 Max", core_count: "10", memory: "64.0 GiB" }

What you did

I noticed this after enabling rapier debug rendering while migrating a project from 0.10 to 0.11. Rapier uses two lines with large extents to represent halfspace colliders. One was displayed very thick and one was very thin.

Here's a minimal reproducer:

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Startup, setup)
        .add_systems(Update, system)
        .run();
}

fn setup(mut commands: Commands) {
    commands.spawn(Camera3dBundle {
        transform: Transform::from_xyz(10., 10.75, 14.).with_rotation(Quat::from_euler(
            EulerRot::XYZ,
            -0.983,
            0.,
            0.,
        )),
        ..default()
    });
}

fn system(mut gizmos: Gizmos) {
    gizmos.line(
        [10000.0, -20.0, 0.0].into(),
        [-10000.0, -20.0, 0.0].into(),
        Color::hsla(30.0, 1.0, 0.4, 1.0),
    );

    gizmos.line(
        [0.0, -20.0, -10000.0].into(),
        [0.0, -20.0, 10000.0].into(),
        Color::hsla(30.0, 1.0, 0.4, 1.0),
    );
}

What went wrong

I would expect to see two crossed lines of similar thickness. I'm not familiar enough with gizmos to say what sort of thickness is appropriate.

Instead, we get one very thick line and one very thin line. This behavior changes depending on the camera angle.

image
@rparrett rparrett added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled A-Gizmos Visual editor and debug gizmos and removed S-Needs-Triage This issue needs to be labelled labels Aug 10, 2023
@rparrett
Copy link
Contributor Author

Fixed by #9470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Gizmos Visual editor and debug gizmos C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

2 participants