Need Help Programming Different FOVs for Camera3D

Godot Version

Godot 4.4

Question

Hi, as mentioned in the topic’s title, I would love any help in programming the Camera3D to be similar to cinematic cameras. A couple weeks back, I found a website called Physically Based (https://physicallybased.info/), which has information about different cameras’ open gate. I would love to test out the different cameras’ open gate to see which would be most fitting for my game projects. An example would be Canon EOS C400, which has a sensor size of 36.00 x 19.00 mm (or 6000 x 3164 pixels). Could someone help me in figuring out how I would go about programming that?

Edit: And if at all possible, could you help in showing me how to script this in both GDScript and C#?

This… kind of isn’t how a 3D camera works, at least for polygonal 3D. The 3D camera is a mathematical construct; basically it’s a 4x4 transform matrix that turns 3D vertex values into projected 2D vertex values, which are then used to rasterize the display. The “sensor size” is whatever resolution you decide to render to, and the aspect ratio is encoded into the transform matrix. The field of view is as well.

There’s no physical light modelling in this, no lens, no shutter. Perspective is applied in the camera matrix as a divide by distance, rather than as a natural consequence of the inverse square law.

All you can really take from that website is the aspect ratio; none of the rest of it is really applicable here.

2 Likes

Ah, I see. That is disappointing. Would’ve been cool if it was applicable in Godot. You could have full control over the sensor size of the camera by entering the sensor height and width - like how Unreal Engine does it - create any time of video camera for cutscenes or gameplay.

You can adjust the size of the render target, and that’s your “sensor size”, but all you can really do is make the resolution worse than native. This will be true in Unreal as well.

For example, you have the Canon EOS at 6000x3164 pixels. You can certainly render to that, but you can’t display that unless your computer has a monitor with at least that resolution. You can display the image that got rendered, but it will have to be re-rendered at a low enough resolution for your display to handle.

That is completely understandable if a computer doesn’t have that kind of resolution. Would a resolution of 1920 x 1080 or 2048 x 1080 be in most computers?

Most desktop machines these days do at least 1920x1080. Some do 2560x1440, some 4K, and then there are a variety of others including the very widescreen options. Laptops are another beast entirely, as are mobile.

That’s good to know. I was asking because I just found out this: The Canon EOS C400, which I used for my example, has different full frames: there is the 36.0 x 19.0 mm I originally mentioned, and then there is 33.8 x 19.0 mm. The 33.8 x 19.0 mm-based full frame - which I found on a website showing off the camera’s specs - is apparently used by screens that use a resolution of 1920 x 1080.