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

Implement p_width in canvas_item_add_polyline #40866

Closed
wants to merge 1 commit into from

Conversation

lyuma
Copy link
Contributor

@lyuma lyuma commented Jul 30, 2020

Co-authored-by: K. S. Ernest (iFire) Lee ernest.lee@chibifire.com

Antialiasing is not implemented. We found two techniques which could be implemented.

Line width is used in pull request #40513 - Below is a screenshot showing the technique in use.
image

Bugsquad edit: Fixes #40845.

Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
@fire
Copy link
Member

fire commented Jul 30, 2020

Someone is questioning the supported status.

It is in vulkan but won't be in webgpu.

https://www.reddit.com/r/rust_gamedev/comments/evlwzo/wgpurs_how_to_specify_line_width_when_drawing/

@lawnjelly
Copy link
Member

lawnjelly commented Jul 30, 2020

I haven't looked at the renderer in 4.x yet, but this looks ok for something basic. The existing GLES2 and GLES3 renderers for TYPE_LINE do something like this (they use GL_LINES for an anti-aliased line around the edge).

What kind of results does this produce? Especially on sharp corners. It would be nice to see some pics with thicker lines. 😄 It might be easy to add a bevel but not sure if it is required.

The lack of anti-aliasing could also be a thing, which might be easier using a shader approach (as detailed in the linked article https://mattdesl.svbtle.com/drawing-lines-is-hard).

@erictuvesson
Copy link
Contributor

erictuvesson commented Oct 28, 2020

fixes #40845

Edit: wanted to add a reference between the issue and PR, but doesn't seem to work when I am not the author.

@reduz
Copy link
Member

reduz commented Nov 27, 2020

This is kind of an issue I did not get into yet because Vulkan does not support antialiased lines, and I am not sure which approach is the best we can take to work around this problem. Geometry shaders would work but they are not supported on mobile.

@Chaosus
Copy link
Member

Chaosus commented Nov 28, 2020

Superseded by #43828, thanks for attempting to fix it anyway!

@Chaosus Chaosus closed this Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

canvas_item_add_polyline does not handle width
7 participants