- Home /
How to render at half resolution?
Does unity support rendering at a different resolution to the screen or window resolution? eg: Having a window resolution of 1280x720 and rendering 50% of that (640x360) then up-scaling it back to 1280x720.
Ive tried achieving this with a render texture and drawing it to the GUI but am still learning about them and was just wondering if there was a more direct approach.
Regards - Matt
Answer by GameVortex · Jan 08, 2014 at 09:47 AM
Unity has no specific support for rendering at a different resolution than the screen size, so your solution with using a render textures is the way to go most likely. One problem there is that render textures has a resolution in the power of two by default and you must make the render texture from script to have the specific resolution you want (as described in the script reference **here**).
Ah ok, yea I am creating my render textures via script at the moment. O well, Cheers for the reply.
No problem. =) If it answered your question, please mark it as answered so it will be removed from the Unanswered section.
Answer by Ruhan-_- · May 11, 2021 at 05:59 AM
This thread is old, but the correct answer is Screen.SetResolution https://docs.unity3d.com/ScriptReference/Screen.SetResolution.html not sure if the API existed back in 2014 when the original accepted answer was written.
A good idea is to use it with Screen.currentResolution.width and Screen.currentResolution.height
private void Awake()
{
float fraction = 0.5f; // Render at half the resolution of current screen
Screen.SetResolution( ( int ) (Screen.currentResolution.width * fraction), ( int ) (Screen.currentResolution.height * fraction), true, 60);
}
To reduce, simply change the value of the "fraction" variable. Even 0.8f for fraction gives a pretty good performance rise in most cases, especially if your device is fill rate bound like most low end mobile devices.
Your answer
