- Home /
Different camera aspect ratios/resolutions?
Hello! I'm working on a project where the idea is you're playing on a fictional DS-esque system. While the main camera shows the ds and the background room, and should be 16:9. The DS uses a 4:3 aspect ratio and a resolution of about 256 x 192 pixels. My question is, how can I make the DS cameras render with those settings while keeping the main camera as usual? Thanks in advance!
Answer by Eno-Khaon · Feb 19 at 08:33 PM
If you intend to use RenderTextures for the screen(s), then you barely have to do a thing, since those textures can be set to whatever resolution (and, by extension, aspect ratio) you want.
Untested
RenderTexture topScreenRT;
Camera topScreenCam;
RenderTexture bottomScreenRT;
Camera bottomScreenCam;
void Start()
{
topScreenRT = new RenderTexture(256, 192, 16, RenderTextureFormat.ARGB32);
topScreenRT.Create();
topScreenCam.targetTexture = topScreenRT;
bottomScreenRT = new RenderTexture(256, 192, 16, RenderTextureFormat.ARGB32);
bottomScreenRT.Create();
bottomScreenCam.targetTexture =bottomScreenRT;
}
This isn't exactly a comprehensive solution, but ought to be a viable starting point in approaching this. Essentially, you can define anything you want to be rendered on those additional cameras, while the RenderTextures will enforce their defined (local) render resolutions.
Your answer
![](https://koobas.hobune.stream/wayback/20220613053220im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can I force FPS per camera? 1 Answer
Camera Rendering Skewed Until Transform Adjusted 0 Answers
How to call Camera.Render from Update 1 Answer
Camera image flickers with SteamVR 0 Answers