Can I use customized aspect ratio for Camera3D?

Godot Version

4.4

Question

Yes I know that doing that will distort the screen.
I don’t know how it works in Unity, but at least it did in Unreal.

Godot uses the page dimensions for the 3D camera; if you want the camera ratio to change, you must change it.

Perhaps doing so would cause the rendering resolution to be different from the screen resolution?

I have never tried changing the dimensions of the viewport with code at runtime, so I’m not sure how it will work, but I have another idea: you can have a viewport linked to the camera, then adjust the dimensions of the viewport and make the surrounding area black (if that’s what you want to happen for the empty space), so only the parts of the view that are consistent will be displayed. I use this to show multiple angles at the same time, and I think it will work for you too.

Thank you for replying.
I think that solution does not solve my case.
Because my game is pixel based game and I want to show pixel-perfect.
I need to set aspect ratio to 16.0 / 9.0 / sqrt(2.0)
Is this right?

This is not supported in 3D yet:

However, you can do it in 2D by using Camera2D’s zoom property where X can be set separately from Y.

If you want the entire viewport’s rendering to be stretched, use the canvas_items stretch mode and ignore stretch aspect in the Project Settings and resize the window to have a different aspect ratio from the base viewport size. However, this will also stretch 2D/UI rendering.

Thank you.
I’ll think another solution.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.