-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Fix Camera3D has an incorrect shape before opening the 2D tab #70628
base: master
Are you sure you want to change the base?
Conversation
@DmitriySalnikov so the frustum should be independent on viewport size or the frustum should scale without switching to 2D tab? |
@DmitriySalnikov should changing viewport size (in Project setting) affect SubViewport camera frustum ? |
No I think not. Even if you look at Camera3D gizmo, you can see that the shape of the camera inside the SubViewport depends only on the size of this subviewport. And a camera without a subviewport changes shape based on the size from ProjectSettings. godot.windows.editor.x86_64_hEUvFbv4w9.mp4 |
@DmitriySalnikov i think now it should work like godot 3. :D |
This works well, but only as long as the |
@DmitriySalnikov i am have some trouble solving this. The following code
is giving the following output for demo project attached in this issue but the scene tree does not have any subViewport node. |
I don't know a best way to find out which SubViewport is the root for the current scene |
c0b9417
to
a56a518
Compare
@DmitriySalnikov finally! i think this should do it. ✌️ |
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.
After making changes, you will need to squash commits so that only 1 commit remains in the end. This is required by the core team.
https://docs.godotengine.org/en/latest/community/contributing/pr_workflow.html#the-interactive-rebase
If everything is messed up, you will have to restore the branch from GitHub or a local backup.
f9daf98
to
0cc3159
Compare
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.
Everything works as intended!
However, I can't imagine why there was a condition size == Size2()
, because if the size
is less than 2px, then the engine throws a lot of errors and sometimes crashes (v4.0.beta10.official [d0398f6]). So I think there should be no problems.
@akien-mga godot 4.0 has already been released. Is it possible to merge this PR now? |
Not yet, I'm not sure this fix is appropriate. Fetching project settings all the time for such a core method doesn't sound like a good option. The real issue might be deeper and this looks like a workaround. |
Fixed default shape of frustum of camera3D, which had incorrect shape before opening the 2D tab.
Production edit: Fixes #70362