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

Use antialiasing for the circles in the 3D editor rotation gizmo #51284

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Aug 5, 2021

Follow-up to #51250.

This is a crude approach that relies on drawing a second translucent circle. While not as good as proper polygon antialiasing or 2D MSAA, it looks OK in practice.

Preview

100% editor scale

Before After
image Gizmo

200% editor scale

Before After
image Gizmo

This is a crude approach that relies on drawing a second translucent
circle. While not as good as proper polygon antialiasing or 2D MSAA,
it looks OK in practice.
@Calinou Calinou requested a review from a team as a code owner August 5, 2021 16:09
@Calinou Calinou added this to the 4.0 milestone Aug 5, 2021
@floppyhammer
Copy link
Contributor

Could we make the axis letters still visible even when the axes point away from the camera?

In Blender:
blender_gizmo

What we have:
godot_gizmo

Such way we could avoid some weird moment at which none of the axis letters is visible and make the gizmo more recognizable.

@Calinou
Copy link
Member Author

Calinou commented Aug 6, 2021

Could we make the axis letters still visible even when the axes point away from the camera?

This should be done in a separate PR. cc @LightningAA

@AaronRecord
Copy link
Contributor

AaronRecord commented Aug 6, 2021

What we have:

@floppyhammer
Did the letters being offset weird happen before #51250? I don't think I changed any of the letter positioning code, and it still looks fine to me (at least on 3.x):
image

Also apparently they've updated the blender rotation rotation gizmo since 2.91 which was what I had installed, I do like the new one even more.

@AaronRecord
Copy link
Contributor

AaronRecord commented Aug 6, 2021

This is a crude approach that relies on drawing a second translucent circle. While not as good as proper polygon antialiasing or 2D MSAA, it looks OK in practice.

Could you add a before and after screenshot so it's easier to see the difference?

Also, how much work would it take to implement proper antialiasing to draw_circle(...)?

@Calinou
Copy link
Member Author

Calinou commented Aug 6, 2021

Could you add a before and after screenshot so it's easier to see the difference?

I added comparison images to the OP.

Also, how much work would it take to implement proper antialiasing to draw_circle(...)?

I don't know, I haven't read about implementing antialiasing for circles specifically (unless they're polygon-based, but I'm not sure if Godot's are).

@AaronRecord
Copy link
Contributor

AaronRecord commented Aug 6, 2021

I'm not sure that before image is completely accurate, the text color change was from #51250 (it doesn't really matter though, it still showcases the antialiasing).

@floppyhammer
Copy link
Contributor

@LightningAA Yes they did. And the offset might be caused by display scaling.

At v4.0.dev.custom_build [a4c8637], this occurs

Display Scale 150%
image

Display Scale 100%
image

@AaronRecord
Copy link
Contributor

AaronRecord commented Aug 7, 2021

@floppyhammer I'd open a separate issue for that then to keep this PR on topic.

@akien-mga akien-mga modified the milestones: 4.0, 4.x Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants