-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Make viewport grid visible on all three planes in orthogonal camera view #93869
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation is much better and the rationale makes sense to the (not so savvy) me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected.
Grid appearance is a bit strange when rotating the view in orthogonal mode though: the X/Y and Y/Z planes remain visible without any rotation even when the camera is slightly offset from the axis. This is not an issue introduced by this PR, but it'll become more noticeable since it'll be shown by default.
ortho_grid.mp4
It looks unintuitive, but it is actually displaying correctly. I think? Lol it depends on how the viewport math is being handled. The way I'm interpreting this is, when one of the axes is pretty much pointing toward the screen, the grid is parallel enough to the screen to render, and looks unrotated. However, because it's Ortho, the axis that's pointing at the screen looks like it's going diagonal (it always will unless perfectly perpendicular). This trips up our brain because it looks like the whole world is rotating while the grid isn't. But in reality it's barely rotating at all, and the effect is only noticeable in perspective. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this. I introduced those editor settings bools years ago, but yeah it makes sense to always have it enabled in ortho view.
Hi y'all, is this still waiting on something? Can we merge it? |
Thanks! |
This PR makes it so that grid visibility is only determined on a per-plane basis in perspective viewports. The rationale is that specifying per-plane grid visibility serves primarily to prevent the rendering of multiple grids that you don't need overlayed on top of each other in perspective mode, like this:

That is, it only makes sense in an environment where there at least exists the possibility of multiple grids being visible.
In ortho view, only one grid is ever visible. And its visibility is already controllable via two other visibility toggles in the viewport menu and in the view menu. It is even bound to a hotkey.
On the other hand, 3D devs often need grids the ortho views to align or measure. In its current state, Godot doesn't let you see the grid in ortho side view or ortho front view, unless it's also always visible in perspective view, even though you might only want a ground plane to be visible in perspective view. This workflow is extremely tedious, and there is no quick toggle that can address that.
This PR makes it so the existing editor settings for per-plane grid visibility essentially become perspective-view-only settings. The ortho view grid visibility would be determined exclusively via the view options. This should have zero to minimal impact on existing ortho-centric workflows. This behaviour is also consistent with other 3D tools and engines.

However, in the long run, we should really make the editor render a grid per-viewport. Right now, there is one grid instantiated, and in the 4-view layout, its properties are being determined entirely by the primary (top-left) viewport. But that is another bug for another PR.