-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Line2D doesn't draw full gradient if it doesn't have enough points #50076
Comments
We could add a node configuration warning for this purpose. |
In fact, There's kinda the same issue with the width curve of |
I get exactly the same problem in v3.4.4.stable.official [419e713]. |
Fixing this probably involves automatically creating "subdivision" points behind the scenes, and ensuring the line is made of at least as many points as the gradient. It may not be worth the added complexity, so maybe we should just document that you have to create enough points for the gradient's color to be accurately represented. |
I think the problem runs deeper. See the series of screen grabs below. In these examples, the line always has 3 points and it has the same gradient with 3 colors. Yet only the first (leftmost, black) and last (rightmost, white) color get properly rendered. The middle color (red) doesn't always get properly rendered in the line. Therefore, just adding the same amount of points in the line as there are colors in the gradient are not sufficient to fix this problem. |
@timcode77 What I mean is that the subdivided points should also be created at the same offset as the gradient. This should make it possible to render any gradient correctly, no matter how many points your line is actually made of. |
Ah ok. I misunderstood you. I was confusing "points": the things Line2D is comprised of in the editor and that are accessible to the user. Whereas you are talking about "subdivided points" which you are proposing get calculated behind the scenes and are not accessible to the user. Is that right? |
Yes 🙂 |
Note that this would work for a linear gradient. In But the thing is... there are gradient textures. Applying gradient with a texture is trivial and it works already (it of course has its own quirks):
I guess using the Also note that currently there's only one texture in the
BTW this example perfectly shows that texture UVs are kinda bugged and this for sure could be improved? 🤔 To sum up: not really sure what should be done about this issue. 🙂 |
Godot version
3.3 / 6ef0b8f
System information
W10
Issue description
It would maybe make sense if the offsets were ignored and instead it used only the colors, but it's not the case.
Steps to reproduce
gradient
property, with 3 colorsMinimal reproduction project
No response
The text was updated successfully, but these errors were encountered: