-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rework to use new bevy rendering pipeline Regressions: * Does not work in 2d anymore * The depth check option is now always on * Removed user Lines (not sure what their purpose was tbh) Improvements: * Does work with the new renerer * Uses wgsl I wrote TODOs laying out improvement paths. There are a few performance low-hanging fruits available. The depth check is kind of a monster. I wanted to have something out before trying it, because I'm strongly considering a uniform for this, so that the depth test can be modified at run time and is probably going to tank performance. Uploading uniforms to GPU under the new renderer requires an awful lot of additional code, due to the nature of wgpu, but it seems completely possible, just check the `shader_material` example in the bevy repository. * Separate retained and immediate lines The persisting lines now are treated and stored separately from the temporary ones. This simplifies the logic for the temporary ones, and since it's the general case, it should improve performance. * Remove indices of immediate mod line meshes With bevyengine/bevy#3415 it is now possible to upload meshes to GPU without `indices` set. Before, it would panic. Removing `indices` enables us to simply remove the `ImmLinesStorage::fill_indices` code, since the ordering is exactly as the GPU would interpret the mesh otherwise. * follow bevy main HEAD * Add back depth check configuration It is configured through the plugin constructor now. It makes more sense than through the `DebugLines` resource, since it's configured at the beginning and won't change in the middle of running the plugin. This was already true before, the difference is that it is now made explicit to the user. * Refactor LineStorage to use line over vertex index At the cost of making the `RetLineStorage::fill_indices` and `mark_expired` methods a bit more complex, it is possible to only store the line index rather than two point indices of expired lines. This should encapsulate neatly the complex underlying storage that mirrors the mesh attribute buffers. Other side benefit is that `timestamp` and `expired` vectors have their size divided by two. I also added the `Line<T>` struct to make the arguments to mutating methods of LineStorage more understandable. * Remove references to thickness in examples * Refactor and document Various name changes and extra doc string. Also fixes a likely issue with `mark_expired`, which would add duplicates to the `expired` stack. * Add back 2d renderning This however, requires adding a feature flag :/ * Update bevy dependency to 0.6 * Revert to exposing DebugLines as a bevy Resource * Fix minor spelling errors * Do not bump already-bumped version
- Loading branch information
Showing
15 changed files
with
776 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
authors = ["Michael Palmos <[email protected]>"] | ||
categories = ["game-engines", "rendering", "game-development"] | ||
description = "A prototype plugin providing a simple line drawing API for bevy." | ||
edition = "2018" | ||
edition = "2021" | ||
homepage = "https://github.com/Toqozz/bevy_debug_lines" | ||
keywords = ["debug", "line", "graphics", "bevy", "drawing"] | ||
license = "MIT" | ||
|
@@ -13,37 +13,34 @@ version = "0.4.0" | |
exclude = ["demo.gif", "demo_2.png", "demo_2.webm"] | ||
|
||
[dependencies] | ||
bevy = "0.5" | ||
|
||
[patch.crates-io] | ||
bevy = { git = "https://github.com/bevyengine/bevy", default-features = false, features = [ | ||
"render", | ||
] } | ||
bevy = { version = "0.6", default-features = false, features = [ "render" ] } | ||
|
||
[features] | ||
example_deps_2d = [ | ||
"bevy/bevy_winit", | ||
"bevy/bevy_gltf", | ||
"bevy/x11", | ||
] | ||
example_deps = [ | ||
"bevy/bevy_wgpu", | ||
"bevy/bevy_winit", | ||
"bevy/bevy_gltf", | ||
"bevy/x11", | ||
"3d", | ||
] | ||
3d = [] | ||
|
||
[[example]] | ||
name = "3d" | ||
required-features = ["example_deps"] | ||
|
||
[[example]] | ||
name = "2d" | ||
required-features = ["example_deps"] | ||
required-features = ["example_deps_2d"] | ||
|
||
[[example]] | ||
name = "bench" | ||
required-features = ["example_deps"] | ||
|
||
[[example]] | ||
name = "user_lines" | ||
required-features = ["example_deps"] | ||
|
||
[[example]] | ||
name = "depth_test" | ||
required-features = ["example_deps"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.