-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Provide a way to create gradient textures in 2D with different types of fill, not just 1D #1677
Comments
Just want to point out that ideally, we need a much better solution for Light2D masks. Perhaps even built into Light2D. Unity for instance has sprite lights, freeform (polygon), point, and parametric, and each one has gizmos for convenient editing of parameters. But I can also imagine other places besides lights where you'd want to use similar textures, like particle emission masks. So a Texture, or multiple different ones, would be ideal if possible - assuming they come with gizmos that you can edit in the scene, and that the parameters are dynamic and changeable at runtime. I would guess Unity uses some sort of SDF shaders for speed (I have already mostly replicated their point lights using SDF shader and a viewport, but it's obviously not convenient). Not that any of that would necessarily make this proposal irrelevant, but it's stuff to consider as there would definitely be overlapping functionality. |
@djrain You may be interested in CanvasGroup and CanvasItem clipping and the new 2D lighting system, both of which are coming in 4.0. |
@Calinou Thanks, both things look awesome, though I'm not sure exactly how clipping is related to this? And there aren't currently any plans for generating light textures, correct? |
It's been exactly one month since this proposal is created, and over a year for godotengine/godot#31655, so I think I'll start to implement this feature in Goost sooner than later (for Godot 3.2), once I'm done with some other features.
Polygon stuff is so prevalent in Godot that there's even |
This proposal is now implemented in Goost: goostengine/goost#43. |
Looking for a build-in solution for a vertical gradient texture lead me to godotengine/godot#29748 and that lead me here. And the reason I was looking for that is for creating a custom UI theme (No, I can't set shaders there). Vertical gradient in buttons is much better than horizontal gradient in buttons. And I consider having it build-in to be better for quick prototyping. I haven't decided on how I want the UI theme. And look at that pressed button. What if I want it in another color? Oh. |
Guess it's fixed now and should be closed. |
Describe the project you are working on:
Goost - Godot Engine Extension.
Describe the problem or limitation you are having in your project:
The current
GradientTexture
is only capable of generating horizontal one-dimensional textures. I'd expect such a class to provide a way to generate 2D gradients as well.Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Adding the Y component to the existing
GradientTexture
has the following benefits:Light2D
masks with radial fill without leaving the editor;TextureProgress
to also include the height;Helps use cases described in other proposals: #611.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
GradientTexture
class.GradientTexture2D
godot#42855: create a newGradientTexture2D
class.Reasons for creating a separate class for this:
GradientTexture
at all (used by particle systems, visual shaders, color correction);GradientTexture
;GradientTexture2D
is easier in the future, different editor icons can be created;Goost
or any other module. 😛If this enhancement will not be used often, can it be worked around with a few lines of script?:
Shaders can be used for this, but not as easy to use for beginners.
Is there a reason why this should be core and not an add-on in the asset library?:
There are existing plugins like https://github.com/Maujoe/godot-custom-gradient-texture, but usability asks for better. I've actually tried to create a new type of
Texture
but it seems like it's impossible to extend the base class via script as seen in godotengine/godot#42830. The only feasible way to create such a thing is by extendingImageTexture
but even then it lead to various inspector problems.The text was updated successfully, but these errors were encountered: