Skip to content

wireframe not shown on the back of a surface #4819

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

Open
jack1232 opened this issue May 21, 2022 · 1 comment
Open

wireframe not shown on the back of a surface #4819

jack1232 opened this issue May 21, 2022 · 1 comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior

Comments

@jack1232
Copy link

jack1232 commented May 21, 2022

Bevy version

bevy = { git = "https://github.com/bevyengine/bevy", rev="7cb4d3c"}

Operating system & version

Windows 11, Nvidia GeForce RTX 3060 with a Vulkan backend.

What you did

I created a simple 3D surface using a Sinc function. This is an open surface and needs to display both the front-facing and back-facing sides, so I set the double_sided field to true and cull_mode to None when creating material:

       material: materials.add(StandardMaterial{
           base_color: Color::rgba(1., 1., 1., 0.).into(),
           double_sided:true,
           cull_mode: None,
           ..default()
       }),

I then inserted the wireframe to this surface and got unexpected results: the wireframe is displayed only on the front face, as shown in this image:

bevy01_gif

What you expected to happen

The wireframe should be on both sides. I recreated this surface using the WebGPU and wgpu directly. Both the WebGPU and wgpu give the same results, as shown in this image:

bevy02_gif

You can see that the wireframe is on both sides. Since the bevy engine is based on wgpu, I don't understand why the wireframe is only on the front face in bevy.

Additional information

It is good to see that bevy is trying to improve wireframe with a specified color. #3677. I would like to suggest bevy to develop a wireframe similar to that in a Python version wgpu render engine called pygfx. pygfx not only creates a wireframe on both sides of a surface, but also allows the wireframe to have different colors on each side of itself, as shown here:

bevy04_gif

In addition, the pygfx engine lets change the thickness of the wireframe, which is hard to do in the original WebGPU and wgpu where the line width is fixed to 1px. Here shows the Sinc surface-wireframe with a yellow color and a thickness of 4px, which I created using pygfx.

bevy03_gif

This link shows the approach used in pygfx to implement wireframe with a specified thickness.

@jack1232 jack1232 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 21, 2022
@bjorn3 bjorn3 added the A-Rendering Drawing game state to the screen label May 21, 2022
@alice-i-cecile alice-i-cecile removed the S-Needs-Triage This issue needs to be labelled label May 28, 2022
@alice-i-cecile
Copy link
Member

I think these are all fantastic suggestions, and would welcome PRs to implement this.

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
Projects
None yet
Development

No branches or pull requests

3 participants