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

Implement a square fill mode in GradientTexture2D #6712

Closed
MewPurPur opened this issue Apr 17, 2023 · 0 comments · Fixed by godotengine/godot#76151
Closed

Implement a square fill mode in GradientTexture2D #6712

MewPurPur opened this issue Apr 17, 2023 · 0 comments · Fixed by godotengine/godot#76151
Milestone

Comments

@MewPurPur
Copy link

MewPurPur commented Apr 17, 2023

Describe the project you are working on

2D Platformer

Describe the problem or limitation you are having in your project

I realized how useful this could be when I wanted to add a mild vignette effect around the screen. The radial fill mode is good, but it's too thick around the corners. So I would have to go to a sprite editor to draw my own texture.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

A square gradient would solve this like so:

image

It can also be used for other effects, for example this retro-style checkpoint:

image

Or a grid tile:

image

Simple blob shadows, if you prefer a rectangular one for something (although it wouldn't look very nice without round corners):

image

Or just some other interesting textures.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Already implemented in godotengine/godot#76151

This is an example of what it does when the difference between offset points is different in X and Y:

image

I am not using a rectangle because the texture would "break" if the FROM and TO points share a coordinate. Also, there is the brain illusion that makes you think diagonals are darker, and I wonder if I should use rounded corners to get rid of that. Right now, though, I think a simple implementation using squares is the best, and rounded corners could be a separate mode.

If this enhancement will not be used often, can it be worked around with a few lines of script?

For some cases a normal sprite editor suffices, even without gradients. But otherwise you need to spend a lot of time or use another tool.

Is there a reason why this should be core and not an add-on in the asset library?

Discoverability for the people who would make use of it.

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

Successfully merging a pull request may close this issue.

3 participants