-
-
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
Improve GradientTexture to allow more advanced types of fills #31655
Conversation
clang format is wrong, i forgot to install the hooks |
efdec3f
to
8336245
Compare
force-pushed to fix formatting |
You should also bind the enums in If @reduz agrees with the feature, I'd ask you to add the matching documentation too (run |
bound the constants and ran doctool, but i didn't get any diff related to documentation, and the new properties was already visible in app |
You probably ran doctool wrong, since you bind new methods, there should be new documentation to fill. You should:
|
I don't see much of an use case for this at all, and it makes using the class more complex for its intended usage, which is particle systems, visual shaders, color correction, etc. |
I need to use Gradients on UI nodes. I cannot have rounded shape on an styleboxtexture respecting the gradient. So my only choice is to mix a white stylebox flag with a light2D |
You can make your own StyleBox class if you want, it's actually pretty easy |
Or actually, maybe you can't and we should make sure you can. |
At the very least, making the GradientTexture height adjustable and rotatable would be helpful for prototyping, as you can use them as a replacement for texture files or good old |
With the height option it would be nice as well for making Light2D masks without having to leave the editor. |
Gradient textures are very useful for TextureProgress, but I was always bothered by them not having height (and it was pretty much the only case when I used |
2D Gradient Texture are also very useful as shader input. It eliminates the need to painstakingly create them in an external tool, which are not always equipped for the task. |
I was seeking for an easy way to create sky-like horizon gradients in 2D (which can be repeated with |
I want this. |
@MarianoGnu Is this still desired? If so, it needs to be rebased on the latest master branch. Since this PR is a feature proposal, you should consider opening a proposal which explains example use cases and how this approach will solve the problem better than other approaches. Otherwise, abandoned pull requests will be closed in the future as announced here. |
If this gets closed, I'm willing to pick it up. |
@MarianoGnu @SekoiaTree Newbie two cents: I started playing with Godot last month to know the basics. I believe having only 1 possible gradient direction like right now is useless. Users seeing they can do so will be left disappointed (like I was). It's a teasing feature, it's there but quite incomplete. I'm a newbie so I just want to play with godot and making squares etc and not spend time trying to make assets in GIMP/Inkscape just to learn a few things. The gradients made it possible for me to just play inside Godot and not get distracted. I hope this will be implemented. Cheers! 🍻 |
If anyone would like to pick this up, they are welcome to. PRs should ideally be rebased frequently to avoid conflicts and to ensure they still work. The author of this PR has been inactive for a long time. |
@reduz, the current class is more like Do you know that Same for By the way, there's a similar class called I mean, particle systems, visual shaders, color correction are a bit too corner case for beginners, and "Gradient" is a more common and intuitive term which does not deserve to describe the intended usage of the existing class as in 3.2. |
Well, I just made finished another project, so I'll pick this up. I'll probably just make a completely new class and rename the old one to |
Well it was renamed for a reason. Please make sure to have the approval of core developers before spending time on such changes which might be rejected. |
In that case pinging @reduz who did the intial rename, and @akien-mga who merged karroffels PR for finishing the rename. c5dcbeb Suggests to me that ColorRamp ended up being renamed cuz the header was Gradient. Not because of deep semantic/functional reasoning. Personally I'd be fine with a ColorGradient1D and Gradient2D. It also allows a Gradient3D to be added if someone would ever want that. We shouldnt really touch CurveTexture with this discussion, its use case isnt graphics but maths. (it is necessary for it to be a "texture" only for use as a shader parameter) |
@akien-mga yes, of course, sorry. |
Reminds me of animation nodes/resources (see |
3152c82
to
90b2561
Compare
Rebased the PR on top of master, also cherry picked for 3.2 and made compatibility changes at #41774 |
90b2561
to
8ad231c
Compare
Just ran into this issue. Thank you for the work! For now I'm just rotating the UV coordinates in a simple shader: shader_type canvas_item;
void fragment() {
COLOR = texture(TEXTURE, vec2(1.-UV.y, UV.x));
} |
Note that I've also been working on this in #42855 (adds a separate class for this), based on this comment: #31655 (comment). |
#42855 appears to be the success of this pr. So if that's correct, we should migrate to that pr and close this one. |
close this because it implement in goost ???!!! |
@CsloudX as has been recommended by reduz, pull requests for new features should not be created. However, both this and #42855 have a common proposal at GIP, see godotengine/godot-proposals#1677. If you'd really like to see this feature directly in Godot and not just in Goost, people must provide their own real-life use cases, and any limitations you stumble upon "must not be a speculation", as reduz says. By "real-life" I mean that you must have a project you're working on where you cannot proceed effectively without this feature. I hope this clarifies Godot's current development approach somewhat.
This PR is like two years old, so I totally understand the decision to outright close the PR at its state by the author, and it can always be re-opened. If there's no decision making process going on, a person does not have to wait forever in the seek of feedback, it makes perfect sense to move on, don't you think? So, it's not necessarily because this feature is available somewhere else, it's because of lack of decision-making process regarding this feature. But again, linking a proposal for this feature: godotengine/godot-proposals#1677. Hopefully, proposals will be thoroughly looked at once Godot 4.0 is out, I'd just like to say that ignoring (intentional or not) is not a solution to solve a problem. |
Pull Request sponsored by IMVU
This PR allows to create different linear and radial 2D textures with repeat and mirror options, while keeping the previous property values as default (2048px width, 1px height and left to right linear fill). Some examples bellow:
Bugsquad edit: This closes #18387.