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

Add optional antialiasing to TextureProgressBar #4354

Open
Calinou opened this issue Apr 5, 2022 · 0 comments
Open

Add optional antialiasing to TextureProgressBar #4354

Calinou opened this issue Apr 5, 2022 · 0 comments

Comments

@Calinou
Copy link
Member

Calinou commented Apr 5, 2022

Related to #1297.

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

TextureProgressBar does not use antialiasing like StyleBoxFlat does. This is especially noticeable in circular progress bars, especially if they move slowly or not at all.

For untextured linear progress bars, ProgressBar with a StyleBoxFlat can be used instead. However, this is not possible for circular progress bars, bilinear progress bars and textured progress bars of any kind.

Without antialiasing With antialiasing (simulated with 16× supersampling)
image 2022-04-06_01 51 59

Testing project (master only): test_textureprogressbar_antialiased.zip
Press Space to play/pause progress.

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

Add optional antialiasing to TextureProgressBar. Antialiasing would be enabled by default, but it can be disabled for art styles where it's not suitable (e.g. pixel art games).

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

Add anti_aliasing and antialiasing_size properties (defaults: true and 0.625), like in StyleBoxFlat. antialiasing_size controls the size of the antialiasing feather, and can be increased for artistic purposes if needed.

TextureProgressBar' internal polygon generation should be modified to also generate vertex colors for each point, with the feather using Color(1, 1, 1, 0) for the transparent ends.

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

No.

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

This can be implemented with an add-on, but it would essentially have to reimplement TextureProgressBar from scratch.

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

No branches or pull requests

1 participant