So i've been wondering if there exists any dedicated shader for adjusting vertical or horizontal dimension of the screen, thus making it possible to correct aspect ratio. There're still many older games that don't have widescreen support or such support is simply impossible due to the nature of the game assets (2D backgrounds, for example). Simple shader for stretching or shrinking dimensions could be real life-saver. For example, "zooming" into 4:3 2D adventure game, sacrificing some part of the image in the buttom and/or from above but achieveing unstretched widescreen.
It's a pretty easy fix, just letting you know it's there.
By the way, is it possible to make the shader a bit more exact? Finding the value to perfectly convert 16:9 to 4:3 for example is just a lot of guesswork and the end result may not be perfect. Maybe inputs for current aspect ratio and target aspect ratio would work? Thanks.
The administrator has disabled public write access.
Aspect ratio adjustment shader 1 month 3 weeks ago #4
Thank you, that was good catch. For some reason error did not show up for me, it's fixed now.
Making exact shader is possible, but there is already dedicated feature for that in graphics card control panel Adjust desktop size and position, where you can set up if the game should be stretched, have black bars or be clipped if proportions don't match monitor native.
Warning: Spoiler![ Click to expand ][ Click to hide ]
This shader is more for hiding black bars, e.g. Mirrors Edge creates black bars to 16:9 that are painted, so GPU settings don't affect that.
Tell me if it works, or you really want exact values.
Or you can simply declare proper custom resolutions and choose "no scaling".
On NVidia GPUs "No scaling" works well with NO GPU forcing (display only scaling) if the height of the frame matches the monitor native one (4:3 -> 1440x1080, 16:10 -> 1728x1080 on a 1920x1080 panel)