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

draw_polyline skips lines in GLES2 #38703

Closed
mini-glitch opened this issue May 12, 2020 · 4 comments
Closed

draw_polyline skips lines in GLES2 #38703

mini-glitch opened this issue May 12, 2020 · 4 comments

Comments

@mini-glitch
Copy link

Godot version:
3.2.1 stable

OS/device including version:
Windows 10
macOS Catalina 10.15.1

Issue description:
When the video driver is set to GLES2, draw_polyline skips every other line, giving a dashed line effect. Switching to GLES3 resolves this issue.

GLES2:
gles2

GLES3:
gles3

Steps to reproduce:
Call draw_polyline with any set of points. Change video driver between GLES2 and GLES3 to observe difference.

Minimal reproduction project:
Polyline_Test.zip

@allkhor
Copy link
Contributor

allkhor commented May 13, 2020

Confirmed on Godot v3.2.2.beta.custom_build. e42318e
OS: Xubuntu 16.04.6 LTS
Workaround: change default width to:
draw_polyline(circle_points, Color.white, 1.0000001).

@Calinou
Copy link
Member

Calinou commented May 14, 2020

draw_polyline(circle_points, Color.white, 1.0000001).

It solves the issue because it makes Godot use triangle strips to draw lines rather than OpenGL's line primitives. See #38417.

@lawnjelly
Copy link
Member

lawnjelly commented May 14, 2020

The problem is actually simple! GLES3 is drawing a polyline as a GL_LINE_STRIP (each new vertex adds a new linked line) and GLES2 is drawing it as GL_LINES (each pair of vertices forms a line).

All we need to do is agree on a standard so they both do the same thing! 😀

Edit: I'm guessing from the instructions that polyline is meant to be joined lines, and that is what the triangle version does in GLES2 as well.

I'll do a little PR that changes it to GL_LINE_STRIP. However it's slightly controversial in that while the behaviour is different (and probably wrong) in GLES2, people may have already written games that rely on this. I'll do the PR anyway and let the authorities decide. 👍

@akien-mga
Copy link
Member

Fixed by #38734.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants