Open meganeroppy opened 3 years ago
If it's an exported, standalone Unity app you probably need to go through a render-to-texture camera to customize the resolution. If it's running inside the Unity editor, you can set a custom resolution for the play view which will also apply to UnityCapture. First google result explains it: https://answers.unity.com/questions/1193163/change-gameview-ratio-resolution-using-a-custom-in.html
Thanks for replying. I would like to solve this on standalone Unity app, so could you give me something like sample sending high-resolution picture (like 1920x1080) from unity app in smaller size window (like 800x450) with UnityCapture? I tried to achieve this with some ways, but it seems like that out picture with UnityCapture only available when game view is being displayed, and out picture resolution is always equal to game view.
Can you have a look at the UnityCaptureMultiCam scene in the UnityCaptureSample project? I think you can easily modify it to be just one camera by changing
public Camera CaptureCamera1, CaptureCamera2;
...
CaptureCamera1.targetTexture = new RenderTexture(CaptureResolutionWidth, CaptureResolutionHeight, 24);
CaptureCamera2.targetTexture = new RenderTexture(CaptureResolutionWidth, CaptureResolutionHeight, 24);
...
Graphics.DrawTexture(new Rect( 0, h, whalf, -h), CaptureCamera1.targetTexture);
Graphics.DrawTexture(new Rect(whalf, h, whalf, -h), CaptureCamera2.targetTexture);
to
public Camera CaptureCamera;
...
CaptureCamera.targetTexture = new RenderTexture(CaptureResolutionWidth, CaptureResolutionHeight, 24);
...
Graphics.DrawTexture(new Rect( 0, h, w, -h), CaptureCamera.targetTexture);
Also notice the public int CaptureResolutionWidth = 1920, CaptureResolutionHeight = 1080;
which defines the render-to-texture size (sets the window independent size rendered and used by UnityCapture).
I'm using UnityCapture to send game view to other app. The resolution sent from Unity app want to be high resolution but window size of Unity app itself need to be smaller. Is it possible?