godotengine/godot

Frustum of `Camera3D` does not take into account the window size from `ProjectSettings`

DmitriySalnikov opened this issue · 3 comments

Godot version

v4.0.beta9.official [e780dc3]

System information

Windows 10, Vulkan

Issue description

For some reason, the frustum of the 3d camera has a square shape before the first opening of the 2d tab. After each opening the 2d tab, the shape is updated based on the viewport size.

Steps to reproduce

Godot_v4 0-beta9_win64_ylU8viGl6H

  • Open / Reopen MRP
  • Note the shape of the frustum
  • Switch to 2D tab and back
  • The shape of the frustum should become normal

Also, before opening the 2d tab, you can change the camera's FOV or Far and Near parameters.

Minimal reproduction project

Camera3D Frustum.zip

hey, i am trying to solve this issue but am a bit lost. Does any scaling of camera size take place when we switch 3d to 2d view ?

My assumption is that Camera3D uses the parameters of the same viewport that is used in the 2D tab. And while the 2D tab did not open, then its size is equal to the standard 512x512 (square like on GIF).
But I haven't studied this code in more detail🤷‍♂️

Here I described the problem in more detail #70628 (comment)