Skip to content

Add binned 2d/3d Wireframe render phase #18587

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

Merged
merged 17 commits into from
Apr 9, 2025

Conversation

tychedelia
Copy link
Contributor

@tychedelia tychedelia commented Mar 28, 2025

Objective

Fixes #16896
Fixes #17737

Solution

Adds a new render phase, including all the new cold specialization patterns, for wireframes. There's a lot of regrettable duplication here between 3d/2d.

Testing

All the examples.

Migration Guide

  • WireframePlugin must now be created with WireframePlugin::default().

@tychedelia tychedelia added this to the 0.16 milestone Mar 28, 2025
@tychedelia tychedelia added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 28, 2025
@tychedelia tychedelia changed the title Add binned Wireframe phase Add binned 2d/3d Wireframe render phase Mar 28, 2025
@hukasu
Copy link
Contributor

hukasu commented Mar 29, 2025

And #17737 ?

Copy link
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to remove a bit of duplication between 2d and 3d, but it's fine as is.

color: vec4<f32>,
};
struct PushConstants {
color: vec4<f32>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI push constants aren't available on WebGPU. Idk how we feel about requiring them for wireframes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wireframes require the POLYGON_MODE_LINE feature which isn't available on web.

@tychedelia tychedelia requested a review from JMS55 April 1, 2025 05:27
Copy link
Contributor

@BenjaminBrienen BenjaminBrienen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before
image

2025-04-06T19:46:04.258711Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux (Pop!_OS 22.04)", kernel: "6.12.10-76061203-generic", cpu: "AMD Ryzen 9 7950X 16-Core Processor", core_count: "16", memory: "61.9 GiB" }    
2025-04-06T19:46:04.402175Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3070", vendor: 4318, device: 9348, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "565.77", backend: Vulkan }
2025-04-06T19:46:04.943835Z  INFO bevy_winit::system: Creating new window wireframe (0v1)
2025-04-06T19:46:04.943952Z  INFO winit::platform_impl::linux::x11::window: Guessed window scale factor: 2
2025-04-06T19:46:05.323457Z  WARN bevy_render::view::window: Couldn't get swap chain texture after configuring. Cause: 'The underlying surface has changed, and therefore the swap chain must be updated'
2025-04-06T19:46:05.349754Z  WARN bevy_render::view::window: Couldn't get swap chain texture after configuring. Cause: 'The underlying surface has changed, and therefore the swap chain must be updated'
2025-04-06T19:46:21.165852Z  INFO bevy_window::system: No windows are open, exiting    
2025-04-06T19:46:21.168408Z  INFO bevy_winit::system: Closing window 0v1

after
image

2025-04-06T19:43:56.514546Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux (Pop!_OS 22.04)", kernel: "6.12.10-76061203-generic", cpu: "AMD Ryzen 9 7950X 16-Core Processor", core_count: "16", memory: "61.9 GiB" }    
2025-04-06T19:43:56.663878Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3070", vendor: 4318, device: 9348, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "565.77", backend: Vulkan }
2025-04-06T19:43:57.231557Z  INFO bevy_winit::system: Creating new window App (0v1)
2025-04-06T19:43:57.231678Z  INFO winit::platform_impl::linux::x11::window: Guessed window scale factor: 2
2025-04-06T19:43:57.497651Z  WARN bevy_render::view::window: Couldn't get swap chain texture after configuring. Cause: 'The underlying surface has changed, and therefore the swap chain must be updated'
2025-04-06T19:43:57.538660Z  WARN bevy_render::view::window: Couldn't get swap chain texture after configuring. Cause: 'The underlying surface has changed, and therefore the swap chain must be updated'
2025-04-06T19:44:01.095167Z  WARN bevy_render::view::window: Couldn't get swap chain texture after configuring. Cause: 'The underlying surface has changed, and therefore the swap chain must be updated'
2025-04-06T19:44:07.322743Z  INFO bevy_window::system: No windows are open, exiting    
2025-04-06T19:44:07.325725Z  INFO bevy_winit::system: Closing window 0v1

@BenjaminBrienen BenjaminBrienen added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it D-Complex Quite challenging from either a design or technical perspective. Ask for help! and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 6, 2025
@BenjaminBrienen BenjaminBrienen added the D-Shaders This code uses GPU shader languages label Apr 6, 2025
@superdump superdump added this pull request to the merge queue Apr 9, 2025
Merged via the queue into bevyengine:main with commit e799625 Apr 9, 2025
32 checks passed
@github-project-automation github-project-automation bot moved this to Done in Rendering Apr 9, 2025
mockersf pushed a commit that referenced this pull request Apr 9, 2025
# Objective

Fixes #16896
Fixes #17737

## Solution

Adds a new render phase, including all the new cold specialization
patterns, for wireframes. There's a *lot* of regrettable duplication
here between 3d/2d.

## Testing

All the examples.

## Migration Guide
- `WireframePlugin` must now be created with
`WireframePlugin::default()`.
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 D-Complex Quite challenging from either a design or technical perspective. Ask for help! D-Shaders This code uses GPU shader languages S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Wireframe on 2d_shapes example is just an outline Materials not displaying correctly in wireframe example
6 participants