Skip to content
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

Allow for setting the X and Y FOV/frustrum sizes independently, and/or modifying the view transform #1250

Open
Tooniis opened this issue Jul 24, 2020 · 3 comments

Comments

@Tooniis
Copy link

Tooniis commented Jul 24, 2020

Describe the project you are working on:
A little open world 3D game involving memes

Describe the problem or limitation you are having in your project:
I'm trying to achieve this effect:
wide putin

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
The effect above can easily be achieved by decreasing the X FOV or increasing the Y FOV.

Furthermore, making it possible to modify the view transform would allow for more effects like shearing/skewing, thus making effects like this possible:
nether portal

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
fov will become a Vector2 rather than a float:
Screenshot from 2020-07-24 13-17-00
Either that, or fov will remain a float, but a new ratio property would be added:
Screenshot from 2020-07-24 13-19-59
The second option seems more suitable, as most people wouldn't want to set X and Y FOVs individually, so they would be able to just leave the ratio at 1 and not need to set 2 properties to the same value each time they want to change the FOV.

As for modifying the view transform, I think it would be a better idea to add a new custom_camera_transform property, which will be multiplied with the original view transform to result in the final transform. This way, all it would take to revert modifications is to set it to Transform.IDENTITY. Also, changing the view transform this way won't conflict with the transform computed by the engine using the given FOV value.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
As far as I know there is no way to modify X and Y FOVs or frustrum sizes or the view transform individually in a script, as Godot only exposes one FOV/frustrum size, and only allows for getting the view transform, which is computed by the engine using the given FOV/frustrum size.

Is there a reason why this should be core and not an add-on in the asset library?:
This requires modifications to the core.

@Tooniis Tooniis changed the title Allow for setting the X and Y FOV/frustrum sizes independently, or modifying the view transform Allow for setting the X and Y FOV/frustrum sizes independently, and/or modifying the view transform Jul 24, 2020
@Calinou
Copy link
Member

Calinou commented Jul 24, 2020

Related to godotengine/godot#7499. This proposal might also be relevant to #917, as anamorphic FOV is required to use a viewport width scale different from its height scale.

Edit: Anamorphic resolution scaling was implemented in godotengine/godot#52232.

Either that, or fov will remain a float, but a new ratio property would be added:

I would much prefer an aspect_ratio property compared to making fov a Vector2, as this won't break support for multiple aspect ratios. (aspect_ratio is probably better than ratio as it's more descriptive. That said, if people mistake it for a window aspect ratio setting, we may want to name it stretch_ratio instead.)

@Tooniis
Copy link
Author

Tooniis commented Jul 24, 2020

I didn't think much about the property names. I just wanted to describe my idea quickly.

@sairam4123
Copy link

Well, In my opinion stretch_ratio is better, than aspect_ratio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants