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

Y Axis Gizmo randomly disappears at some angles #37016

Closed
nathanfranke opened this issue Mar 12, 2020 · 44 comments · Fixed by #83895 · May be fixed by #86465
Closed

Y Axis Gizmo randomly disappears at some angles #37016

nathanfranke opened this issue Mar 12, 2020 · 44 comments · Fixed by #83895 · May be fixed by #86465

Comments

@nathanfranke
Copy link
Contributor

nathanfranke commented Mar 12, 2020


Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.


Godot version:
951ecc4

OS/device including version:
Linux Mint 19.3

Issue description:
Y Axis (Maybe others) randomly disappear

Godot.Y.Axis.Gizmo.randomly.disappears.TqutiJX70xE.webm

Steps to reproduce:

Use mouse wheel to orbit the viewport

Minimal reproduction project:
I just made an empty project and saw this

@Calinou
Copy link
Member

Calinou commented Mar 13, 2020

Can you reproduce this in 3.2.1 as well?

@nathanfranke
Copy link
Contributor Author

No but it seems to shift around 1 pixel instead so shouldn't matter
0441d861

@Zylann
Copy link
Contributor

Zylann commented Mar 20, 2020

I got lines disappearing too in 2D with draw_line(), with a particular drawing transform.
Repro:
Graphing_line_disappears.zip
The value I entered in _view_scale is frequently coming up when zoom is used in my app.
Should I make this a separate issue?

@aaronfranke
Copy link
Member

This might not be a good solution, but maybe we should just force the 3D viewport to be an odd number of pixels wide? This could be done in the Node3D EditorPlugin so that this restriction doesn't exist for the other main screen plugins.

@nathanfranke
Copy link
Contributor Author

@aaronfranke while still not the best solution we should either fix the draw line call for the axis or round that to one pixel

@Calinou
Copy link
Member

Calinou commented Apr 17, 2020

If all else fails, we could draw two lines to ensure one of them is always visible, but this may make it too thick.

@nathanfranke
Copy link
Contributor Author

Someone should do a bisect from 3.2 since there it seems to shift instead (unless this is some problem with vulkan)

@Thane5
Copy link

Thane5 commented Aug 12, 2021

I always used to have this bug, but in v4.0.dev.calinou [7188cb6] it looks fine now.

@Kemeros
Copy link

Kemeros commented Oct 21, 2021

Still present.
Windows 10
v4.0.dev.custom_build [dc81583]

y_flicker

@aaronfranke
Copy link
Member

I have an ad-hoc fix here, but it's not perfect: #37995

@Kemeros
Copy link

Kemeros commented Oct 23, 2021

I have an ad-hoc fix here, but it's not perfect: #37995

@aaronfranke: Your ad-hoc fix seems to work indeed(Tested with artifact build).

@Kemeros
Copy link

Kemeros commented Oct 25, 2021

Did more tests.

An empty project doesn't do the problem on version v4.0.dev.custom_build [92a2380]

However. if i load a project, the bug is there.

So i started testing a bit. It's quite easy to reproduce.

Step 1: Make an empty project.
Step 2: Switch to 3D editor.
Step 3: Notice that the bug is NOT present.
Step 4: Add a node. Any base type node will do but i suggest 3D Scene so the editor doesn't switch to 2D.
Step 5: Notice that the bug IS present.
Step 6: Delete the previously added node.
Step 7: The problem stops again.

So adding a node, any node, triggers this issue.

Edit: repro steps triggers the bug because removing all the nodes resizes the viewport. Nodes are not related to the problem.

@Calinou
Copy link
Member

Calinou commented Oct 25, 2021

So adding a node, any node, triggers this issue.

This may be due to the 3D viewport having a slightly different size due to one of the docks being automatically resized. Try reproducing this after enabling distraction-free mode (Shift + F11 / Ctrl + Shift + F11).

@Kemeros
Copy link

Kemeros commented Oct 25, 2021

This may be due to the 3D viewport having a slightly different size due to one of the docks being automatically resized. Try reproducing this after enabling distraction-free mode (Shift + F11 / Ctrl + Shift + F11).

Tested with both Shift + F11 and Ctrl + Shift + F11:

Same behavior.

Edit:

@Calinou: Now that i think about it. Wouldn't it also affect X and Z if it was the viewport size?

@aaronfranke
Copy link
Member

aaronfranke commented Oct 25, 2021

@Kemeros The editor camera doesn't roll, so at the default camera position, the Y axis is always a vertical line on the screen. Then if the screen is a even number of pixels wide, it falls in-between two columns pixels so it disappears. The other axes are rarely perfectly straight and in-between two rows or columns of pixels on the screen, so they don't disappear.

Calinou is correct that whether this bug can be reproduced or not entirely depends on the size of the viewport. Try resizing it, carefully, one pixel at a time.

@Kemeros
Copy link

Kemeros commented Oct 25, 2021

@Kemeros The editor camera doesn't roll, so at the default camera position, the Y axis is always a vertical line on the screen. Then if the screen is a even number of pixels wide, it falls in-between two columns pixels so it disappears. The other axes are rarely perfectly straight and in-between two rows or columns of pixels on the screen, so they don't disappear.

Calinou is correct that whether this bug can be reproduced or not entirely depends on the size of the viewport. Try resizing it, carefully, one pixel at a time.

Ah yes i see. You are both correct. Removing the node actually resize the viewport in a position that the bug doesn't appear. If i play with the viewport, the bug comes back depending on the angle of the camera.

Should the axis lines be a 1 or 2 pixels thicker so it doesn't happen?

@Calinou
Copy link
Member

Calinou commented Oct 25, 2021

Should the axis lines be a 1 or 2 pixels thicker so it doesn't happen?

We could draw two axis lines close to each other to ensure that at least one of them is always visible. However, I think this will make the origin lines a bit too thick. It's worth trying nonetheless.

@Zylann
Copy link
Contributor

Zylann commented Oct 25, 2021

Making lines thicker are just workarounds, they dont seem to adress the root cause. I dont understand how lines are disappearing when lines is a rendering mode where this just can't happen like that Oo
If this is caused by the viewport being stretched such that rendered pixels don't match exactly the area (which can cause aliasing/throttle), then that must be fixed.

@Jasuse
Copy link
Contributor

Jasuse commented Nov 8, 2022

It seems to be dependent on project config
If renderer/rendering_method="gl_compatibility" (under [rendering]) is present in project,godot, the Y axis just flickers(relatively unnoticable), but if not, it will dissapear at certain angles

@Calinou
Copy link
Member

Calinou commented Nov 8, 2022

the Y axis just flickers(relatively unnoticable), but if not, it will dissapear at certain angles

This likely means OpenGL and Vulkan have different ways of rounding line widths when drawing lines. OpenGL prefers rounding up (meaning the line goes from 1 to 2 pixels wide), while Vulkan prefers rounding down (meaning the line goes from 1 to 0 pixels wide).

@HeraldOD
Copy link

HeraldOD commented Mar 11, 2023

I can reproduce this on a blank project with v4.0.stable.official [92bee43], Windows 10, Nvidia GTX 1650, Forward+ renderer
It seems to only happen around the normal zoom level, it gradually stops flickering when zooming out past ~500u, or in past ~1.8u
My monitor is 1680x1050 if that matters at all

@krummja
Copy link

krummja commented Apr 28, 2023

Not sure if this is useful information but I just noticed that the line stops disappearing when the viewport camera's angle is as high or low as it's able to go -- meaning that the Y axis that intersects the XZ plane is no longer visible.

Flickering:
image

No flickering:
image

Only difference between the first and second is a minute adjustment in camera angle.

@andersmmg
Copy link

This is still an issue, and I've seen it mentioned by people trying out the engine and being confused, notably here. It seems like it would be good to at least work around it soon

@Kemeros
Copy link

Kemeros commented Jul 4, 2023

Still present in 4.1 RC3

@PixelDrennen
Copy link

PixelDrennen commented Oct 12, 2023

458f17f0fa8bc0a88def6a99227d431f.mp4

Still present in Godot v4.1.1.stable.mono.
I wanted to note something that nobody else has said. The axis only disappears if you're looking at world origin.

Windows 10.0.19045 - Vulkan (Forward+)
dedicated NVIDIA GeForce RTX 2070 SUPER (NVIDIA; 31.0.15.3734)
AMD Ryzen 7 3700X 8-Core Processor (16 Threads)

@biswas08433

This comment was marked as off-topic.

@aaronfranke

This comment was marked as off-topic.

@biswas08433

This comment was marked as off-topic.

@aaronfranke
Copy link
Member

For those experiencing this issue, please test this PR, which should fix it: #83895

@mahmoudmagdy-7
Copy link

mahmoudmagdy-7 commented Oct 30, 2023

I experienced this issue as a new godot user and indeed slightly resizing the left or right panel fixes it

edit: I'm using a nvidia card, as said below that it's related to it

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Oct 30, 2023
@filipworksdev

This comment was marked as resolved.

@Calinou
Copy link
Member

Calinou commented Nov 1, 2023

Do you guys think it could be related to the driver/gpu?

Yes, this issue only occurs on NVIDIA GPUs as described above.

@IGame4FUN
Copy link

why not add some red and blue in there and make it subpixel? would solve the issue and make it look better
btw, for me resizing the viewport fixed it as well (nvidia gpu, godot 4.2.1)

@Calinou
Copy link
Member

Calinou commented Dec 15, 2023

why not add some red and blue in there and make it subpixel? would solve the issue and make it look better btw, for me resizing the viewport fixed it as well (nvidia gpu, godot 4.2.1)

A solution has already been found: #83895

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