# Setting up a low res viewport to stretch in Unity

I am working on porting a low-res game over to Unity. In my previous engine, I had the option to set a native resolution (say, 160 x 144), and it would automatically stretch when the player entered fullscreen (with options for whether you wanted to keep the same aspect ratio, or stretch).

I am having trouble figuring out how to set up something similar in Unity. I see that you can play around with resolution settings from Edit > Project Settings > Player. I tried various combinations of Default Is Fullscreen, Default Is Native Resolution, and Default Screen Width and Default Screen Height, but I haven't been able to get it to work.

When I play the scene in the editor, the viewport is still much larger than my desired resolution. And when I Maximize On Play, the FOV is even larger.

I Googled around, but couldn't find an answer that helped.

Any advice?

## 1 Answer

1. Set up a RenderTexture of your desired resolution. You can create this as an asset in your project folder, or via code at the start of the game.

2. Set this RenderTexture as the target texture for your main camera(s). This will ensure the scene is rendered at the desired resolution.

3. Display the contents of this RenderTexture to the whole window. You can do this in a few ways, eg. as a RawImage component in a screenspace overlay canvas, or as an unlit textured quad positioned in front of a second camera (configure the camera's depth to render after the main camera(s), and its layers so that it sees only the quad).