dimforge / dimforge/bevy_rapier

Collider debug lines are rendered behind the model

Open
#345 8 comments 1 reaction 0 assignees View on GitHub
A-Integration C-Bug D-Easy P-Medium S-not-started
Dominant language
Rust
Stars
1.6k
Forks
282
PR merge metrics
No merged PRs in 30d

Description

For some reason collider debug lines are always rendered behind geometry. This is especially bad when "ground" mesh is present because it completely covers debug lines.

Regular plugins init:
```rust
.add_plugin(RapierDebugRenderPlugin {
enabled: true,
always_on_top: true,
..default()
})
```

Adding rapier stuff when scene is loaded (in my case I need to add it only after snene is available):
```rust
commands.entity(entity)
.insert(RigidBody::Fixed)
.insert(Collider::cuboid(1.0, 0.5, 1.0))
.insert(ColliderDebugColor(Color::CYAN))
.insert(SceneBundle { scene: hull.default_scene.clone().unwrap(), ..default() })
```

And here is a result:

https://user-images.githubusercontent.com/1215187/225895577-b1871e92-7431-4671-93ea-c24985e874c5.mov

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with RapierDebugRenderPlugin configured with always_on_top and a ground mesh, using the scene-loading example in the report. Start by tracing the debug renderer's depth or draw-order handling; done means collider debug lines remain visible in front of geometry when always_on_top is true.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.