DPI scaling on viewport problem

I have my game change its ratio/resolution from horizontal to vertical by a key press. The engine default behavior is to scale down by its horizontal side( 2nd pic), which i don’t want. How can I make it scale by vertically(like 3rd pic)? For easier understanding, what I want is to make the top and bottom edge remain the same but only expand/shrink the side.

I know there is dpi scaling in the project settings but as far as i know its just for user interface.

Could anyone help me?

Hi there,

I had to bang my head against this problem few month ago but just accepted it. What you want is actually to “crop” the view instead of scaling it.

There is nothing useful to find about a proper solution. I am not sure how it would work with C++ and Blueprints are still pretty restrictive regarding such things. Perhaps it is just an easy option no one wants to mention.

I figured out a solution that might or might not work for you. It’s based on FieldOfView so it still does a bit of zooming and got the FOV effects. But at least it does the cropping of the view instead of scaling it.

I put this into the PlayerController. You can configure your Variables ScaleResolutionX and ScaleFOV to get the result you need.

Keep in mind that the Images are downscaled in this post, so just click the Links below to see the original size!


I hope that helps :slight_smile: Marooney

Thanks for taking your time to explain in detail. I end up using your method although its view may not be match precisely after adjust FOV, but its acceptable for the time being. Thanks Marooney.

Btw I found out that cine camera is able to set sensor width, which I think may be able to counter this problem, for my future projects :slight_smile:

Thx for the Info, this would be the second feature of the CineActorCamera that I was looking for in UE4.11. It’s new since 4.12 ^^