-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Document image-based workaround for Line2D antialiasing #4441
Comments
Note that following the merge of godotengine/godot#43828, Line2D antialiasing should work reliably in 4.0. We should still document this workaround for 3.x. |
Drawing a straight 2d line is one of the basic functions of the engine. I can't find a solution to my problem anywhere and my thread has been closed. In my case this doesn't work correctly on GLES2 and GLES3. This work very well on unity and defold. |
@michaldev This very issue provides a workaround using the Line2D and a specially crafted texture (depending on the line width). Did you try it? Quoting my original comment on Reddit:
|
@michaldev It appears you're using a very bright color for your text, line and circle: Overbright colors will break antialiasing; this is the reason for a green fringe line appearing on the edge between the white line and the black background. Check the values of your various colors in your scene, including Modulate and Self Modulate properties – they must be between 0 and 1, not a brighter value. When setting a color by code with |
godot 4 alpha 3 still no antialiased thin lines. We are not in the 80s. |
The Vulkan renderer features portable line antialiasing using triangle strips: godotengine/godot#43828 However, the |
I recently released an add-on which automates the process described in this issue: https://github.com/godot-extended-libraries/godot-antialiased-line2d It supports antialiased 2D line and polygon drawing. |
Fixed by godotengine/godot#59952. |
I just played around with a project in Godot 4 Beta that uses Line2D, I know this is more of a feature-request/bug-report but I first want to verify I understood your comment (and the |
This is a known issue: godotengine/godot#62954 |
Thanks for letting me know, excuse my unnecessary comment. |
Your Godot version: 3.2.3
Issue description:
Line2D's antialiasing property is known not to be reliable:
Fortunately, you can use a specially crafted image for the Line2D to solve most of the aliasing issues with no performance impact. It won't anti-alias the line's begin and end caps (unless a circular cap mode is used), though. See https://www.reddit.com/r/godot/comments/k7qcwa/when_im_using_a_line2d_node_im_getting_horrible/.
When Mipmaps is enabled on the line texture, it should be possible to use a relatively tall image (like 1×128) to support pretty much every common line width, with good scaling support when using the
2d
stretch mode.See also #2379.
URL to the documentation page (if already existing): https://docs.godotengine.org/en/latest/classes/class_line2d.html
The text was updated successfully, but these errors were encountered: